Pipeline build failed with We couldn't clone the repository. Try rerunning the pipeline error
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary

Platform: Bitbucket Pipeline Self-hosted Runners - All
Solution
Possible Causes:
The host machine may lack the necessary prerequisites as outlined in the Runner specification.
There could be multiple instances of the runner operating on the same machine.
The runner might not possess the required permissions for the directory necessary to clone the repository on the host machine.
Troubleshooting Steps:
Verify whether the host machine meets the necessary prerequisites as outlined by the Runner. Please refer to the Prerequisites section of the relevant Runner documentation to ensure that all requirements are fulfilled.
Reconfigure the Runner
Stop the Runner.
For the Linux Docker Runner:
First, identify the existing Runner container. The following command will return the container ID and name of the runner container:
1
docker container ls | grep runner
Next, stop the Runner container using the container ID or name obtained from the previous command:
1
docker container stop <container_id_or_name>
Finally, remove the Runner container:
1
docker container rm <container_id_or_name>
For Linux Shell, MacOS Shell, or Windows Shell Runner:
Stop the process that is currently running the runner. This can be accomplished through the terminal, task manager, or service manager, depending on the method used to initiate the runner.
For Linux and MacOS, locate the runner’s process ID (PID) and terminate it:
ps aux | grep -E 'java.*runner' kill <PID>
On Windows, utilize the Task Manager or PowerShell to stop the process.
Delete the
build
folder.Navigate to the path /atlassian-bitbucket-pipelines-runner/bin/../temp/ where you will find a folder for each runner on that machine, formatted as <runner-uuid>.
For each of the runner's folders, open the folder and check for the existence of a build folder. If it is present, please delete the folder along with its contents.
Setup the Runner - Follow the instructions for setting up the Runner according to the specific Runner type.
For the Windows Shell Runner, ensure that the Runner host machine has all the necessary permissions as described in the “Allow unsigned scripts to run in PowerShell” section of Windows Shell
Was this helpful?