pachadotdev / analogsea

Digital Ocean R client
https://pacha.dev/analogsea/
Apache License 2.0
155 stars 24 forks source link

Cannot create rstudio docklet on windows #114

Closed studerus closed 6 years ago

studerus commented 8 years ago

I'm working on windows 10 with the latest version of R and analogsea from github. Creating and manipulating droplets works fine, but I cannot create an RStudio or shiny server. Running the following command:

droplets()[[1]] %>%
 docklet_rstudio()

results in the following error message:

Error: ssh failed
ssh -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=C:\Users\[...]\AppData\Local\Temp\RtmpgVJp1H/hosts root@46.101.209.177 "docker pull rocker/rstudio"
In addition: Warning message:
running command 'ssh -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=C:\Users\[...][\AppData\Local\Temp\RtmpgVJp1H/hosts root@46.101.209.177 "docker pull rocker/rstudio"' had status 255 

Is this a bug or am I doing something wrong?

sckott commented 8 years ago

Do you have SSH keys set up already on your machine? And you can ssh into a DO box?

studerus commented 8 years ago

How can I check whether I have SSH keys correctly set up? It appears that I have SSH keys because typing keys() shows two different keys.

It would be very helpful if either the vignette or the help file docklet_rstudio() would explain how to use SSH keys for creating an RStudio server.

sckott commented 8 years ago

How can I check whether I have SSH keys correctly set up?

if you can ssh into your DigitalOcean machine from the command line outside of R, then I think everything should work fine in analogsea in R - can you do that?

It would be very helpful if either the vignette or the help file docklet_rstudio() would explain how to use SSH keys for creating an RStudio server.

Will definitely add more to the docs on using ssh keys

sckott commented 8 years ago

Note there's a slight problem too when creating docklet's where they aren't actually all the way up even when we think they are https://github.com/sckott/analogsea/issues/113 - working on fixing that - solution being just creating the droplet with docklet_create() - then check again with droplets() until is says status active, then you can go ahead and do things with it

to be sure, you did create a docker droplet via docklet_create()?

studerus commented 8 years ago

Sorry, I'm not familiar with using ssh on the command line. Do you have an example command that I could adapt for my needs?

sckott commented 8 years ago

Do you have an example command that I could adapt for my needs?

e.g., ssh -i .ssh/id_rsa2 root@<IP Address>

sckott commented 8 years ago

Note: I don't know much about where windows ssh keys are stored

studerus commented 8 years ago

Using ssh on the command line seems to have worked, because it says "Welcome to Ubuntu 14.04 ..." at the end. However, it also said before "Could not create directory './home/erich/.ssh'". The authenticity of host ... could not be established. It also said "Failed to add the host to the list of known hosts (...)"

studerus commented 8 years ago

I created the ssh key pair with RStudio under Global Options - Git/SVN. It's stored in C:/Users/erich/.ssh/id_rsa by default

studerus commented 8 years ago

Note there's a slight problem too when creating docklet's where they aren't actually all the way up even when we think they are #113 - working on fixing that - solution being just creating the droplet with docklet_create() - then check again with droplets() until is says status active, then you can go ahead and do things with it to be sure, you did create a docker droplet via docklet_create()

I tried that. Unfortunately, It did not help.

sckott commented 8 years ago

Thanks for the info. Do you have your ssh keys stored in options? what does getOption("do_ssh_keys") give you? We look for that R option and use the key you set as your default

studerus commented 8 years ago

No, I didn't have stored it in options, but I tried it out now. Unfortunately, it still didn't work.

sckott commented 8 years ago

Okay, i'll have to test on a windows VM, and get back to you ... :clock1030:

trestletech commented 8 years ago

Pro-top for others who might have Googled their way here: remember that if you're using RStudio Server, you are technically trying to SSH from your server, not from your desktop. So make sure your SSH keys are setup to work when using the remote server, not your desktop.

Wasted a few more minutes on that than I'd like to confess.

sckott commented 8 years ago

Thanks, but isn't the problem here that ssh keys on desktop and server are not configured correctly (which I think doesn't have anything to do with rstudio server)?

trestletech commented 8 years ago

Sorry, my point was that I had the keys working swimmingly on my desktop and usually use RStudio Desktop. So I was puzzled when I could SSH in from the command line but analogsea could never SSH in to the droplet.

Of course, once I get the SSH keys setup on the server and confirmed that I could SSH into the droplet from the server, then the analogsea commands running in RStudio Server started working.