Zulip Chat Archive

Stream: lean4

Topic: lake update failing with git error


Bhavik Mehta (Apr 07 2025 at 01:34):

Running lake update in a repo of mine is giving this error:

$ lake update
error: external command 'git' exited with code 1

How can I figure out what's going on here? Git is otherwise working as normal for me

Bhavik Mehta (Apr 07 2025 at 01:38):

Ah, the verbose option. I'm still not sure what the fix is though:

trace: ././.lake/packages/mathlib> git fetch --tags --force origin
trace: stderr:
error: cannot lock ref 'refs/remotes/origin/jt496_brooks': is at 756d8e3dbdf1959dc91b6dc74b8c29756e915825 but expected 9fbf12e16956d0ae7c908fed62da8f0d69c32c33
From https://github.com/leanprover-community/mathlib4
 ! 9fbf12e169..3058685a7a  jt496_brooks -> origin/jt496_brooks  (unable to update local ref)
 + b1b71c3f05...dadb75c188 update-dependencies-bot-use-only -> origin/update-dependencies-bot-use-only  (forced update)

Kim Morrison (Apr 07 2025 at 01:40):

Have you tried nuking the .lake/packages/mathlib directory?

Bhavik Mehta (Apr 07 2025 at 01:41):

That seemed to work - it made git use 300% of my CPU, but it worked! Thanks!

Kim Morrison (Apr 07 2025 at 01:45):

I usually assume "cannot lock ref" means git got into a bad state, that rarely reproducible,.

Edison Xie (Apr 23 2025 at 11:41):

same error happened to me... is there anything wrong with v19.0 -rc3?

Kevin Buzzard (Apr 23 2025 at 12:30):

I had a git error code 128 yesterday with a failing lake update mathlib but the usual faffing around fixed it in the end.

Edison Xie (Apr 23 2025 at 12:48):

mine is fixes using nuke mathlib directory but I doubt that's the normal way to do... (


Last updated: May 02 2025 at 03:31 UTC