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

Deploy to hetzner: "ImportError: No module named selinux" #34

Open
leshy opened this issue Sep 13, 2018 · 9 comments
Open

Deploy to hetzner: "ImportError: No module named selinux" #34

leshy opened this issue Sep 13, 2018 · 9 comments

Comments

@leshy
Copy link

leshy commented Sep 13, 2018

Hi, I'm failing to install on hetzner via nixops,

...
Processing ./nixpart-0.4.0-py2-none-any.whl
Installing collected packages: nixpart
Successfully installed nixpart-0.4.0
/tmp/nix-build-nixpart-0.4.1.drv-0/nixpart-0.4.1
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/qrsn5hrwa4xrq1wynyxblf6bk72mc4fc-nixpart-0.4.1
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/qrsn5hrwa4xrq1wynyxblf6bk72mc4fc-nixpart-0.4.1/lib  /nix/store/qrsn5hrwa4xrq1wynyxblf6bk72mc4fc-nixpart-0.4.1/bin                                                                                   
patching script interpreter paths in /nix/store/qrsn5hrwa4xrq1wynyxblf6bk72mc4fc-nixpart-0.4.1
checking for references to /tmp/nix-build-nixpart-0.4.1.drv-0 in /nix/store/qrsn5hrwa4xrq1wynyxblf6bk72mc4fc-nixpart-0.4.1...
wrapping `/nix/store/qrsn5hrwa4xrq1wynyxblf6bk72mc4fc-nixpart-0.4.1/bin/nixpart'...
building '/nix/store/dzbz3yr0fm24q5n1pvvqxa9af2d36mv6-hetzner-nixops-installer.drv'...
done. (/nix/store/k3nva7faxwsy2kwv43h9qwnkjil6ybrb-hetzner-nixops-installer/bin/hetzner-bootstrap)
hyper5> creating nixbld group in rescue system... done.
hyper5> checking if tmpfs in rescue system is large enough... yes: 32178 MB
hyper5> copying bootstrap files to rescue system... done.
hyper5> partitioning disks...
hyper5> Traceback (most recent call last):
hyper5>   File "/nix/store/qrsn5hrwa4xrq1wynyxblf6bk72mc4fc-nixpart-0.4.1/bin/.nixpart-wrapped", line 10, in <module>
hyper5>     from nixkickstart import NixKickstart
hyper5>   File "/nix/store/qrsn5hrwa4xrq1wynyxblf6bk72mc4fc-nixpart-0.4.1/lib/python2.7/site-packages/nixkickstart.py", line 24, in <module>                                                                                                                  
hyper5>     from blivet.deviceaction import *
hyper5>   File "/nix/store/5ryfsi6lpmjpah4q6dvxf4szgbrp82vv-blivet-0.17-1/lib/python2.7/site-packages/blivet/__init__.py", line 68, in <module>                                                                                                               
hyper5>     from devices import *
hyper5>   File "/nix/store/5ryfsi6lpmjpah4q6dvxf4szgbrp82vv-blivet-0.17-1/lib/python2.7/site-packages/blivet/devices.py", line 103, in <module>                                                                                                               
hyper5>     from devicelibs import mdraid
hyper5>   File "/nix/store/5ryfsi6lpmjpah4q6dvxf4szgbrp82vv-blivet-0.17-1/lib/python2.7/site-packages/blivet/devicelibs/mdraid.py", line 25, in <module>                                                                                                      
hyper5>     from .. import util
hyper5>   File "/nix/store/5ryfsi6lpmjpah4q6dvxf4szgbrp82vv-blivet-0.17-1/lib/python2.7/site-packages/blivet/util.py", line 3, in <module>                                                                                                                    
hyper5>     import selinux
hyper5> ImportError: No module named selinux
error: command ‘['ssh', '-oControlPath=/tmp/nixops-ssh-tmp0ZMDoO/master-socket', '-p', '22', '-o', 'LogLevel=quiet', '-o', 'UserKnownHostsFile=/dev/null', '-o', 'GlobalKnownHostsFile=/dev/null', '-o', 'StrictHostKeyChecking=no', '-p', '22', '-o', 'LogLevel=quiet', '-o', 'UserKnownHostsFile=/dev/null', '-o', 'GlobalKnownHostsFile=/dev/null', '-o', 'StrictHostKeyChecking=no', '-x', '[email protected]', '--', 'export LANG= LC_ALL= LC_TIME=; nixpart -p -']’ failed on machine ‘hyper5’ (exit code 1)        

some info on my machine (it's a fresh nix install on arch)

> nixops --version
NixOps 1.6
> nix-env --version
nix-env (Nix) 2.1.1                                                                                                                                                                                        
> uname -a
Linux 4.18.5-arch1-1-ARCH NixOS/nixops#1 SMP PREEMPT Fri Aug 24 12:48:58 UTC 2018 x86_64 GNU/Linux                                                                                                            

tnx!

@ravloony
Copy link

ravloony commented Sep 21, 2018

I am getting this too. Is there a workaround? I cannot seem to find one.

I have tried setting nixpkgs to the 18.09 and even 18.03 versions, but there is no change. I will try using the nixops from those versions tonight.

@leshy
Copy link
Author

leshy commented Sep 21, 2018

This was an issue only on nixos-unstable for me.
I reverted to 18.09 and made sure the deployed servers used 18.09 by adding

nix.nixPath = [ "nixpkgs=https://nixos.org/channels/nixos-18.09/nixexprs.tar.xz"];

to the server definition files.

not sure if one or the other helped :)

@ravloony
Copy link

I added that line to the server definition file, but I still get the same error.

@ravloony
Copy link

Ok, I still have no idea how to fix this.

I have tried writing a shell.nix that points to the 18.09 channel:

let

fetcher = { owner, repo, rev, sha256 }: builtins.fetchTarball {
  inherit sha256;
  url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
};

nixpkgs = fetcher {
    owner  = "NixOS";
    repo   = "nixpkgs-channels";
    rev    = "d16a7abceb72aac85e0deb8c45fbcb7127baf628";
    sha256 = "0byf6rlwwy70v2sdfmv7mnwd0kvxmlq0pi8ijghg0mcfhcqibgh7";
  };

pkgs = import nixpkgs {};

in pkgs.runCommand "dummy" {
  buildInputs = [ pkgs.nixops pkgs.sqlite pkgs.python27Packages.nixpart0 ];
} ""

But that doesn't work either.

Problem is, I do not understand what is going wrong properly. It appears to have something to do with nixpart.

@paluh
Copy link

paluh commented Jan 18, 2020

This seems to be cause on the current nixpkgs/master:

NixOS/nixpkgs#70980 (comment)

@paluh
Copy link

paluh commented Jan 18, 2020

This should be fixed on the master now thanks to the @jtojnar quick reaction.

I'm not sure if we can close this for now?

@jtojnar
Copy link
Member

jtojnar commented Jan 18, 2020

I would think this was fixed until recently based on NixOS/nixpkgs@c64e17b. Then I broke it in NixOS/nixpkgs@56e5572 and it should be fixed again on NixOS/nixpkgs@07b8ab4. Could someone test if this works now?

@paluh
Copy link

paluh commented Jan 18, 2020

@jtojnar I think that to test this on master we have to also bump nixops version (which has not been released yet) because of this: NixOS/nixops@61abd34

@mkg20001
Copy link
Member

Just deployed with NixOps 1.7pre2764_932bf43

Works fine

@grahamc grahamc transferred this issue from NixOS/nixops Apr 20, 2020
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

5 participants