Git에서 index.lock 에러 메시지 해결
Jenkins에서 빌드를 진행할 때, Perforce에서 소스코드를 가져오고 빌드한 다음 Git으로 commit하고 push하는 과정을 거치고 있었다.
어느 날 빌드에 계속 문제가 생겨 살펴보던 중 Jenkins 로그에서 다음과 같은 메시지를 발견했다.
Locking support detected on remote "origin". Consider enabling it with:
$ git config lfs.https://aaa.com/project.git/info/lfs.locksverify true
To https://aaa.com/project.git/server.git
* [new tag] 20220412-01 -> 20220412-01
fatal: Unable to create 'D:/aaa/git/server/.git/index.lock': File exists.
Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.
fatal: Unable to create 'D:/aaa/git/server/.git/index.lock': File exists.
Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.
Everything up-to-date
문제는 이 에러가 발생해도 Jenkins 빌드 결과가 Success로 표시된다는 점이었다. 에러가 발생하고 있다는 사실 자체를 알아채는 데 시간이 꽤 걸렸다.
위와 같은 에러 메시지가 나올 때는 index.lock 파일을 직접 삭제하면 해결된다.
댓글 남기기