git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Yuri <yuri@rawbw.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [BUG REPORT] Intermittent errors: Unable to create '/usr/ports/.git/index.lock': File exists.
Date: Thu, 9 Sep 2021 16:19:14 -0400	[thread overview]
Message-ID: <YTpsQtJa2rX691c0@coredump.intra.peff.net> (raw)
In-Reply-To: <1fcdeb8f-5869-cfe4-6063-8d4fb5da709c@rawbw.com>

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

      reply	other threads:[~2021-09-09 20:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YTpsQtJa2rX691c0@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=yuri@rawbw.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).