Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-12513

git plugin should automatically remove .git/index.lock if the job is killed

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major Major
    • git-client-plugin
    • None

      Git will create a .git/index.lock file when it is executing. If the job is killed, the git process is killed, and therefore the lock file is left over. All subsequent attempts to run git in that workspace on that machine will fail.

      One solution is to delete this file in the post-build task of the job automatically.

          [JENKINS-12513] git plugin should automatically remove .git/index.lock if the job is killed

          Benny Chew added a comment -

          Was wondering on the progress of this issue.. we get this issue when the job is aborted when git is executing. The workaround works, but I guess isn't ideal as it would've to be added to every job separately (and would require separate delete commands for linux/windows). Cheers!

          Benny Chew added a comment - Was wondering on the progress of this issue.. we get this issue when the job is aborted when git is executing. The workaround works, but I guess isn't ideal as it would've to be added to every job separately (and would require separate delete commands for linux/windows). Cheers!

          Samuel Haddad added a comment -

          I am also looking to see if there has been update on this issue?

          Samuel Haddad added a comment - I am also looking to see if there has been update on this issue?

          aborting the build process as git is running will leave the working copy in a bad state, so require to clean workspace first. Just removing the lock isn't safe enough.

          Nicolas De Loof added a comment - aborting the build process as git is running will leave the working copy in a bad state, so require to clean workspace first. Just removing the lock isn't safe enough.

          Roland Schulz added a comment -

          With "Clean after checkout" it should be safe to delete the lock file. And even if you don't like that option, their should be a way to clean the workspace if a lock file exists.

          Roland Schulz added a comment - With "Clean after checkout" it should be safe to delete the lock file. And even if you don't like that option, their should be a way to clean the workspace if a lock file exists.

          NhatKhai Nguyen added a comment - - edited

          Any update? We need this to fix too. PLEASE
          oleg_nenashev

          NhatKhai Nguyen added a comment - - edited Any update? We need this to fix too. PLEASE oleg_nenashev

            Unassigned Unassigned
            bnovc bnovc
            Votes:
            29 Vote for this issue
            Watchers:
            29 Start watching this issue

              Created:
              Updated: