-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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 updates shell profiles for the wrong user #189043
Comments
It looks like this error message is in Nix itself, so this issue should probably get transferred there by someone with the power. The message was added fairly recently: NixOS/nix#6880 Perhaps @virusdave has a sense of what may be going on here, and whether it implies the PR is or isn't working as intended? |
Interesting - so the issue at high level is that something is executing a core nix function having setuid to I'd be happy to look over |
I'm guessing that this is in https://github.com/NixOS/nix/blob/ddb82ffda993d237d62d59578f7808a9d98c77fe/scripts/install-multi-user.sh#L866-L889 (though I suppose it could be other Nix invocations in the file). @samuela Does this location look right to you? |
Yup, found it in that other repo! Thanks. @samuela , do you happen to have any context logs from around the warning, to help me narrow down which of the script actions is happening when the warning is produced? Thanks! |
Yeah, I imagine that I would still have the logs somewhere. Where are the logs located?
I'm not 100% sure, but here is the context I see when running the installer:
|
Ha, that's exactly where i was suspecting, since it's the only obvious spot where a low-level nix command is being invoked without the Thanks for confirming :) The message should innocuous in this case, as |
A [recent-ish change](NixOS#6676) logs a warning when a potentially counterintuitive situation happens. This now causes the multi-user installer to [emit a warning](NixOS/nixpkgs#189043) when it's doing the "seed the Nix database" step via a low-level `nix-store --load-db` invocation. `nix-store` functionality implementations don't actually use profiles or channels or homedir as far as i can tell. So why are we hitting this code at all? Well, the current command approach for functionality here builds a [fat `nix` binary](https://github.com/NixOS/nix/blob/master/src/nix/local.mk#L23-L26) which has _all_ the functionality of previous individual binaries (nix-env, nix-store, etc) bundled in, then [uses the invocation name](https://github.com/NixOS/nix/blob/master/src/nix/main.cc#L274-L277) to select the set of commands to expose. `nix` itself has this behavior, even when just trying to parse the (sub)command and arguments: ``` dave @ davembp2 $ nix error: no subcommand specified Try 'nix --help' for more information. dave @ davembp2 $ sudo nix warning: $HOME ('/Users/dave') is not owned by you, falling back to the one defined in the 'passwd' file error: no subcommand specified Try 'nix --help' for more information. dave @ davembp2 $ HOME=~root sudo nix error: no subcommand specified Try 'nix --help' for more information. ``` This behavior can also be seen pretty easily with an arbitrary `nix-store` invocation: ``` dave @ davembp2 $ nix-store --realize dave @ davembp2 $ sudo nix-store --realize # what installer is doing now warning: $HOME ('/Users/dave') is not owned by you, falling back to the one defined in the 'passwd' file dave @ davembp2 $ sudo HOME=~root nix-store --realize # what this PR effectively does dave @ davembp2 $ ```
Awesome, thanks @virusdave! It's exciting to see all the progress that's been happening on the installer recently
I'm not seeing anything Nix-related in either my |
That is almost certainly an unrelated issue, if you're seeing a problem. The guard I added in the PR doesn't change the behavior of the installer, it just prevents the warning by passing explicitly an configuration which was being inferred (and warned about) previously. |
A [recent-ish change](NixOS#6676) logs a warning when a potentially counterintuitive situation happens. This now causes the multi-user installer to [emit a warning](NixOS/nixpkgs#189043) when it's doing the "seed the Nix database" step via a low-level `nix-store --load-db` invocation. `nix-store` functionality implementations don't actually use profiles or channels or homedir as far as i can tell. So why are we hitting this code at all? Well, the current command approach for functionality here builds a [fat `nix` binary](https://github.com/NixOS/nix/blob/master/src/nix/local.mk#L23-L26) which has _all_ the functionality of previous individual binaries (nix-env, nix-store, etc) bundled in, then [uses the invocation name](https://github.com/NixOS/nix/blob/master/src/nix/main.cc#L274-L277) to select the set of commands to expose. `nix` itself has this behavior, even when just trying to parse the (sub)command and arguments: ``` dave @ davembp2 $ nix error: no subcommand specified Try 'nix --help' for more information. dave @ davembp2 $ sudo nix warning: $HOME ('/Users/dave') is not owned by you, falling back to the one defined in the 'passwd' file error: no subcommand specified Try 'nix --help' for more information. dave @ davembp2 $ HOME=~root sudo nix error: no subcommand specified Try 'nix --help' for more information. ``` This behavior can also be seen pretty easily with an arbitrary `nix-store` invocation: ``` dave @ davembp2 $ nix-store --realize dave @ davembp2 $ sudo nix-store --realize # what installer is doing now warning: $HOME ('/Users/dave') is not owned by you, falling back to the one defined in the 'passwd' file dave @ davembp2 $ sudo HOME=~root nix-store --realize # what this PR effectively does dave @ davembp2 $ ```
should be fixed by NixOS/nix#6980 |
Describe the bug
When running the multi-user installer, everything proceeds without issue with the exception of the following warning:
This is incorrect, however:
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
The installer to set up shell profiles for the correct user.
Screenshots
n/a
Additional context
n/a
Notify maintainers
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.(can't figure out how to resolve NixOS/nix#3435 yet. may need to do a complete reinstall.)The text was updated successfully, but these errors were encountered: