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

Log error message if allowed-users in nix.conf does not allow to read store #106

Open
SuperSandro2000 opened this issue Jul 3, 2023 · 11 comments

Comments

@SuperSandro2000
Copy link
Member

Right now if the allowed-users setting does not allow the harmonia user to connect to the nix-daemon only missed hash is returned.
It would be better for debugging if at least an error would be logged.

@Mic92
Copy link
Member

Mic92 commented Aug 7, 2023

What would be the nix command to check that?

@SuperSandro2000
Copy link
Member Author

To check what? If allowed-users is set? That can be read with nix show-config.

@kristoff3r
Copy link

I'm hitting the exact same issue, except even more severe. The cause seems to be NixOS/nix#9071, and the only workaround I found was to set nix.settings.allowed-users = ["*"].

I suggest adding a service user until that issue is fixed (or a documented workaround is found), adding some logging for file permission errors that are printed by default, and returning a slightly better error.

@Mic92
Copy link
Member

Mic92 commented Dec 2, 2023

Yeah, we should disable dynamic user than.

@Mic92
Copy link
Member

Mic92 commented Dec 3, 2023

This one disables DynamicUser now in nixpkgs: NixOS/nixpkgs#268303

@Mic92
Copy link
Member

Mic92 commented Jan 15, 2024

Consider this solution good enough for now.

@Mic92 Mic92 closed this as completed Jan 15, 2024
@SuperSandro2000
Copy link
Member Author

But we still don't display a proper error message and instead pretend that the store entry doesn't exist which is rather confusing.

@Mic92
Copy link
Member

Mic92 commented Jan 15, 2024

Ok, but when using the nixos module, how does one get into this situation in the first place?

@SuperSandro2000
Copy link
Member Author

Then it's probably not happening but in case anyone runs into that bug again, maybe because of something different off with their nix-daemon, then they are probably as confused as me and take longer than necessary to find the issue.

@Mic92
Copy link
Member

Mic92 commented Jan 15, 2024

I am open to accept a patch that implement this.

@SuperSandro2000
Copy link
Member Author

Can you just re-open the issue? I have no idea how to properly implement this.

@Mic92 Mic92 reopened this Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants