Issue when saving an artifact on self-hosted runner.
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
While using a self-hosted runner, the user faces an issue while trying to save an artifact. The runner log error message says:
[2023-06-09 07:01:22,877] An error occurred whilst creating an artifact from upload.com.atlassian.pipelines.stargate.client.core.exceptions.
StargateConflictException: Response Summary: HttpResponseSummary{httpStatusCode=409, httpStatusMessage=Conflict,
bodyAsString={"error":{"message":"Conflict","detail":"Artifact in pipeline {pipeline-uuid} already exists.",
"data":{"key":"file-service.artifact.already-exists","arguments":{}}}}}
Environment
Bitbucket pipelines with self-hosted runners.
Cause
The most likely scenario is that the user might be accidentally running two instances of the same runner UUID/OAuth ID.
Reproduction steps:
- Create two different directories for the runner downloaded from UI.
- Create one runner in UI and copy the `./start.sh` command.
- Run the same ./start.sh command with the same OAuth client ID and secret in both runner directories.
- Both runner instances are able to come online at the same time.
- Run a job against the runner label, and both runner instances will pick up the step. Because these two instances are competing with each other, multiple requests for artifact upload get delivered at the end, causing a conflict.
Solution
To solve it, check whether multiple instances of the same runner UUID are running concurrently. If yes, please shut down one runner instance and this should solve the issue.