Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destination file path already exists #242

Open
mhudasch opened this issue Jun 6, 2024 · 0 comments
Open

Destination file path already exists #242

mhudasch opened this issue Jun 6, 2024 · 0 comments

Comments

@mhudasch
Copy link

mhudasch commented Jun 6, 2024

Kind of adjacent to #194 .
When starting a tool download with the function downloadToolWithRetries and a subsequent Abort from the server causes the a retry which is ok. The problem is that a partially downloaded file is placed in the _temp folder of the agent and the first retry of download fails immediately because a destination file with the name already exists. In the catch block any destination file must be cleaned up to retry the download successfully.

see:

Agent.Version=3.218.0
Agent.TempDirectory=C:\az-fake\a1\_temp
testing directory 'C:\az-fake\a1\_temp'
Downloading: https://nodejs.org/dist/v19.9.0/node-v19.9.0-win-x64.7z
destination C:\az-fake\a1\_temp\node-v19.9.0-win-x64.7z
downloading
Content-Length of downloaded file: 18547594
creating stream
Attempt 1 failed. Retrying after 500 ms
download complete
Downloaded file size: 15129050 bytes
Content-Length (18547594 bytes) did not match downloaded file size (15129050 bytes).
node-v19.9.0-win-x64.7z
Agent.Version=3.218.0
Agent.TempDirectory=C:\az-fake\a1\_temp
testing directory 'C:\az-fake\a1\_temp'
Downloading: https://nodejs.org/dist/v19.9.0/node-v19.9.0-win-x64.7z
destination C:\az-fake\a1\_temp\node-v19.9.0-win-x64.7z
Attempt 2 failed. Retrying after 1000 ms
node-v19.9.0-win-x64.7z
Agent.Version=3.218.0
Agent.TempDirectory=C:\az-fake\a1\_temp
testing directory 'C:\az-fake\a1\_temp'
Downloading: https://nodejs.org/dist/v19.9.0/node-v19.9.0-win-x64.7z
destination C:\az-fake\a1\_temp\node-v19.9.0-win-x64.7z
task result: Failed
Waiting for the debugger to disconnect...

Destination file path already exists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant