LnL7 / nix-docker

Docker images for the Nix package manager
MIT License
288 stars 41 forks source link

Warning: Identity file "[home]/.nix-docker-build-slave/insecure_rsa" not accessible: No such file or directory. #20

Closed ianmjones closed 5 years ago

ianmjones commented 5 years ago

First off, thank you very much for building this project @LnL7, and for making it so easy to use as a remote builder @3noch with the addition of the start-docker-nix-build-slave script.

On macOS 10.12.6 I was able to do the following...

  1. Clone the repo.
  2. run start-docker-nix-build-slave.
  3. use export NIX_REMOTE_SYSTEMS="$HOME/.nix-docker-build-slave/remote-systems.conf" to set my current shell to use the docker container as a remote builder.
  4. Add the following to my .profile for later use...
if [ -f "$HOME/.nix-docker-build-slave/remote-systems.conf" ]
then
        export NIX_REMOTE_SYSTEMS="$HOME/.nix-docker-build-slave/remote-systems.conf"
fi

Then successfully used nixops create ... and nixops deploy ... on the nixops load-balancer example to create a virtualbox network. (the usual fail on first virtualbox deploy requiring nixops stop / start / deploy was expected)

However, during the deploy every build command was followed up by a warning about the identity file not being available, is that due to something I did wrong, or something that could be improved?

...
copying path '/nix/store/yrq9vb5x5snsvn6wbwxxccmjvqh91qdl-etc-nsswitch.conf' from 'ssh://nix-docker-build-slave'...
building '/nix/store/vpc5v8cmfgkbf00z76c2hiq2hjjwxlj5-etc-os-release.drv' on 'ssh://nix-docker-build-slave'...
Warning: Identity file "/Users/ian/.nix-docker-build-slave/insecure_rsa" not accessible: No such file or directory.
copying 1 paths...
copying path '/nix/store/8lk54da6c59qr68hdsjbfvrd6z6b0srs-etc-os-release' from 'ssh://nix-docker-build-slave'...
building '/nix/store/fimqsm153aiijwms1721b6rx4v7czaxp-etc-resolvconf.conf.drv' on 'ssh://nix-docker-build-slave'...
Warning: Identity file "/Users/ian/.nix-docker-build-slave/insecure_rsa" not accessible: No such file or directory.
copying 1 paths...
copying path '/nix/store/i7xxkc18hg91sls004dmk96kq5xx5zjl-etc-resolvconf.conf' from 'ssh://nix-docker-build-slave'...
building '/nix/store/41ssnvsbkhmxjj9vwmlhhnyjgd080jfa-etc-shells.drv' on 'ssh://nix-docker-build-slave'...
copying 3 paths...
...

I think the file it's complaining about is in the right place etc..

Ians-iMac:.nix-docker-build-slave ian$ pwd
/Users/ian/.nix-docker-build-slave
Ians-iMac:.nix-docker-build-slave ian$ ls -la
total 24
drwxr-xr-x   5 ian  staff   170 11 Oct 09:47 .
drwxr-xr-x+ 78 ian  staff  2652 11 Oct 09:58 ..
-rw-------   1 ian  staff  1675 11 Oct 09:47 insecure_rsa
-rw-r--r--   1 ian  staff   401 11 Oct 09:47 insecure_rsa.pub
-rw-r--r--   1 ian  staff    88 11 Oct 09:47 remote-systems.conf
Ians-iMac:.nix-docker-build-slave ian$ cat remote-systems.conf
nix-docker-build-slave x86_64-linux "/Users/ian/.nix-docker-build-slave/insecure_rsa" 1
Ians-iMac:.nix-docker-build-slave ian$
3noch commented 5 years ago

@ianmjones Oops. I noticed that my script had bitrotted a few months ago but never updated it. With newer setup it needs some changes but I don't remember what they were.

3noch commented 5 years ago

One thing I recall running into was that if using multi-user nix you need the nix daemon to access the docker container. This means you need root to have access to the identity files. When I was toying with this, there was no way to tell nix to use different SSH configuration for remote builders.

ianmjones commented 5 years ago

Thanks @3noch, but I don't think it's related to running multi-user nix as I'm not doing so (any more, I uninstalled nix and re-installed the now non-multi-user by default on Mac version a few days ago).

I did a bunch of experiments and tests and found that it was purely down to the quotes surrounding the identity file name as generated by the start-docker-nix-build-slave script.