Windows 10 [not wsl] "Error: No such host is known" for host alias
Hi, I'm trying to use distant on Windows 10 (not in WSL) and after some failures to run distant.nvim from nvim, I have tried to run the cli directly. It seems that distant is not resolving (properly?) the aliases of the remotes as defined in .ssh/config. distant launch {remote_alias} is not complaining - the debug info is the same for both cases: aliased connection and ip address. However, when running an action on alias I'm getting the following error:
$ distant action ls --log-level debug .
ERROR [distant] Exiting due to error: No such host is known. (os error 11001)
The same command works with the ip host used for launch.
@mr-majkel you're saying that when you provide an IP as the host, it works, but when you provide something like example.com, it does not work? Can you share your config?
I don't have a windows machine to perform manually testing, so it may still have some problems. Can you also verify that distant was started on the remote machine after running distant launch? And can you check what the contents of the session file are? You can launch and specify the location of the session file via distant launch --session file --session-file session.txt <host>.
Hi @chipsenkbeil, thanks for the response. When I was referring to connection alias I meant host details that you can specify in $HOME/.ssh/config file see here for an example.
Basically the .ssh/config file looks sth like this:
# $HOME/.ssh/config
Host my_alias
HostName 10.12.34.123
User itsme
which when ssh'ing to the server allows you to write:
ssh my_alias
instead of
ssh [email protected]
As for your second question, an aliased host the session file looks like this:
# distant.session
DISTANT CONNECT my_alias 8088 cfe99b792bcbe3addfc453b4c3227d454f8eed08d540c6e6f59ea99e2ff7e04f
And here are the contents for running the launch command for the ip version.
# distant session
DISTANT CONNECT 10.12.34.123 8089 a7ba003d8d04288a10c26e6228a8c42dc302335a88d7a6dd0071f0b9eac0321e
So basically, the thing is that my_alias is not resolved through the .ssh/config file to start the connection.
I hope it is clearer now.
I think you're impacted by the same bugs described in https://github.com/chipsenkbeil/distant.nvim/issues/58
@chipsenkbeil agreed:).
https://github.com/chipsenkbeil/distant/commit/669d4196720557e031d61793aebe29eeae254925 may be the fix for this.
Hi @chipsenkbeil, I have tried installing distant with the freshly downloaded rust, but both installation and building from source are failing on 'memchr v2.4.1' compilation.
I have tried to debug it, but I know zero rust. I did not find any helpful issues on memchr github repo, either.
$ cargo --version
cargo 1.56.0 (4ed5d137b 2021-10-04)
Here is the final error from running cargo build --release:
error: failed to run custom build command for `memchr v2.4.1`
Caused by:
could not execute process `C:\Users\mr_majkel\Documents\projects\2021\distant\target\release\build\memchr-34b704a4017ecdea\build-script-build` (never executed)
Caused by:
Access is denied. (os error 5)
warning: build failed, waiting for other jobs to finish...
error: build failed
I have tried to run the command also in powershell running with admin rights, and I get the same error. I have filed the issue on memchr repo
Hi @chipsenkbeil
669d419 may be the fix for this.
I have tried with distant 0.15.1 cli on Windows machine (client, the linux host - my_alias - has 0.15.0). The launch "seems" successful as before, but the action fails with the same error as above.
$ distant launch --log-level debug my_alias
DEBUG [distant::subcommand::launch] Outputting session to "C:\\Users\\mr_majkel\\AppData\\Local\\Temp\\1\\distant.session"
$ cat C:\\Users\\mr_majkel\\AppData\\Local\\Temp\\1\\distant.session
DISTANT CONNECT my_alias 8093 03afd09c53bd51ae82f9ef1db9221ad0332b26300b5c77d7c8b24f7ef5783013
$ distant action ls .
ERROR [distant] Exiting due to error: No such host is known. (os error 11001)
@mr-majkel I'm planning to close this issue soon due to lack of activity. The binary has changed a lot since this issue was opened, so happy for this to be reopened if we want to revisit; otherwise, I'm assuming that you either got this working or moved on to another project! I just like to give plenty of heads up before closing out issues.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.