Checkout failed: Another git process seems to be running in this repository

1 minute readKnowledge base

Issue

During a checkout operation, the checkout process fails with the following error:

ERROR: Checkout failed
hudson.plugins.git.GitException: Command "git checkout -f ..." returned status code 128:
stdout:
stderr: fatal: Unable to create /var/jenkins_home/workspace/.../.../.git/index.lock': File exists.

Resolution

This typically happens if a controller or agent goes offline while the job is running and the failing controller/agent is not able to complete the process of removing the index.lock file. Removing this file manually from the workspace mentioned (/var/jenkins_home/workspace/…​/…​/.git/index.lock) should unblock this build.

Please remove this file manually and try running the checkout step again.

Tested product/plugin versions

  • CloudBees CI on modern cloud platforms - managed controller 2.426.3.3

  • git 5.2.1