As part of my CI running on AppVeyor I'm uploading a log from the installer using Push-AppveyorArtifact. While most of the time it works perfectly for a single PR the upload fails with the following output:
Push-AppveyorArtifactInternal : Error uploading artifact to the storage: One or more errors occurred.
At C:\Program Files\AppVeyor\BuildAgent\Modules\build-worker-api\build-worker- api.psm1:209 char:2
+ Push-AppveyorArtifactInternal -FullPath $fullPath -FileName $File ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Push-AppveyorArtifactInternal], Exception
+ FullyQualifiedErrorId : System.Exception,Appveyor.BuildAgent.Api.Utils.PushAppveyorArtifactInternalCmdlet
Command executed with exception: Error uploading artifact to the storage: One or more errors occurred.
Given this output is not very informative I am at a loss and have no idea how this can be debugged further. List of things I've tried:
- Contacted AppVeyort support - no reply for over a month
- Made sure that the file I am trying to upload exists and is not empty
- Since as part of the problematic pull request the process which creates this file fails to exit properly I've tried killing it manually, confirmed that it is no longer active and retied the upload - same error.
- Tried increasing the verbosity of
Push-AppveyorArtifactby providing-Verbose -Debugwhich appears to be the highest verbosity level possible but no more info shows up.
It looks like the following sequence causes the upload to fail:
- The process which creates a log file which fails to upload later on is started and then we're waiting for it to finish with
wait-processfor 3 minutes - If it finishes in the specified time the log file created it creates is uploaded successfully
- Since we want to know if the process exited or not we need to specify
-ErrorAction Stopfor thewait-processinvocation. - If
wait-processraises an exception i.e. process is still running thePush-AppveyorArtifactfails with the error shown above