Skip to content

"error: cannot link '/nix/store/.tmp-link' to '/nix/store/.links/...': File exists" #7273

@grahamc

Description

@grahamc

Describe the bug

Remote building from Nix 2.11.0 on a Mac to an aarch64 Linux machine running 2.8.1, where the remote builder has auto-optimise-store = true, occasionally we're seeing errors on the remote:

error: cannot link '/nix/store/.tmp-link-13949-1705072255' to '/nix/store/.links/09vd...mxd': File exists

this ends up failing the "substitution" and requires retrying. After trying many times, it eventually succeeds.

Expected behavior

  1. Optimising the store should not fail if racing to create the link fails.
  2. A remote build shouldn't fail if optimising fails.

nix-env --version output

[root@nix-builder:~]# nix-env --version
nix-env (Nix) 2.8.1
$ nix-env --version
nix-env (Nix) 2.11.0

Additional context

I don't believe any changes have been made to Nix since 2.8.1 that impacted auto-optimisation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugstoreIssues and pull requests concerning the Nix store

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions