-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Windows host file not updating when attempting SSH #137
Comments
I migrated this to a new issue, to make it easier to keep track. I'm afraid I've not come across this before, which suggests its something unique to your setup - perhaps you don't have admin access to the HOST location its trying to write too? It hints at a deeper issue using Nevertheless I would debug attempting to connect with just 1 VM, ( Have you installed |
Ping @camraynor |
Isn't it perhaps something to do with file paths - Should be |
Thank you very much for your suggestions. For the interim, I have found a solution in running RStudio in a Linux docker container that I've configured to install To cross the easy one off the list, the formatting on the
Additionally, permissions seem to be OK. I can create the directory and file through R using the
I tried changing the permissions to my user (adapted from this post) but that didn't fix the problem either. I'll take another shot at this later today. I'm wondering if the issue could have something to do with how Windows is interpreting or reading the key itself since the debug output contains |
SSH is a pain. Could you see if you can connect ok using this library https://github.com/ropensci/ssh - if so this will hasten my port over to that to help smooth out these kind of issues. |
I am getting the same error message on windows, when running the |
I've now tried using the All that said, the |
I should have mentioned, the |
The host file issue disappears by removing the |
Ok so the hosts file is written in these lines: googleComputeEngineR/R/ssh_admin.R Lines 3 to 19 in 7427267
Perhaps the temp file on your PC is unreadable - is there a better location on Windows to put it? Perhaps a recent Windows update changed temp file behaviour? |
In case this helps, I tried the code below in an old windows 7 machine and the keys are from Rstudio- it did throw an error, but there was no issue with the hosts file.
|
I'm encountering this on Windows as well.
Results in:
And then a subsequent hang.
But that doesn't mean that an external tool like ssh.exe will work with that syntax. I've tried modifying that file's permissions to provide write access to 'Everyone' with no luck. Clearly the "echo" command is making its way to the VM because I get the resulting "foo" back, so I don't think it's an issue with the keys. @MarkEdmondson1234 it could be that your use of tempdir() which handles file separation with "\\" is conflicting with file.path which uses "/" as the separator on Windows. This mix of formats works in R but I can imagine that ssh.exe might not like it. Update I tried running ssh.exe directly with the UserKnownHostsFile options flag using every permutation of file separators ( \\, \, / ) I could think of but the "Failed to add the host to the list of known hosts" error is returned every time. |
I'm not very familiar with Windows SSH setups, it looks like a setting difference from Windows 7 to modern Windows but I don't know how to begin to fix it. I have to throw this open to a benevolent Windows SSH expert. |
Some troubleshooting links: In all cases you should be able to copy the exact terminal call that googleComputeEngineR is doing by setting |
I was able to get around the issue in Windows by running RStudio in a local Docker container. It's a workaround, but it solves the problem for me. |
Looking into this further, I think we may be focused on the wrong issue. We've been focused on the "Failed to add the host to the list of known hosts" error but the "GetConsoleMode on STD_INPUT_HANDLE failed with 6" error seems more pressing as (I believe) it's describing an issue with accepting input from stdin and thus responsible for hanging the background process. In other words, we can get by without a hosts file, but hanging the process presents more serious issues. As an example, I can't get through gce_vm_cluster() because it hangs when testing the SSH connection for the first VM. Maybe this should split into 2 different issues? |
I've been silently following this thread since a bunch of my students on Windows had trouble setting up a GCE cluster during class. I don't have a solution, but saw someone mention the new (built-in) OpenSSH client that's available on Windows 10. Maybe a way forward? https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse |
Hi all, I've also been struggling with this issue while trying to set up a VM cluster using
gce_vm_cluster
and unfortunately the solutions suggested both here and in #32 have not been working.Here is how my
gce_vm_cluster
is set up:I've gone through all the suggestions both here and in #32, but am getting the following error message:
My session then hangs for several minutes until it times out, although it does creates the VM in my GCP Console.
After doing some investigation with
trace
, the problem seems to isolate togce_ssh_addkeys
>do_system
>system2
It tried running the same arguments through
system2
verbosely:This produced the following readout:
It seems to me that the problem has something to do with writing to the "hosts" file. Do you have any suggestion to resolve this?
Originally posted by @camraynor in #35 (comment)
The text was updated successfully, but these errors were encountered: