Open eadwu opened 4 years ago
This seems to also be the case with 19.09.
I seem to be also affected by this issue. I am currently in process of bisecting Nixpkgs to see which commit introduced this behavior.
It seems like the bug is caused by Nix update from 2.3 to 2.3.1 (Nixpkgs commit 3ab3614e2be95da22716cdc54b846b38a774efbb by @edolstra). ~I am currently testing master to see if the bug is fixed.~ master also exhibits this issue. I think that temporarily reverting the commit in question can fix this issue.
If only one could bisect Nix versions, applying each version to Nixpkgs. I think cloning Nix separately and running git bisect
with bad as 2.3.1 and 2.3 good and pointing Nix derivation to cloned source would work, but this could be slow. I think I might need a faster PC to do that.
The error probably comes from https://github.com/NixOS/nix/blob/804910fb0eeb6a14ec8d6f98c7fd219da8d04581/src/libstore/local-store.cc#L80. You could try to set USER=root
in the environment when calling nix-store --load-db
.
@edolstra Right now I'm building Nix 2.3 with update commit in Nixpkgs reverted. I will try adding USER=root
next (stashed it for now)
Reverting the commit fixes the issue. Building with USER=root
added to nixos/lib/make-disk-image.nix
in the nix-store --load-db
... doesn't seem to work.
Experiencing this issue as well. Any updates on this?
The issue in nixops was resolved through https://github.com/nix-community/nixops-libvirtd/pull/4. However the issue in runInLinuxVM
probably isn't?
When is the time to mark a package broken? Amazon support is gone, libvirtd does not work. There wasn't even a small bugfix release to fix the libvirtd issue. I wanted to look into nixops and I like the idea, but this seems more broken then unstable at the moment.
Within coming channel bumps of 19.09, 20.03, and unstable, this should be fixed. See #80680.
@samueldr, I'm on nixos-20.03 channel and still have "error: cannot figure out user name" while deploying on libvirtd.
Eek, right,
I noted there that it wasn't the fix for the Nixops-side issue, but didn't re-open that issue. Sorry.
Though, the issue, in Nixops, has been solved. I don't know why there has not been an update to it to use the now fixed plugin. I am not involved with the Nixops project though.
@eadwu I updated the title to better reflect the situation, since runInLinuxVM now doesn't fail under the same situation. Tell me if the title is wrong.
At the time the issue was created, the bug was in runInLinuxVM
[1]. But the new title probably makes more sense, since that was how I found it.
Is there any fix or workaround for this issue?
I cannot use nixops with libvirtd (this issue) and virtualbox (NixOS/nixops#1207).
Is there any update on this issue? I thought nixops would be a fundamental part of nixos?
Is this not fixed already on nixops side?
(not a nixops user) AFAIUI not from a released version.
Almost begs the question if it might be worth considering some kind of funding, similar to what we did for the nix re-write, for NixOps. I feel it's a very fundamental part of NixOS and would benefit from some dedicated work.
Or at least finally mark the package broken, as it is broken (!) for months now. Probably this would lead to a little bit of attention to the issue.
I'm getting this on NixOS 20.09:
prima> /nix/store/62r4jjjqvfl146kp0ham952hldwlbdsf-libvirtd-image.drv
prima> /nix/store/ig6ii01sxdj48xg7s2rhghsjg918j0qf-libvirtd-ssh-image.drv
prima> building '/nix/store/62r4jjjqvfl146kp0ham952hldwlbdsf-libvirtd-image.drv'...
prima> Formatting '/nix/store/ixdkdcqlhmkybw1f990f3j91iwl4ba2r-libvirtd-image/image', fmt=qcow2 cluster_size=65536 compression_type=zlib size=10737418240 lazy_refcounts=off refcount_bits=16
prima> cSeaBIOS (version rel-1.13.0-48-gd9c812dda519-prebuilt.qemu.org)
prima>
prima>
prima> iPXE (http://ipxe.org) 00:03.0 CA00 PCI2.10 PnP PMM+2FF8EFC0+2FEEEFC0 CA00
prima>
prima>
prima>
prima> Booting from ROM...
prima> Probing EDD (edd=off to disable)... ocloading kernel modules...
prima> mounting Nix store...
prima> mounting host's temporary directory...
prima> starting stage 2 (/nix/store/csbmi2wc2pm1y6hwq10x2i4p7apx1v63-vm-run-stage2)
prima> Information: You may need to update /etc/fstab.
prima>
prima> Information: You may need to update /etc/fstab.
prima>
prima> mke2fs 1.45.5 (07-Jan-2020)
prima> Discarding device blocks: done
prima> Creating filesystem with 2621184 4k blocks and 655360 inodes
prima> Filesystem UUID: 1851004c-d2f2-4dca-ba31-4b34d68983bd
prima> Superblock backups stored on blocks:
prima> 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
prima>
prima> Allocating group tables: done
prima> Writing inode tables: done
prima> Creating journal (16384 blocks): done
prima> Writing superblocks and filesystem accounting information: done
prima>
prima> tune2fs 1.45.5 (07-Jan-2020)
prima> Setting maximal mount count to -1
prima> Setting interval between checks to 0 seconds
prima> filling Nix store...
prima> error: cannot figure out user name
prima> [ 34.804621] reboot: Power down
prima> builder for '/nix/store/62r4jjjqvfl146kp0ham952hldwlbdsf-libvirtd-image.drv' failed with exit code 1
prima> cannot build derivation '/nix/store/ig6ii01sxdj48xg7s2rhghsjg918j0qf-libvirtd-ssh-image.drv': 1 dependencies couldn't be built
prima> error: build of '/nix/store/ig6ii01sxdj48xg7s2rhghsjg918j0qf-libvirtd-ssh-image.drv' failed
So, what's the status of this now?
Read my comment from July. NixOPS is probably just an unsupported side project. Why else would this issue be existing since 2019? Don't use NixOPS.
Read my comment from July. NixOPS is probably just an unsupported side project. Why else would this issue be existing since 2019? Don't use NixOPS.
So, what would you use instead?
@devhell NixOps and nixops-libvirtd + nixops seem to still work if you use the overlay from this comment (although I haven't gone much further than the trivial examples).
I marked this as stale due to inactivity. → More info
Describe the bug Specifically through nixops creating
libvirtd-image
, it fails witherror: cannot figure out user name
aroundchroot /mnt ${config.nix.package.out}/bin/nix-store --load-db
[2].whoami
outputswhoami: cannot find name for user ID 0: No such file or directory
.To Reproduce Steps to reproduce the behavior: Any nixops machine deployed through libvirtd.
nixops create -d a ./.
nixops deploy -d a
Expected behavior Create a QEMU image successfully.
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:
https://github.com/nix-community/nixops-libvirtd/issues/5
[2] https://github.com/nix-community/nixops-libvirtd/blob/master/nix/libvirtd-image.nix#L67