Dealing with `path xyz claims to be content-addressed but isn't`

What is the best way to deal with the following error?

warning: path '/nix/store/<hash>-profile' claims to be content-addressed but isn't
error: cannot add path '/nix/store/<hash>-profile' because it lacks a valid signature

Also, I would like to understand why this error occurs.

I have a feeling that if I fix the source of the warning, the error will also go away.

For more context, this error came up when I ran nix profile install . in one of my flakes.

My understanding of this problem has evolved into this GitHub issue `nix profile install <flake>` fails on macOS with multi-user installation · Issue #5296 · NixOS/nix · GitHub

I’m hoping to get some eyes on it.

In case anyone stumbles into the same problem, check the resolution on the Github issue.

I stumbled into the same problem but this time in nix 2.15.1 (stable) and nix 2.16.1 (unstable)

$ nix-channel --list
nixos https://nixos.org/channels/nixos-unstable
nixpkgs https://nixos.org/channels/nixpkgs-unstable

Note: using either nixos or nixpkgs channel didn’t work

$ nix profile history
Version 43 (2023-06-10):
  nix: ∅ -> 2.15.1
  nss-cacert: ∅ -> 3.89.1

Version 44 (2023-06-10) <- 43:
  nix: 2.15.1 -> 2.16.1
$ nix registry list
global flake:agda github:agda/agda
global flake:arion github:hercules-ci/arion
global flake:blender-bin github:edolstra/nix-warez?dir=blender
global flake:composable github:ComposableFi/composable
global flake:dreampkgs github:nix-community/dreampkgs
global flake:dwarffs github:edolstra/dwarffs
global flake:emacs-overlay github:nix-community/emacs-overlay
global flake:fenix github:nix-community/fenix
global flake:flake-parts github:hercules-ci/flake-parts
global flake:flake-utils github:numtide/flake-utils
global flake:gemini github:nix-community/flake-gemini
global flake:hercules-ci-effects github:hercules-ci/hercules-ci-effects
global flake:hercules-ci-agent github:hercules-ci/hercules-ci-agent
global flake:home-manager github:nix-community/home-manager
global flake:hydra github:NixOS/hydra
global flake:mach-nix github:DavHau/mach-nix
global flake:nimble github:nix-community/flake-nimble
global flake:nix github:NixOS/nix
global flake:nix-darwin github:LnL7/nix-darwin
global flake:nixops github:NixOS/nixops
global flake:nixos-hardware github:NixOS/nixos-hardware
global flake:nixos-homepage github:NixOS/nixos-homepage
global flake:nixos-search github:NixOS/nixos-search
global flake:nur github:nix-community/NUR
global flake:nixpkgs github:NixOS/nixpkgs/nixpkgs-unstable
global flake:templates github:NixOS/templates
global flake:patchelf github:NixOS/patchelf
global flake:poetry2nix github:nix-community/poetry2nix
global flake:nix-serve github:edolstra/nix-serve
global flake:nickel github:tweag/nickel
global flake:bundlers github:NixOS/bundlers
global flake:pridefetch github:SpyHoodle/pridefetch
global flake:systems github:nix-systems/default
global flake:helix github:helix-editor/helix
global flake:sops-nix github:Mic92/sops-nix
$ nix profile install nixpkgs#hello
warning: path '/nix/store/38xij8xqb7y422xmmcrir1bch5cbdh1q-profile' claims to be content-addressed but isn't
error: cannot add path '/nix/store/38xij8xqb7y422xmmcrir1bch5cbdh1q-profile' because it lacks a valid signature
$ nix profile remove nixpkgs#hello
warning: 'nixpkgs#hello' does not match any packages
warning: Use 'nix profile list' to see the current profile.
warning: path '/nix/store/9cfp7g2whp52b7n9pwq67cl44lk6rzl0-profile' claims to be content-addressed but isn't
error: cannot add path '/nix/store/9cfp7g2whp52b7n9pwq67cl44lk6rzl0-profile' because it lacks a valid signature

nevermind, I got it work after fully uninstall everything (very tedious process) then install it using

sh (https://nixos.org/nix/install | psub) --daemon

Or use the Determinate system installer: GitHub - DeterminateSystems/nix-installer: The Determinate Nix Installer.

TBH, I found it much more convenient and stable than the official installer.

1 Like