Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NixOps libvirtd fails since username can't be detected #71157

Open
eadwu opened this issue Oct 15, 2019 · 25 comments
Open

NixOps libvirtd fails since username can't be detected #71157

eadwu opened this issue Oct 15, 2019 · 25 comments
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@eadwu
Copy link
Member

eadwu commented Oct 15, 2019

Describe the bug
Specifically through nixops creating libvirtd-image, it fails with error: cannot figure out user name around chroot /mnt ${config.nix.package.out}/bin/nix-store --load-db [2]. whoami outputs whoami: 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.

  1. nixops create -d a ./.
  2. 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.

 - system: `"x86_64-linux"`
 - host os: `Linux 5.3.6-hardened, NixOS, 20.03.git.c6d74dc (Markhor)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3pre6895_84de821`
 - channels(root): `"nixos-20.03pre194293.2436c27541b"`
 - nixpkgs: `$HOME/Projects/nixpkgs`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:

nix-community/nixops-libvirtd#5

[2] https://github.com/nix-community/nixops-libvirtd/blob/master/nix/libvirtd-image.nix#L67

@eadwu eadwu added the 0.kind: bug Something is broken label Oct 15, 2019
@devhell
Copy link
Contributor

devhell commented Nov 11, 2019

This seems to also be the case with 19.09.

@vikanezrimaya
Copy link
Member

I seem to be also affected by this issue. I am currently in process of bisecting Nixpkgs to see which commit introduced this behavior.

@vikanezrimaya
Copy link
Member

vikanezrimaya commented Nov 12, 2019

It seems like the bug is caused by Nix update from 2.3 to 2.3.1 (Nixpkgs commit 3ab3614 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.

@edolstra
Copy link
Member

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.

@vikanezrimaya
Copy link
Member

@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)

@vikanezrimaya
Copy link
Member

vikanezrimaya commented Nov 12, 2019

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.

@ncryptid
Copy link
Contributor

Experiencing this issue as well. Any updates on this?

@eadwu
Copy link
Member Author

eadwu commented Jan 16, 2020

The issue in nixops was resolved through nix-community/nixops-libvirtd#4. However the issue in runInLinuxVM probably isn't?

@d4g
Copy link
Contributor

d4g commented Jan 29, 2020

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.

samueldr added a commit to samueldr/nixpkgs that referenced this issue Feb 20, 2020
This includes, but is not limited to:

 * whoami
 * nix >= 2.3.1

See

 * NixOS#71157
 * NixOS/nixops#1216
 * nix-community/nixops-libvirtd#5
samueldr added a commit that referenced this issue Feb 23, 2020
This includes, but is not limited to:

 * whoami
 * nix >= 2.3.1

See

 * #71157
 * NixOS/nixops#1216
 * nix-community/nixops-libvirtd#5

(cherry picked from commit 687e219)
samueldr added a commit that referenced this issue Feb 23, 2020
This includes, but is not limited to:

 * whoami
 * nix >= 2.3.1

See

 * #71157
 * NixOS/nixops#1216
 * nix-community/nixops-libvirtd#5

(cherry picked from commit 687e219)
@samueldr
Copy link
Member

samueldr commented Feb 23, 2020

Within coming channel bumps of 19.09, 20.03, and unstable, this should be fixed. See #80680.

mkaito pushed a commit to serokell/nixpkgs that referenced this issue Mar 2, 2020
This includes, but is not limited to:

 * whoami
 * nix >= 2.3.1

See

 * NixOS#71157
 * NixOS/nixops#1216
 * nix-community/nixops-libvirtd#5
@nick-korsakov
Copy link

nick-korsakov commented Apr 21, 2020

@samueldr, I'm on nixos-20.03 channel and still have "error: cannot figure out user name" while deploying on libvirtd.

@samueldr
Copy link
Member

samueldr commented Apr 24, 2020

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.

@samueldr samueldr reopened this Apr 24, 2020
@samueldr samueldr changed the title runInLinuxVM fails since username can't be detected NixOps libvirtd fails since username can't be detected Apr 24, 2020
@eadwu
Copy link
Member Author

eadwu commented Apr 24, 2020

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.

[1] nix-community/nixops-libvirtd@1c29f6c#diff-379b2f3643afdd2d648411d50c054080L9

@nick-korsakov
Copy link

nick-korsakov commented Jun 6, 2020

Is there any fix or workaround for this issue?

I cannot use nixops with libvirtd (this issue) and virtualbox (NixOS/nixops#1207).

@d4g
Copy link
Contributor

d4g commented Jul 2, 2020

Is there any update on this issue? I thought nixops would be a fundamental part of nixos?

@eadwu
Copy link
Member Author

eadwu commented Jul 2, 2020

Is this not fixed already on nixops side?

@samueldr
Copy link
Member

samueldr commented Jul 2, 2020

(not a nixops user) AFAIUI not from a released version.

@devhell
Copy link
Contributor

devhell commented Jul 3, 2020

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.

@d4g
Copy link
Contributor

d4g commented Jul 3, 2020

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.

@Xe
Copy link
Contributor

Xe commented Nov 21, 2020

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

@devhell
Copy link
Contributor

devhell commented Jan 17, 2021

So, what's the status of this now?

@d4g
Copy link
Contributor

d4g commented Jan 21, 2021

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.

@devhell
Copy link
Contributor

devhell commented Jan 21, 2021

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?

@cdknight
Copy link

cdknight commented Jan 30, 2021

@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).

@stale
Copy link

stale bot commented Jul 30, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

10 participants