Hangs at waiting for lock on '/nix/store/...' #797

Open
opened 2025-04-11 18:15:44 +00:00 by rbt · 3 comments
Owner

Describe the bug

Sometimes, Lix leaves locks when a build is cancelled (?), leading to deadlocks:

$ nix develop --log-format multiline-with-logs
[0/87 built]
waiting for lock on '/nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-temporal-sdk-0.0.1.0', '/nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-temporal-sdk-0.0.1.0-doc', '/nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-temporal-sdk-0.0.1.0-hie'

(Hashes redacted.)

Workaround: On macOS, at least, runsudo rm /nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-temporal-sdk-0.0.1.0.lock.

Warning: One time I got frustrated enough that I did sudo rm /nix/store/*.lock. Do NOT do this, because you will remove Cargo.lock derivations and destroy your Nix store. I had to reinstall Nix entirely when I did that!

Steps To Reproduce

I don't have a reliable reproducer. I suspect that canceling evaluation with Ctrl-C causes this. I'm not sure if it's present on HEAD.

nix --version output

nix (Lix, like Nix) 2.92.0
System type: aarch64-darwin
Additional system types: x86_64-darwin
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /Users/wiggles/.config/nix/nix.conf:/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/y9mgqlvgyh0ixd0vgyn1y4kjgsn2gw36-lix-2.92.0/share
## Describe the bug Sometimes, Lix leaves locks when a build is cancelled (?), leading to deadlocks: ``` $ nix develop --log-format multiline-with-logs [0/87 built] waiting for lock on '/nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-temporal-sdk-0.0.1.0', '/nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-temporal-sdk-0.0.1.0-doc', '/nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-temporal-sdk-0.0.1.0-hie' ``` (Hashes redacted.) Workaround: On macOS, at least, run`sudo rm /nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-temporal-sdk-0.0.1.0.lock`. **Warning:** One time I got frustrated enough that I did `sudo rm /nix/store/*.lock`. Do NOT do this, because you will remove `Cargo.lock` derivations and destroy your Nix store. I had to reinstall Nix entirely when I did that! ## Steps To Reproduce I don't have a reliable reproducer. I suspect that canceling evaluation with `Ctrl-C` causes this. I'm not sure if it's present on HEAD. ## `nix --version` output ``` nix (Lix, like Nix) 2.92.0 System type: aarch64-darwin Additional system types: x86_64-darwin Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /Users/wiggles/.config/nix/nix.conf:/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/y9mgqlvgyh0ixd0vgyn1y4kjgsn2gw36-lix-2.92.0/share ```
Owner

that's quite possibly the known 2.92 deadlock we've fixed in main a while ago. in these cases you'll have processes that hold onto these locks left over, can you check for that next time it happens?

that's quite possibly the known 2.92 deadlock we've fixed in main a while ago. in these cases you'll have processes that hold onto these locks left over, can you check for that next time it happens?
Owner

It's also quite possibly the build cancellation bug in 2.93 on macOS that I need to hunt down.

It's also quite possibly the build cancellation bug in 2.93 on macOS that I need to hunt down.

any updates on this?

any updates on this?
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#797
No description provided.