nix::ForeignException: filesystem error: in rename: Directory not empty #995

Open
opened 2025-09-17 13:38:26 +00:00 by arianvp · 2 comments
Member

Describe the bug

error: Unexpected exception on the Lix daemon; this is a bug in Lix.
       We would appreciate a report of the circumstances it happened in at https://git.lix.systems/lix-project/lix.
       nix::ForeignException: filesystem error: in rename: Directory not empty ["/nix/store/3dsvdg9y2m0bpip7l33jyqa5azajzy3m-mcp-language-server-0.1.1-go-modules"] ["/nix/store/3dsvdg9y2m0bpip7l33jyqa5azajzy3m-mcp-language-server-0.1.1-go-modules.tmp"]

Steps To Reproduce

Build the following derivation:

{ fetchFromGitHub, buildGoModule }:
buildGoModule (finalAttrs: {
  pname = "mcp-language-server";
  version = "0.1.1";
  src = fetchFromGitHub {
    owner = "isaacphi";
    repo = "mcp-language-server";
    rev = "v${finalAttrs.version}";
    hash = "sha256-T0wuPSShJqVW+CcQHQuZnh3JOwqUxAKv1OCHwZMr7KM=";
  };
  vendorHash = "";
})


Expected behavior

Lix doesn't crash

nix --version output

nix (Lix, like Nix) 2.93.2
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/arian/.config/nix/nix.conf:/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/ggppip3wfx4vbdc0kxsdniw118viymdg-lix-2.93.2/share

Additional context

Add any other context about the problem here.

## Describe the bug ``` error: Unexpected exception on the Lix daemon; this is a bug in Lix. We would appreciate a report of the circumstances it happened in at https://git.lix.systems/lix-project/lix. nix::ForeignException: filesystem error: in rename: Directory not empty ["/nix/store/3dsvdg9y2m0bpip7l33jyqa5azajzy3m-mcp-language-server-0.1.1-go-modules"] ["/nix/store/3dsvdg9y2m0bpip7l33jyqa5azajzy3m-mcp-language-server-0.1.1-go-modules.tmp"] ``` ## Steps To Reproduce Build the following derivation: ``` { fetchFromGitHub, buildGoModule }: buildGoModule (finalAttrs: { pname = "mcp-language-server"; version = "0.1.1"; src = fetchFromGitHub { owner = "isaacphi"; repo = "mcp-language-server"; rev = "v${finalAttrs.version}"; hash = "sha256-T0wuPSShJqVW+CcQHQuZnh3JOwqUxAKv1OCHwZMr7KM="; }; vendorHash = ""; }) ``` ## Expected behavior Lix doesn't crash ## `nix --version` output ``` nix (Lix, like Nix) 2.93.2 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/arian/.config/nix/nix.conf:/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/ggppip3wfx4vbdc0kxsdniw118viymdg-lix-2.93.2/share ``` ## Additional context Add any other context about the problem here.
Owner

Cannot reproduce. This might be a store corruption? Can you run nix store verify --all? (might require sudo)

Cannot reproduce. This might be a store corruption? Can you run `nix store verify --all`? (might require sudo)
Owner

this smells like a build of non-present outputs of a derivation with some outputs present being aborted without a gc being run. there are two places in the code that use .tmp as temporary path suffixes hard, without any existence checks or unique path generation. both of them are important for macos-not-having-a-useful-sandbox-caused path rewriting.

this smells like a build of non-present outputs of a derivation with some outputs present being aborted without a gc being run. there are two places in the code that use `.tmp` as temporary path suffixes *hard*, without any existence checks or unique path generation. both of them are important for macos-not-having-a-useful-sandbox-caused path rewriting.
Sign in to join this conversation.
No milestone
No project
No assignees
3 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#995
No description provided.