Issue with artifact download in self-hosted windows pipeline

Gabe Klavans July 26, 2023

Hi, I'm trying to run a pipeline with a step that uses the files from the saved artifacts of a previous step.

This was all working as intended, then one day after updating my windows runner, I started getting this error on the last step:


Remove-Item: C:\Users\admin\bitbucket\runner3\temp\1587c5ad-d391-509f-ac50-f899b6047962\1690309415217\tmp\setupArtifacts16333458990794472818.ps1:19
Line |

  19 | Remove-Item -Recurse -Force "C:\Users\admin\bitbucket\runner3\runner\ .
     | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The system cannot find the path specified.

Where C:\Users\admin\bitbucket\runner3\runner\ is the location of the runner bin folder. I'm not sure why it's trying to run this incomplete command. The result is that only some of the artifacted folders are present in the step's working directory (I used `ls` to confirm this in the step's script), even though it says all the artifacts were successfully downloaded and extracted. Why am I getting this error and seeing this behavior?

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 27, 2023

Hello @Gabe Klavans and thank you for reaching out to Community!

Looks like the error is occurring when the runner is trying to remove the artifacts from the temporary folder where they are put after being downloaded and copied to the local build folder.

I was not able to reproduce the same error when using Windows runners with artifacts in the step, so I would suggest the following steps to try troubleshooting the issue : 

  • Update your Windows Runners version to the latest available. Version 1.490 is the latest by the time I write this comment. You can download and extract this version using the below commands : 
    Invoke-WebRequest -Uri https://product-downloads.atlassian.com/software/bitbucket/pipelines/atlassian-bitbucket-pipelines-runner-1.490.zip -OutFile .\atlassian-bitbucket-pipelines-runner.zip


    Expand-Archive .\atlassian-bitbucket-pipelines-runner.zip


    cd .\atlassian-bitbucket-pipelines-runner\bin


    .\start.ps1 -accountUuid <rest of arguments of the predefined command you received when creating the runner>
  • Make sure there are not multiple instances of the same runners being executed in the host machine. Having more than one instance of the same runner will cause race conditions as you will have multiple runner instances executing the same instructions. 
  • If possible, test setting up the runner in a different machine and check if the error is reproducible. You can also try to recreate a runner from the UI and verify if the error persists.
  • Review the Windows Runners log locally to check if they contain any additional information about what might have caused the error.

Let me know in case you have any questions.

Thank you, @Gabe Klavans !

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events