You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using home-manager modules from within my configuration.nix. When running nixos-rebuild switch, activating the home-manager environments fails for my two users. When investigating the issue, I found that /nix/var/nix/profiles/per-user/<user>/profile/manifest.json is an empty file for both users. Older profiles are ok.
I cannot use the nix profile command to remove the broken profile, because
nix profile remove 0
error: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
Steps To Reproduce
I don't know how to reproduce this. I have experienced system crashes recently, but given that the profiles are in the Nix store, my assumption is that they are built somewhat atomically and hope that system crashes don't lead to half-built derivations in the store.
nix-env --version output
nix-env (Nix) 2.18.1
Additional context
I have opened an issue in home-manager about this: nix-community/home-manager#5348 - but I guess home-manager simply uses nix profile, so it's probably better located here.
It seems people encountered empty manifest.json before:
Nix doesn't fsync changes to the Nix store by default (see the option sync-before-registering). So in case of a system crash, manifest.json can show up as a zero-byte file. You can check for this kind of corruption by doing nix store verify -v ~/.nix-profile.
Thanks! verify -v ~/.nix-profile actually confirmed a corrupt store path. Nice to learn about the sync-before-registering, I'll try this! As far as I understand it, with that option set to false, the possiblity of this kind of corruption is expected and not a bug, right?
Describe the bug
I'm using home-manager modules from within my
configuration.nix
. When runningnixos-rebuild switch
, activating the home-manager environments fails for my two users. When investigating the issue, I found that/nix/var/nix/profiles/per-user/<user>/profile/manifest.json
is an empty file for both users. Older profiles are ok.I cannot use the
nix profile
command to remove the broken profile, becauseSteps To Reproduce
I don't know how to reproduce this. I have experienced system crashes recently, but given that the profiles are in the Nix store, my assumption is that they are built somewhat atomically and hope that system crashes don't lead to half-built derivations in the store.
nix-env --version
outputnix-env (Nix) 2.18.1
Additional context
I have opened an issue in home-manager about this: nix-community/home-manager#5348 - but I guess home-manager simply uses
nix profile
, so it's probably better located here.It seems people encountered empty manifest.json before:
#4742
NixOS/nixpkgs#18279
https://discourse.nixos.org/t/home-manager-stopped-working-on-my-non-nixos/6023
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: