On Windows with Windows Defender enabled (the default behavior), download-artifact always fails with the error below:
cannot move downloaded into final location (another process downloaded faster?) path=xxx\winCodeSign\winCodeSign-2.6.0
tempFile=xxx\winCodeSign\087033947
error=rename xxx\winCodeSign\087033947 xxx\winCodeSign\winCodeSign-2.6.0: Access is denied.
I found the related code here:
|
func RenameToFinalFile(tempFile string, filePath string, logger *zap.Logger) { |
|
err := os.Rename(tempFile, filePath) |
|
if err != nil { |
|
logger.Warn("cannot move downloaded into final location (another process downloaded faster?)", zap.String("tempFile", tempFile), zap.Error(err)) |
|
} |
I guess it's because the files are being used by Windows Defender when app-builder tries to move it. Could you retry the operation later or sleep a while before trying to move the files just downloaded? I'm glad to send a PR if you agree with it.
I can confirm this error disappears if Windows Defender is disabled. But we could not ask every user to disable Windows Defender before using a tool depending on app-builder, so I guess this is something app-builder should take care of.
Thanks in advance.
On Windows with Windows Defender enabled (the default behavior), download-artifact always fails with the error below:
I found the related code here:
app-builder/pkg/download/artifactDownloader.go
Lines 158 to 162 in c793457
I guess it's because the files are being used by Windows Defender when app-builder tries to move it. Could you retry the operation later or sleep a while before trying to move the files just downloaded? I'm glad to send a PR if you agree with it.
I can confirm this error disappears if Windows Defender is disabled. But we could not ask every user to disable Windows Defender before using a tool depending on app-builder, so I guess this is something app-builder should take care of.
Thanks in advance.