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

Nixops deploy might fail if nix.nixPath fails to evaluate #405

Closed
domenkozar opened this issue Feb 29, 2016 · 4 comments
Closed

Nixops deploy might fail if nix.nixPath fails to evaluate #405

domenkozar opened this issue Feb 29, 2016 · 4 comments

Comments

@domenkozar
Copy link
Member

Error:

lugano-3> error: unable to download ‘http://nixos.org/releases/nixos/unstable-small/nixos-16.03pre77014.1c8a21d/nixexprs.tar.xz’: HTTP response code said error (22)
lugano-3> error: command ‘['ssh', '-oControlPath=/tmp/nixops-ssh-tmprvJpdV/master-socket', '-p', '22', '-o', 'StrictHostKeyChecking=no', '-i', '/tmp/nixops-tmpimoda7/id_nixops-lugano-3', '-p', '22', '-o', 'StrictHostKeyChecking=no', '-i', '/tmp/nixops-tmpimoda7/id_nixops-lugano-3', '-x', 'root@xxx', '--', 'NIX_REMOTE=daemon nix-env -p /nix/var/nix/profiles/system --set "/nix/store/1dfmjm2j6zpsm13l5ff815gqd3d9f0kj-nixos-system-lugano-3-16.03pre77568.40c586b"']’ failed on machine ‘lugano-3’ (exit code 1)

Workaround is to change line 645 in /nix/store/xka88770xkrb4xrfykc336jc2yc9sm81-nixops-1.3.1/lib/python2.7/site-packages/nixops/deployment.py to:

     daemon_var = '' if m.state == m.RESCUE else 'NIX_PATH=nixpkgs=http://nixos.org/channels/nixos-unstable/nixexprs.tar.xz NIX_REMOTE=daemon '
@rbvermaa
Copy link
Member

What does 'NIX_PATH fails to evaluate' mean exactly?

@domenkozar
Copy link
Member Author

It's probably better to say nix.nixPath

@domenkozar domenkozar changed the title Nixops deploy might fail if NIX_PATH fails to evaluate Nixops deploy might fail if nix.nixPath fails to evaluate Feb 29, 2016
@domenkozar
Copy link
Member Author

I'm using the following patch to circumvent this:

diff --git a/nixops/deployment.py b/nixops/deployment.py
index a76184b..0a36934 100644
--- a/nixops/deployment.py
+++ b/nixops/deployment.py
@@ -665,7 +665,7 @@ class Deployment(object):

             try:
                 # Set the system profile to the new configuration.
-                daemon_var = '' if m.state == m.RESCUE else 'NIX_REMOTE=daemon '
+                daemon_var = '' if m.state == m.RESCUE else 'NIX_REMOTE=daemon NIX_PATH= '
                 setprof = daemon_var + 'nix-env -p /nix/var/nix/profiles/system --set "{0}"'
                 if always_activate or self.definitions[m.name].always_activate:
                     m.run_command(setprof.format(m.new_toplevel))

@domenkozar
Copy link
Member Author

This will be fixed in new Nix release.

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

2 participants