nix-community / nix-on-droid

Nix-enabled environment for your Android device. [maintainers=@t184256,@Gerschtli]
https://nix-on-droid.unboiled.info
MIT License
1.16k stars 65 forks source link

Fails to get status of /proc/sys/user/max_user_namespace #253

Open konst-aa opened 1 year ago

konst-aa commented 1 year ago

I'm currently using flakes to configure nix-on-droid on pixel 5a. At one point, nix-on-droid switch --flake .#pixel stopped working. Here's the stack trace: Screenshot_20230224-164645

my nix-on-droid.nix

{pkgs, ...}:
{
 environment.packages = with pkgs; [
   openssh
   git
   neovim
   zsh
  ];
  environment.etcBackupExtension = ".bak";
  user.shell = "${pkgs.zsh}/bin/zsh";
  system.stateVersion = "22.11";
}

What other information should I provide?

Gerschtli commented 1 year ago

The full stack trace would be helpful. E.g. pipe stdout and stderr to some pastebin like http://ix.io/.

Also please post your flake.nix/flake.lock.

konst-aa commented 1 year ago

Stout & err: http://ix.io/4p7y flake.nix: http://ix.io/4p7z flake.lock: http://ix.io/4p7A

Gerschtli commented 1 year ago

Unfortunately, I can not reproduce this. Is there any state where this worked for you? Like before nix flake update?

konst-aa commented 1 year ago

It worked on a fresh installation then after a few switches it broke :/ I'll see if I can come up with a way of reproducing it tonight

konst-aa commented 1 year ago

So I've done a fresh install and it seems to work at the moment, I'll close the issue if I don't get that behavior in the next week. Apologies for how vapid this post was.

konst-aa commented 1 year ago

Ok I ran into the issue again. I believe it occurs when I exit out of my zsh shell withexit, and instead of waiting for the Nix session to close I force-exit Nix through the android notification.

Gerschtli commented 1 year ago

When you are closing the app, where do you get the error then?

konst-aa commented 1 year ago

Immediately after reopening, I stop being able to nix-on-droid switch as it raises themax_user_namespace error

Gerschtli commented 1 year ago

It may be an issue with nix itself. Can you do an ls -l on this path, on my device it doesn't exist, maybe it does on yours, and maybe nix tries to read it if it is available.

konst-aa commented 1 year ago

ls: cannot access '/proc/sys/user/max_cgroup_namespaces': Permission denied
ls: cannot access '/proc/sys/user/max_inotify_instances': Permission denied
ls: cannot access '/proc/sys/user/max_inotify_watches': Permission denied
ls: cannot access '/proc/sys/user/max_ipc_namespaces': Permission denied
ls: cannot access '/proc/sys/user/max_mnt_namespaces': Permission denied
ls: cannot access '/proc/sys/user/max_net_namespaces': Permission denied
ls: cannot access '/proc/sys/user/max_pid_namespaces': Permission denied
ls: cannot access '/proc/sys/user/max_user_namespaces': Permission denied
ls: cannot access '/proc/sys/user/max_uts_namespaces': Permission denied
total 0
-????????? ? ? ? ?            ? max_cgroup_namespaces
-????????? ? ? ? ?            ? max_inotify_instances
-????????? ? ? ? ?            ? max_inotify_watches
-????????? ? ? ? ?            ? max_ipc_namespaces
-????????? ? ? ? ?            ? max_mnt_namespaces
-????????? ? ? ? ?            ? max_net_namespaces
-????????? ? ? ? ?            ? max_pid_namespaces
-????????? ? ? ? ?            ? max_user_namespaces
-????????? ? ? ? ?            ? max_uts_namespaces```

yeah it seems so
Gerschtli commented 1 year ago

Then this is something to fix in nix itself, nix-on-droid can not do anything here unfortunately.

KoviRobi commented 1 year ago

This is potentially only tangentially related, but the max_user_namespace reminded me of this https://github.com/NixOS/nix/issues/2632#issuecomment-682453818 so cross-linking in case it's helpful