All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG REPORT] Intermittent errors: Unable to create '/usr/ports/.git/index.lock': File exists.
@ 2021-09-09 19:29 Yuri
  2021-09-09 20:19 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Yuri @ 2021-09-09 19:29 UTC (permalink / raw)
  To: Git Mailing List

Once every ~20 times I call 'git commit' it fails like this:

$ git commit .
fatal: Unable to create '/usr/ports/.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.


There's no other instance.

It usually succeeds next time.


git-2.32.0

OS: FreeBSD 13


Yuri


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [BUG REPORT] Intermittent errors: Unable to create '/usr/ports/.git/index.lock': File exists.
  2021-09-09 19:29 [BUG REPORT] Intermittent errors: Unable to create '/usr/ports/.git/index.lock': File exists Yuri
@ 2021-09-09 20:19 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2021-09-09 20:19 UTC (permalink / raw)
  To: Yuri; +Cc: Git Mailing List

On Thu, Sep 09, 2021 at 12:29:32PM -0700, Yuri wrote:

> Once every ~20 times I call 'git commit' it fails like this:
> 
> $ git commit .
> fatal: Unable to create '/usr/ports/.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.
> 
> 
> There's no other instance.

In previous cases of this we've seen, there usually _is_ another
instance, just not one directly triggered by the user. E.g., some GUI
clients will trigger "git status" in the background, which tries to
refresh the index.

If you're running any other Git-related tools (or anything via cron),
those might be worth investigating. Otherwise you might try using OS
tools to see which processes might be opening such a file (on Linux I'd
use inotifywait, but I'm not sure what's available on FreeBSD).

If you do find the culprit, one solution is to get it to use the
"--no-optional-locks" option. See the discussion of that option and
GIT_OPTIONAL_LOCKS in git(1), as well as the "BACKGROUND REFRESH"
section of git-status(1).

-Peff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-09 20:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 19:29 [BUG REPORT] Intermittent errors: Unable to create '/usr/ports/.git/index.lock': File exists Yuri
2021-09-09 20:19 ` Jeff King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.