Closed berkorbay closed 7 years ago
thx for the issue @berkorbay vacaying right now, will have a look monday
right, the Error in derive_pubkey(key)
error is fixed in the dev version here
Looking at the ssh errors
@trestletech curious if you have thoughts on this. Here's the commit that created the ssh options now used https://github.com/sckott/analogsea/commit/d5f2335c02103f08bd0425e577baef2dad216969 - we use a temporary hosts file
I'm guessing that once a user has ssh'ed successfully once, after that it's all good, but maybe it's that first time that is the pain point.
Is the berk1 key that analogsea is aware of the same key that you ended up using to SSH in? I notice that you specified a key .ssh/id_rsa2
which wasn't found so it fell back to .ssh/id_rsa
.
I'm not familiar with how analogsea identifies the SSH keys on the system or which ones it would attempt to use to connect.
@berkorbay ^^ see above question
thx @trestletech good catch
Thanks for the responses!
Ok, I see your point about id_rsa2 - id_rsa stuff. Even though I made that mistake, "Terminal" fixed it for me. Though, it is not related to the main problem. I will write my train of thought in items so you can tell me what I am doing wrong.
Some missing information I should add. I used the development version and I am using a Macbook Air. R version 3.3.3.
derive_pubkey(key)
) I will reinstall from github and try again. I also encountered some other glitches in my attempt to automate the process that I should report later (not sure if they are reproducible or specific to the session).
I updated R, reinstalled github version of analogsea. This time it worked quite nicely. Btw, thanks for making such an amazing package.
great, glad it works @berkorbay !
Hi, @sckott et. al! I'm running into a flavor of this error and am wondering if there's something I should be doing differently. I get an Error: libssh failure at 'connect': Timeout connecting to
error when I'm trying to use docklet_pull
after I've successfully created a droplet using docklet_create
. If I try to run docklet_pull
again, I get an New server key:...Error: Authentication with ssh server failed
message, which was how I found this GH issue.
And here's my reprex/sessioninfo
:
library(analogsea)
#> Warning: package 'analogsea' was built under R version 3.6.3
#>
#> Attaching package: 'analogsea'
#> The following object is masked from 'package:graphics':
#>
#> image
keys()
#> $`BJR Personal Laptop`
#> <key> BJR Personal Laptop (CENSORED for reprex)
#> Fingerprint: CENSORED for reprex
droplet1 <- docklet_create(region = "nyc1", size = "s-4vcpu-8gb")
#> Using default ssh keys: BJR Personal Laptop
#> NB: This costs $0.05952 / hour until you droplet_delete() it
#> Waiting for create ..................
droplet(droplet1$id) %>%
docklet_pull("benjaminrobinson/gtm-docker")
#> Error: libssh failure at 'connect': Timeout connecting to CENSORED for reprex
Created on 2021-01-03 by the reprex package (v0.3.0)
Thanks for the issue @benjaminrobinson
First thing I notice is that benjaminrobinson/gtm-docker
is invalid somehow. I can't pull it to my local machine or on a DO server. Any ideas?
Hi, @sckott! Thank you so much for the package and the quick reply. This is my first time using Docker and I've been trying to make and use my own image. If I've done so unsuccessfully, please let me know! Here's the link to the repository I have created and published on the Docker Hub. I've noticed that there isn't a "Dockerfile" that shows up but I do have some "tags" listed there. Is there something else I need to do to get it set up so you can pull it potentially? Thanks again!
I don't have bandwidth to help with docker images - let's just use a different docker image from dockerhub - one you know that works - so we're not confounding the issue of the docker image and any issues in this package. - can you share another reprex but with an image we know that works
Hi, @sckott! I used the "rocker/tidyverse" image from dockerhub and got the same error message.
library(analogsea)
#> Warning: package 'analogsea' was built under R version 3.6.3
#>
#> Attaching package: 'analogsea'
#> The following object is masked from 'package:graphics':
#>
#> image
keys()
#> $`BJR Personal Laptop`
#> <key> BJR Personal Laptop (XXXXXXXX)
#> Fingerprint: XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
droplet1 <- docklet_create(region = "nyc1", size = "s-4vcpu-8gb")
#> Using default ssh keys: BJR Personal Laptop
#> NB: This costs $0.05952 / hour until you droplet_delete() it
#> Waiting for create .............................
droplet(droplet1$id) %>%
docklet_pull("rocker/tidyverse")
#> Error: libssh failure at 'connect': Timeout connecting to XX.XXX.X.XXX
Created on 2021-01-08 by the reprex package (v0.3.0)
Thanks. That still works for me.
Can you connect to the server from your command line via ssh successfully?
In R, does a very simple thing work? Try:
droplet_ssh(d, "whoami")
Here's what I got when running the code you just shared:
droplet1<- docklet_create()
droplet1 <- droplet(droplet1$id)
droplet_ssh(droplet1, "whoami")
This yielded the following result:
New server key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Error: Authentication with ssh server failed
Thanks for that.
What i meant by "Can you connect to the server from your command line via ssh successfully?" was can you use your command line/terminal/shell outside of R to connect to the server. That will help us see if your ssh key setup is working correctly. e.g., in your shell
ssh -i .ssh/id_rsa username@your-server-ip-address
Hi, @sckott! Sorry for not replying sooner. I was able to connect to the Droplet in the terminal! It asked me for my password and then I realized that I could apply some of the same logic to the docklet_pull
I was trying to do before!
droplet(droplet1$id) %>% docklet_pull("rocker/tidyverse", ssh_passwd = 'PASSWORD', keyfile = 'LOCATION')
This worked for me! Thanks for being patient with me and helping me understand my problem! I'm guessing you don't have much time to help with my docker image but if you know of any resources that you could point me to that would be great! Thanks again!
Great, glad it worked.
I can't help with images, but perhaps these might help:
Rocker questions on stackoverflow https://stackoverflow.com/search?q=%5Br%5D+rocker
Docker community info https://www.docker.com/docker-community
Hi. I try to automate docklet creation and destroying. Though, I ran into some problems. I created my SSH key with a passphrase. I had DO to recognize it (by copy-pasting public key).
First problem I encountered was on the CRAN version. (Just tried today) I had the following error.
Error in derive_pubkey(key) :RAW() can only be applied to a 'raw', not a 'list'
Then I installed devtools version. Everything is fine. I got the nicest warnings.
When I tried
docklet_pull("rocker/hadleyverse")
command, I got the following error.I tried to run same command again and got the following error.
I checked
keys()
and everything is fine. (Altered the fingerprint in the example, just in case.)Then I tried to reach to the server from the terminal with the following prompt and got these messages. I was also asked my passphrase.
When I returned to R and ran
docklet_pull("rocker/hadleyverse")
it performed without a problem.Yet, it is not an ideal solution. This way I cannot automate DO processes. Is there a way to make it more seamless?