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

nix-installer v0.10.0 fails when installing Nix 2.15.0 in Alpine Linux container in Proxmox 8.0.3. #539

Closed
derekmahar opened this issue Jun 28, 2023 · 17 comments
Labels

Comments

@derekmahar
Copy link

derekmahar commented Jun 28, 2023

nix-installer v0.10.0 fails when installing Nix 2.15.0 in Alpine Linux container.

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix/tag/v0.10.0 |
  sh -s -- install linux --init none

Error

Error: 
   0: Install failure
   1: Error executing action
   2: Action `configure_nix` errored
   3: Action `setup_default_profile` errored
   4: Failed to execute command with status 1 `HOME="/root" NIX_SSL_CERT_FILE="/nix/store/ba4f8msp39cfvfpw3m7fsalb4psw347z-nss-cacert-3.83/etc/ssl/certs/ca-bundle.crt" "/nix/store/556bgbl9z8jm7030g1b31d0cblf09036-nix-2.15.0/bin/nix-env" "-i" "/nix/store/556bgbl9z8jm7030g1b31d0cblf09036-nix-2.15.0"`, stdout: 
      stderr: installing 'nix-2.15.0'
      �[31;1merror:�[0m setting uid: �[35;1mInvalid argument�[0m
      error: cannot kill processes for uid '872415232': failed with exit code 1


Metadata

key value
version 0.10.0
os linux
arch x86_64
$ uname -a
Linux alpine-1 6.2.16-3-pve #1 SMP PREEMPT_DYNAMIC PVE 6.2.16-3 (2023-06-17T05:58Z) x86_64 Linux
@derekmahar derekmahar changed the title nix-installer v0.10.0 fails when installing Nix 2.15.0 in Alpine Linux container. nix-installer v0.10.0 fails when installing Nix 2.15.0 in Alpine Linux container in Proxmox 8.0.3. Jun 28, 2023
@Hoverbear Hoverbear added this to the 0.10.1 milestone Jun 28, 2023
@Hoverbear
Copy link
Contributor

Hmm this may be related to auto-allocate-uids. I'll try to reproduce it. It may require some fix upstream.

@bketelsen
Copy link

same error for LXD containers

@derekmahar
Copy link
Author

same error for LXD containers

The Alpine Linux container in which I tried to run nix-installer is an LXD container.

@manan-gup
Copy link

Same for an ArchLinux container using Distrobox with "--init" flag.

@nexhub
Copy link

nexhub commented Aug 9, 2023

I've got the same error on a Proxmox 6.4 host with an Ubuntu 20.04 guest, installer 0.10.0.
Edit: There are similar issues with the official installer (multi user)

@Hoverbear
Copy link
Contributor

Does it work if you pass --extra-conf "sandbox = false" ? I wonder if it's sandboxing...

@Hoverbear Hoverbear reopened this Aug 10, 2023
@Hoverbear Hoverbear removed this from the 0.10.1 milestone Aug 10, 2023
@Hoverbear Hoverbear added the Linux label Sep 8, 2023
@Hoverbear
Copy link
Contributor

Hoverbear commented Sep 22, 2023

This may be possible to detect with heuristics.

Problem machine:

concrete-woodcock% cat /proc/self/uid_map 
         0     165536   10000001

Non-problem machine

❯ cat /proc/self/uid_map
         0          0 4294967295

We may be able to set start-id https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-start-id to something else and also configure id-count https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-id-count, we want id-count to be at least 65536. @edolstra suggests start-id may need to be a multiple of id-count.

So on concrete-woodcock you could set

start-id = 131072
id-count = 65536

And it would start working.

@derekmahar
Copy link
Author

Does #638 resolve this issue?

@derekmahar
Copy link
Author

Does #638 resolve this issue?

nix-installer 0.14.0 successfully installed Nix 2.18.1 in my Alpine Linux container.

@manan-gup
Copy link

The installation works in containers now but if I try anything after that, like using the nix run command with a package, it gives me a "No space left on device" error. Both with and without an init system. Don't know what I'm doing wrong.

@derekmahar
Copy link
Author

The installation works in containers now but if I try anything after that, like using the nix run command with a package, it gives me a "No space left on device" error. Both with and without an init system. Don't know what I'm doing wrong.

That's strange. Are you running Nix inside a container, like Alpine Linux, that doesn't use systemd? In such containers, you must run Nix using sudo nix.

@manan-gup
Copy link

I tried in an Alpine and also an Arch container. I did use sudo when there was no init system but got the same error. The error without sudo is about permissions and not device storage.

@manan-gup
Copy link

I'm getting this error with nix-installer on my host OS as well. I also used the official nix bash installation script
and I'm getting similar storage related errors. There's more than 50 GB free on my system, so, I'm stumped here.

On running nix run nixpkgs#hello I get something like:

error:
       … while fetching the input 'github:NixOS/nixpkgs/nixpkgs-unstable'

       error: creating directory '/nix/store/tmp-3165-0/x/pkgs/tools/misc/sl': No space left on device

I guess I should ask about this at a more appropriate forum but any help is appreciated.

@derekmahar
Copy link
Author

derekmahar commented Oct 27, 2023

Is it possible that your root partition or specifically /nix is mapped to a different device or volume that is full? What does df report?

@manan-gup
Copy link

No, its on my main disk. It might be a problem with setting $TMPDIR but setting it manually isn't fixing the problem. Anyway, thanks for the help.

@Hoverbear
Copy link
Contributor

If you're facing this issue with the official bash scripts as well, could I invite you to open an issue on the Nix repo? :)

@manan-gup
Copy link

Yeah sure. I'll do it tomorrow. Night time here. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants