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

Why does nix cache signatures in ~root/.cache/nix? #2941

Open
ninegua opened this issue Jun 12, 2019 · 3 comments
Open

Why does nix cache signatures in ~root/.cache/nix? #2941

ninegua opened this issue Jun 12, 2019 · 3 comments
Labels

Comments

@ninegua
Copy link

ninegua commented Jun 12, 2019

I was trying to fix a problem after getting the following warning when using a self-hosted nix-serve cache server:

nix-store --realise /nix/store/nklk455j6mm1dzlisdr0mjmp8bv3zlsg-bar-file --option extra-binary-caches https://foo.cache.server
...
warning: substituter 'https://foo.cache.server' does not have a valid signature for path '/nix/store/nklk455j6mm1dzlisdr0mjmp8bv3zlsg-bar-file'

The problem was server side had a nginx https proxy port misconfiguration that pointed the service to something else other than the nix-serve port. I then fixed this mistake, but I still got the above warning when running the above command.

I tried removing ~/.cache/nix/ according to (edolstra/nix-serve#10 (comment)), but it didn't work.

I then tried removing ~root/.cache/nix/, and it worked.

I'm using NixOS and nix 2.2.2, and I've always been using nix commands from my own user account. So why is nix looking for cache information (e.g. signatures) under the root user's directory?

@stale
Copy link

stale bot commented Feb 18, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 18, 2021
@stale
Copy link

stale bot commented Apr 28, 2022

I closed this issue due to inactivity. → More info

@stale stale bot closed this as completed Apr 28, 2022
@LucianU
Copy link

LucianU commented Aug 16, 2022

@ninegua, even though the issue was closed, I think the answer is: because nix daemon runs as root. So that means it saves stuff under the root account.

@thufschmitt thufschmitt reopened this Feb 24, 2023
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

3 participants