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

          bnovc created issue -

          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.
          Nicolas De Loof made changes -
          Resolution New: Won't Fix [ 2 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          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.
          Roland Schulz made changes -
          Resolution Original: Won't Fix [ 2 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
          Ron MacNeil made changes -
          Link New: This issue is related to JENKINS-25353 [ JENKINS-25353 ]
          Mark Waite made changes -
          Link New: This issue is duplicated by JENKINS-35648 [ JENKINS-35648 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 142879 ] New: JNJira + In-Review [ 186042 ]

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

              Created:
              Updated: