git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* "lock file exists" when fetching in bare clone of repository
@ 2025-08-20 20:54 Joe Drew
  2025-08-20 21:33 ` Jeff King
  0 siblings, 1 reply; 16+ messages in thread
From: Joe Drew @ 2025-08-20 20:54 UTC (permalink / raw)
  To: git@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 3613 bytes --]

Hi there!

I've got what I think is a bug in recent versions of git, at least as packaged for macOS by homebrew.

I'm cloning a fresh copy of a repository into a bare directory:

        $ mkdir tmp
        $ cd tmp
        $ git init --bare
        $ git remote add origin -- <VALID-URL>.git
        $ git fetch -f origin 'refs/heads/*:refs/heads/*' 'refs/tags/*:refs/tags/*'

I'm doing this in a sort of roundabout way because this is exactly what `go mod download` does.

The fetch fails, returning status 255, with the below error message:

        remote: Enumerating objects: 18733, done.
        remote: Counting objects: 100% (562/562), done.
        remote: Compressing objects: 100% (448/448), done.
        remote: Total 18733 (delta 399), reused 144 (delta 112), pack-reused 18171
        Receiving objects: 100% (18733/18733), 25.32 MiB | 7.93 MiB/s, done.
        Resolving deltas: 100% (14608/14608), done.
        From <VALID-URL>

        [.... quite a number of branches and tags .....]

        error: cannot lock ref 'refs/heads/ptv-2164': Unable to create '/Users/joe.drew/tmp/./refs/heads/ptv-2164.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.

This file doesn't exist; in fact, no such files exist:

        $ ls refs/heads
        $

However, the branch _does_ exist on the remote.

This error _does not_ happen in the Apple-supplied version of git: `git version 2.39.5 (Apple Git-154)`, but does in 2.51.0, which I installed with homebrew. (If this is a packaging error, I'll happily report to homebrew.)

I'd be more than happy to continue debugging this, though I can't share the repository as it's proprietary. I've also attached the git diagnostics, but they're not particularly helpful, I don't think.

[System Info]
git version:
git version 2.51.0
cpu: arm64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
libcurl: 8.7.1
zlib: 1.2.12
SHA-1: SHA1_DC
SHA-256: SHA256_BLK
default-ref-format: files
default-hash: sha1
uname: Darwin 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041 arm64
compiler info: clang: 17.0.0 (clang-1700.0.13.3)
libc info: no libc information available
$SHELL (typically, interactive shell): /opt/homebrew/bin/bash


[Enabled Hooks]

CONFIDENTIALITY NOTICE AND DISCLAIMER : This telecommunication, including any and all attachments, contains confidential information intended only for the person(s) to whom it is addressed. Any dissemination, distribution, copying or disclosure is strictly prohibited and is not a waiver of confidentiality. If you have received this telecommunication in error, please notify the sender immediately by return electronic mail and delete the message from your inbox and deleted items folders. This telecommunication does not constitute an express or implied agreement to conduct transactions by electronic means, nor does it constitute a contract offer, a contract amendment or an acceptance of a contract offer. Contract terms contained in this telecommunication are subject to legal review and the completion of formal documentation and are not binding until same is confirmed in writing and has been signed by an authorized signatory.

[-- Attachment #2: git-diagnostics-2025-08-20-1637.zip --]
[-- Type: application/zip, Size: 790 bytes --]

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

end of thread, other threads:[~2025-09-02 10:55 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-20 20:54 "lock file exists" when fetching in bare clone of repository Joe Drew
2025-08-20 21:33 ` Jeff King
2025-08-21  7:15   ` Patrick Steinhardt
2025-08-21  7:27     ` Jeff King
2025-08-21 10:09       ` Patrick Steinhardt
2025-08-21 16:05         ` Junio C Hamano
2025-08-22  6:13           ` Patrick Steinhardt
2025-08-22  8:01             ` Karthik Nayak
2025-08-22 17:47               ` Junio C Hamano
2025-08-28 13:51                 ` Karthik Nayak
2025-08-28 16:16                   ` Junio C Hamano
2025-09-01 18:17                     ` Karthik Nayak
2025-08-21 15:47       ` Junio C Hamano
2025-08-22 13:28   ` Joe Drew
2025-08-26 11:19   ` Jeff King
2025-09-02 10:55     ` Patrick Steinhardt

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 NNTP newsgroup(s).