Nix: Confusing error if host key of remote builder has not been accepted by root

Created on 1 Apr 2018  路  1Comment  路  Source: NixOS/nix

On setting up a remote builder, I was presented with the following error:

nix build -f foo.nix
unable to open SSH connection to 'ssh://[email protected]': cannot connect to '[email protected]'; trying other available machines...

This was confusing, because I could connect to that machine using the configured SSH key. But the problem was that I had been testing the connection from my own user account, not the root account, so /root/.ssh/known_hosts did not exist. After creating it, the remote build could proceed.

This all makes sense now, but it would be nice if the error message was more helpful. Something along the lines of The authenticity of host '172.31.15.194 (172.31.15.194)' can't be established., which is what you get if you try to SSH interactively.

Most helpful comment

Fixed in 1aca195e52d4fbf76908e6588b55ed8b5b25cfc8. You now get:

cannot build on 'ssh://...': cannot connect to '...': Host key verification failed.

>All comments

Fixed in 1aca195e52d4fbf76908e6588b55ed8b5b25cfc8. You now get:

cannot build on 'ssh://...': cannot connect to '...': Host key verification failed.
Was this page helpful?
0 / 5 - 0 ratings