NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18k stars 14.02k forks source link

update-users-groups.pl is broken when running NixOS tests interactively #69365

Open arianvp opened 5 years ago

arianvp commented 5 years ago

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

machine# <<< NixOS Stage 2 >>>
machine# 
machine# [    1.410769] EXT4-fs (vda): re-mounted. Opts: (null)
machine# [    1.411606] booting system configuration /nix/store/8mfv9vp28wikw2d8hy42zhqz6wh00di9-nixos-system-machine-20.03.git.c04cece
machine# running activation script...
machine# malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "\x{0}\x{0}\x{0}\x{0}...") at /nix/store/z9a0mg0qg4xhlih0wix950xgq285fbzh-update-users-groups.pl line 11.
machine# Activation script snippet 'users' failed (2)
machine# setting up /etc...
machine# removing obsolete symlink ‘/etc/resolv.conf’...
machine# removing obsolete symlink ‘/etc/systemd/resolved.conf’...
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# warning: the group 'nixbld' specified in 'build-users-group' does not exist
machine# starting systemd...
machine# [    2.633479] systemd[1]: Inserted module 'autofs4'
machine# [    2.659865] NET: Registered protocol family 10
machine# [    2.660390] Segment Routing with IPv6
machine# [    2.673922] systemd[1]: systemd 243 running in system mode. (+PAM +AUDIT -SELINUX +IMA +APPARMOR +SMACK -SYSVINIT +UTMP -LIBCRYPTSETUP +GCRYPT -GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID -ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid)
machine# [    2.675363] systemd[1]: Detected virtualization kvm.
machine# [    2.675740] systemd[1]: Detected architecture x86-64.
machine# [    2.677548] systemd[1]: Set hostname to <machine>.
machine# [    2.726308] systemd-fstab-generator[359]: Checking was requested for "store", but it is not a device.
machine# [    2.727571] systemd-fstab-generator[359]: Checking was requested for "shared", but it is not a device.
machine# [    2.728631] systemd-fstab-generator[359]: Checking was requested for "xchg", but it is not a device.
machine# [    2.967478] systemd[1]: cgroup compatibility translation between legacy and unified hierarchy settings activated. See cgroup-compat debug messages for details.
machine# [    2.968677] systemd[1]: Created slice system-getty.slice.
machine# [    2.969295] systemd[1]: Created slice User and Session Slice.
machine# [    2.969768] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
machine# [    2.970309] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
machine# [    2.970895] systemd[1]: Reached target Containers.
machine# [    3.037447] loop: module loaded
machine# [    3.041543] EXT4-fs (vda): re-mounted. Opts: (null)
machine# [    3.899013] audit: type=1130 audit(1569340650.732:2): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-udevd comm="systemd" exe="/nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
machine# [    3.947007] audit: type=1130 audit(1569340650.779:3): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-journald comm="systemd" exe="/nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
machine# [    3.909729] systemd-modules-load[371]: Failed to find module 'gcov-proc'
machine# [    3.913803] systemd-tmpfiles[374]: [/etc/tmpfiles.d/static-nodes-permissions.conf:12] Unknown group 'audio'.
machine# [    3.920016] systemd-tmpfiles[374]: [/etc/tmpfiles.d/static-nodes-permissions.conf:13] Unknown group 'audio'.
machine# [    3.924959] systemd-tmpfiles[374]: [/etc/tmpfiles.d/static-nodes-permissions.conf:14] Unknown group 'disk'.
machine# [    3.974831] systemd-journald[370]: Received client request to flush runtime journal.
machine# [    4.040953] systemd-journald[370]: File /var/log/journal/83f8ce6a8d164318b0865f06ca2b67d1/system.journal corrupted or uncleanly shut down, renaming and replacing.
machine# [    4.083203] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input3
machine# [    4.083896] ACPI: Power Button [PWRF]
machine# [    4.078630] systemd-tmpfiles[374]: [/etc/tmpfiles.d/static-nodes-permissions.conf:17] Unknown group 'kvm'.
machine# [    4.080852] systemd-tmpfiles[374]: Failed to parse ACL "d:group:adm:r-x,d:group:wheel:r-x": Invalid argument. Ignoring
machine# [    4.130477] audit: type=1130 audit(1569340650.963:4): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-journal-flush comm="systemd" exe="/nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
machine# [    4.091033] systemd-tmpfiles[374]: Failed to parse ACL "group:adm:r-x,group:wheel:r-x": Invalid argument. Ignoring
machine# [    4.096211] systemd-tmpfiles[374]: Failed to parse ACL "group:adm:r--,group:wheel:r--": Invalid argument. Ignoring
machine# [    4.103133] systemd-tmpfiles[374]: Failed to parse ACL "d:group::r-x,d:group:adm:r-x,d:group:wheel:r-x": Invalid argument. Ignoring
machine# [    4.109017] systemd-tmpfiles[374]: Failed to parse ACL "group::r-x,group:adm:r-x,group:wheel:r-x": Invalid argument. Ignoring
machine# [    4.160478] audit: type=1130 audit(1569340650.993:5): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-tmpfiles-setup comm="systemd" exe="/nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
machine# [    4.124139] systemd-tmpfiles[374]: Failed to parse ACL "d:group:adm:r-x,d:group:wheel:r-x": Invalid argument. Ignoring
machine# [    4.127965] systemd-tmpfiles[374]: Failed to parse ACL "group:adm:r-x,group:wheel:r-x": Invalid argument. Ignoring
machine# [    4.179701] audit: type=1127 audit(1569340651.013:6): pid=481 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg=' comm="systemd-update-utmp" exe="/nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/systemd/systemd-update-utmp" hostname=? addr=? terminal=? res=success'
machine# [    4.138845] systemd-tmpfiles[374]: Failed to parse ACL "group:adm:r--,group:wheel:r--": Invalid argument. Ignoring
machine# [    4.187029] audit: type=1130 audit(1569340651.020:7): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-update-utmp comm="systemd" exe="/nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
machine# [    4.145274] systemd-modules-load[371]: Inserted module 'loop'
machine# [    4.148907] systemd-udevd[376]: Network interface NamePolicy= disabled on kernel command line, ignoring.
machine# [    4.153809] systemd-udevd[376]: /nix/store/4532lnj2wd26lgh13swxfaiy1ni4w20i-udev-rules/11-dm-lvm.rules:40 Invalid value for OPTIONS key, ignoring: 'event_timeout=180'
machine# [    4.156155] systemd-udevd[376]: /nix/store/4532lnj2wd26lgh13swxfaiy1ni4w20i-udev-rules/11-dm-lvm.rules:40 The line takes no effect, ignoring.[    4.202789] parport_pc 00:04: reported by Plug and Play ACPI
machine# 
machine# [    4.203659] Floppy drive(s): fd0 is 2.88M AMI BIOS
machine# [    4.159562] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:18 Unknown group 'tty', ignoring
machine# [    4.163034] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:19 Unknown group 'tty', ignoring
machine# [    4.164786] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:20 Unknown group 'tty', ignoring[    4.211882] parport0: PC-style at 0x378, irq 7 [PCSPP(,...)]
machine# 
machine# [    4.167923] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:21 Unknown group 'tty', ignoring[    4.215448] FDC 0 is a S82078B
machine# 
machine# [    4.171777] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:22 Unknown group 'tty', ignoring
machine# [    4.173814] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:23 Unknown group 'tty', ignoring
machine# [    4.175144] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:24 Unknown group 'tty', ignoring
machine# [    4.177356] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:25 Unknown group 'dialout', ignoring
machine# [    4.180533] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:27 Unknown group 'kmem', ignoring
machine# [    4.182761] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:29 Unknown group 'input', ignoring
machine# [    4.184681] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:32 Unknown group 'video', ignoring
machine# [    4.187765] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:33 Unknown group 'video', ignoring
machine# [    4.189751] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:34 Unknown group 'video', ignoring
machine# [    4.192859] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:35 Unknown group 'video', ignoring
machine# [    4.195824] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:36 Unknown group 'video', ignoring
machine# [    4.197939] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:37 Unknown group 'video', ignoring
machine# [    4.199849] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:39 Unknown group 'render', ignoring
machine# [    4.202780] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:40 Unknown group 'render', ignoring
machine# [    4.204734] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:46 Unknown group 'audio', ignoring
machine# [    4.206745] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:50 Unknown group 'video', ignoring
machine# [    4.209617] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:51 Unknown group 'video', ignoring
machine# [    4.211755] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:52 Unknown group 'video', ignoring
machine# [    4.213739] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:53 Unknown group 'video', ignoring
machine# [    4.216819] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:55 Unknown group 'lp', ignoring
machine# [    4.219733] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:56 Unknown group 'lp', ignoring
machine# [    4.220810] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:57 Unknown group 'lp', ignoring
machine# [    4.222731] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:58 Unknown group 'lp', ignoring
machine# [    4.225850] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:59 Unknown group 'lp', ignoring
machine# [    4.274169] Linux agpgart interface v0.103
machine# [    4.228999] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:60 Unknown group 'lp', ignoring
machine# [    4.230845] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:62 Unknown group 'disk', ignoring
machine# [    4.232609] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:63 Unknown group 'cdrom', ignoring
machine# [    4.235281] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:64 Unknown group 'cdrom', ignoring
machine# [    4.237815] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:65 Unknown group 'cdrom', ignoring
machine# [    4.240373] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:66 Unknown group 'cdrom', ignoring
machine# [    4.243859] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:67 Unknown group 'cdrom', ignoring
machine# [    4.246739] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:69 Unknown group 'tape', ignoring
machine# [    4.248678] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:70 Unknown group 'disk', ignoring
machine# [    4.250925] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:71 Unknown group 'disk', ignoring
machine# [    4.253772] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:72 Unknown group 'disk', ignoring
machine# [    4.256008] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:73 Unknown group 'disk', ignoring
machine# [    4.258731] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:74 Unknown group 'disk', ignoring
machine# [    4.260739] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:75 Unknown group 'disk', ignoring
machine# [    4.262674] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:76 Unknown group 'disk', ignoring
machine# [    4.264682] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:85 Unknown group 'kvm', ignoring
machine# [    4.266699] systemd-udevd[376]: /nix/store/gg0ppshg45gksxsq2jbjbhvm3mk70vq9-systemd-243/lib/udev/rules.d/50-udev-default.rules:87 Unknown group 'kvm', ignoring
machine# [    4.268878] systemd[1]: Starting Flush Journal to Persistent Storage...
machine# [    4.270954] systemd[1]: Started Flush Journal to Persistent Storage.
machine# [    4.272895] systemd[1]: Starting Create Volatile Files and Directories...
machine# [    4.275123] systemd-tmpfiles[480]: [/etc/tmpfiles.d/systemd.conf:11] Unknown group 'utmp'.
machine# [    4.277622] systemd-tmpfiles[480]: [/etc/tmpfiles.d/systemd.conf:19] Unknown user 'systemd-network'.
machine# [    4.279831] systemd-tmpfiles[480]: [/etc/tmpfiles.d/systemd.conf:20] Unknown user 'systemd-network'.
machine# [    4.281620] systemd-tmpfiles[480]: [/etc/tmpfiles.d/systemd.conf:21] Unknown user 'systemd-network'.
machine# [    4.283959] systemd-tmpfiles[480]: [/etc/tmpfiles.d/systemd.conf:25] Unknown group 'systemd-journal'.
machine# [    4.286130] systemd-tmpfiles[480]: [/etc/tmpfiles.d/systemd.conf:26] Unknown group 'systemd-journal'.
machine# [    4.288038] systemd-tmpfiles[480]: Failed to parse ACL "d:group:adm:r-x,d:group:wheel:r-x": Invalid argument. Ignoring
machine# [    4.288989] systemd-tmpfiles[480]: Failed to parse ACL "group:adm:r-x,group:wheel:r-x": Invalid argument. Ignoring
machine# [    4.290758] systemd-tmpfiles[480]: Failed to parse ACL "group:adm:r--,group:wheel:r--": Invalid argument. Ignoring
machine# [    4.292545] systemd-tmpfiles[480]: [/etc/tmpfiles.d/systemd.conf:32] Unknown group 'systemd-journal'.
machine# [    4.293589] systemd-tmpfiles[480]: [/etc/tmpfiles.d/systemd.conf:33] Unknown group 'systemd-journal'.
machine# [    4.295567] systemd-tmpfiles[480]: [/etc/tmpfiles.d/systemd.conf:34] Unknown group 'systemd-journal'.
machine# [    4.297591] systemd-tmpfiles[480]: Failed to parse ACL "d:group::r-x,d:group:adm:r-x,d:group:wheel:r-x": Invalid argument. Ignoring
machine# [    4.298616] systemd-tmpfiles[480]: Failed to parse ACL "group::r-x,group:adm:r-x,group:wheel:r-x": Invalid argument. Ignoring
machine# [    4.345170] piix4_smbus 0000:00:01.3: SMBus Host Controller at 0x700, revision 0
machine# [    4.301051] systemd-tmpfiles[480]: Failed to parse ACL "d:group:adm:r-x,d:group:wheel:r-x": Invalid argument. Ignoring
machine# [    4.303792] systemd-tmpfiles[480]: Failed to parse ACL "group:adm:r-x,group:wheel:r-x": Invalid argument. Ignoring
machine# [    4.306960] systemd-tmpfiles[480]: Failed to parse ACL "group:adm:r--,group:wheel:r--": Invalid argument. Ignoring
machine# [    4.309754] systemd-tmpfiles[480]: [/etc/tmpfiles.d/var.conf:15] Unknown group 'utmp'.
machine# [    4.311662] systemd-tmpfiles[480]: [/etc/tmpfiles.d/var.conf:16] Unknown group 'utmp'.
machine# [    4.313451] systemd-tmpfiles[480]: [/etc/tmpfiles.d/var.conf:17] Unknown group 'utmp'.

To Reproduce

import ./make-test.nix ({ pkgs, lib, ... }: {
  machine =  {...}:{};
  testScript = ''
    $machine->waitForUnit("default.target");
  '';
})
nix-build ./nixos/tests/doesnt-work.nix -A driver
./result/bin/nixos-test-driver
startAll

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:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
arianvp commented 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)) : {};
arianvp commented 5 years ago

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?

arianvp commented 5 years ago

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
arianvp commented 5 years ago

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
``
Enteee commented 4 years ago

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                       |.........|
stale[bot] commented 4 years ago

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.

ERAGON007 commented 1 year ago

I'm having the same issue in #208075