Open danbst opened 9 years ago
I'm suffering from this, because I use nixops from a nixops clone directly. Workaround works though.
@aszlig is this tag backends/ec2
right?
@nh2: Hm, doesn't seem so, I'll remove the label.
So am I correctly assuming that $TMPDIR
is /run/user/0
here?
It seems the TMPDIR
workaround is not enough:
While it fixes the error message appearing, it corrupts files in the nix store. Some just end up empty (0 bytes) when really they should not be.
For example, when deploying I get the error:
/nix/store/pbhxc864gqach922mgl4v03d9dff93h4-grub-config.xml:1: parser error : Document is empty
And indeed that file is empty. But the same path is not empty on my Ubuntu machine (where I also run nix-shell -p nixops
, but not as root) and has sensibel contents there.
@cleverca22 told me how I can spot the reason:
On the good (Ubuntu) machine:
nix-store -l /nix/store/pbhxc864gqach922mgl4v03d9dff93h4-grub-config.xml
has no output.
But on the problematic machine:
# nix-store -l /nix/store/pbhxc864gqach922mgl4v03d9dff93h4-grub-config.xml
/nix/store/685n25b9yc8sds57vljk459ldly1xyhn-stdenv/setup: line 500: /run/user/0/nix-build-grub-config.xml.drv-0/env-vars: Permission denied
So that's our error again!
@aszlig This also mentions the /run/user/0
that you were mentioning.
Also, I don't know how to fix your error (I don't run nixops from under nix-shell from under root anymore, I actually rebuild it after changes), I have encountered those errors outside of nixops context:
/tmp/env-vars: Permission denied
when doing nix-shell builds with two different users. In particular, sometimes /tmp/env-vars
is created by user deployer
, and user danbst
can't do any builds in nix-shell anymore (insufficient rights to overwrite /tmp/env-vars
).So now I think, this isn't nixops issue, but a Nix one.
For posterity, see https://github.com/NixOS/nix/issues/568#issuecomment-348312937
I was doing this:
in IRC we concluded that the problem is in temp directory and solution is to
This is quite non-obvious behaviour for those, who want to hack on nixops, and when running
nixops deploy
without dev-shell, everything is ok.