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

Wrong home directory for Prometheus Node Exporter #1256

Open
mweinelt opened this issue Jan 7, 2025 · 3 comments
Open

Wrong home directory for Prometheus Node Exporter #1256

mweinelt opened this issue Jan 7, 2025 · 3 comments

Comments

@mweinelt
Copy link
Contributor

mweinelt commented Jan 7, 2025

I'm getting the following error all the time on rebuilds and have to disable and reenable the exporter.

The homedir we configure for the user is /var/lib/prometheus-node-exporter, but that seems to also be present at /private/var/lib/prometheus-node-exporter, like a symlink or a bindmount.

error: config contains the wrong home directory for _prometheus-node-exporter, aborting activation
nix-darwin does not support changing the home directory of existing users.

Please set:

    users.users._prometheus-node-exporter.home = "/private/var/lib/prometheus-node-exporter";

or remove it from your configuration.
@Enzime
Copy link
Collaborator

Enzime commented Jan 7, 2025

/var is a bind mount to /private/var I believe and some users have their home directory set to both /var/lib/x and /private/var/lib/x

The best fix imo is to update the user to only have one home directory, it should be something like dscl . -create /Users/x /var/lib/x

@emilazy
Copy link
Collaborator

emilazy commented Jan 7, 2025

This is a user created by our own module so it doesn’t seem like that should happen or that manual intervention should be required. (FWIW it’s a symlink, /var@ -> private/var.)

@mweinelt
Copy link
Contributor Author

mweinelt commented Jan 7, 2025

home = "/var/lib/prometheus-node-exporter";

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