Open arianvp opened 5 years ago
It fails on these lines:
# Keep track of deleted uids and gids.
my $uidMapFile = "/var/lib/nixos/uid-map";
my $uidMap = -e $uidMapFile ? decode_json(read_file($uidMapFile)) : {};
my $gidMapFile = "/var/lib/nixos/gid-map";
my $gidMap = -e $gidMapFile ? decode_json(read_file($gidMapFile)) : {};
Seems to be the same issue as https://github.com/NixOS/nixpkgs/issues/26788 . Where are these files supposed to come from? I would assume /var/lib/nixos/uid-map
doesn't exist when you first start up a Nixos test vm... so why is there nul-bytes inside that file?
Okay I can only reproduce when running the tests interactively like:
$(nix-build ./test.nix -A driver)/bin/nixos-run-vms
It succeeds when running:
nix-build ./test.nix
For some reason the file is created, but is empty:
From the interactive VM:
> print($machine->succeed("wc /var/lib/nixos/uid-map"))
machine: must succeed: wc /var/lib/nixos/uid-map
machine: exit status 0
(0.01 seconds)
0 0 665 /var/lib/nixos/uid-map
``
I guess by:
now look at the logs
you mean the following output:
machine# [ 2.012985] booting system configuration /nix/store/acgd55nw611ds1h0mw2i13issb230ir7-nixos-st
machine# running activation script...
machine# malformed JSON string, neither array, object, number, string or atom, at character offset 0 (be.
machine# Activation script snippet 'users' failed (2)
machine# setting up /etc...
machine# removing obsolete file ‘/etc/’...
machine# error: cannot figure out user name
machine# Activation script snippet 'nix' failed (1)
machine# chown: invalid user: 'root:root'
machine# Activation script snippet 'var' failed (1)
machine# chown: invalid user: 'root.messagebus'
machine# chown: invalid user: 'root.root'
machine# chown: invalid user: 'root.root'
machine# chown: invalid user: 'root.root'
machine# chown: invalid user: 'root.root'
machine# chown: invalid user: 'root.root'
machine# chown: invalid user: 'root.root'
machine# chown: invalid user: 'root.root'
machine# chown: invalid user: 'root.root'
machine# chown: invalid user: 'root.root'
machine# chown: invalid user: 'root.root'
machine# chown: invalid user: 'root.root'
machine# chown: invalid user: 'root.root'
machine# chown: invalid user: 'root.root'
machine# chown: invalid user: 'root.nogroup'
machine# Activation script snippet 'wrappers' failed (1)
machine# error: cannot figure out user name
machine# starting systemd...
Is that right?
Also,
0 0 665 /var/lib/nixos/uid-map
means that the files is 665 bytes in size.
When running print($machine->succeed("wc /var/lib/nixos/uid-map && hexdump -C /var/lib/nixos/uid-map"))
I get:
0 0 665 /var/lib/nixos/uid-map
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000290 00 00 00 00 00 00 00 00 00 |.........|
Hello, I'm a bot and I thank you in the name of the community for opening this issue.
To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.
The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.
If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.
Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.
I'm having the same issue in #208075
Describe the bug It crashes and doesn't create any users. subsequently the system doesn't come up anymore because all kinds of units fail
To Reproduce
now look at the logs Expected behavior System activation should succeed, but it fails partially.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
Metadata Please run
nix run nixpkgs.nix-info -c nix-info -m
and paste the result.Maintainer information: