Skip to content

download-artifact fails on Windows #58

@gera2ld

Description

@gera2ld

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions