pachadotdev / analogsea

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

Issue with networking? #113

Closed fmichonneau closed 8 years ago

fmichonneau commented 8 years ago

I'm using the package to spin a shiny app following the instructions here: https://gist.github.com/sckott/ea46be9a1c7cee0eef74

When creating the docklet, it seems that the IP address wasn't assigned to my droplet quite yet, and I ended up with empty lists for the networkings slot. Therefore, I couldn't run d %>% docklet_shinyapp(path) as it resulted in an error message (No network interface registered for this droplet).

I added the IP address manually e.g.: d$networks$v4 <- list(list(ip_address="xxx.xxx.xxx.xxx")) but I guess there must be a better way. Maybe there should be function to update the network interfaces if it doesn't exist already (it's the first time I'm using the package).

sckott commented 8 years ago

Thanks for trying this. Sorry about that. I think for some reason it's recently started returning a response object from the API (suggesting the droplet is up), but it's apparently not quite up yet. This used to not happen. I may need to put in an additional wait time

To refresh the droplet object, e.g, your d, you can just run droplets() and select the one you want. If it says active then it's ready, and of course will have an IP

sckott commented 8 years ago

Hmm, I think this is just a problem when creating droplets with Docker installed, i'll keep diggin

sckott commented 8 years ago

Sorry for the delay, getting back to this

fmichonneau commented 8 years ago

No worries. It's easy to get around it. On Jan 15, 2016 6:08 PM, "Scott Chamberlain" notifications@github.com wrote:

Sorry for the delay, getting back to this

— Reply to this email directly or view it on GitHub https://github.com/sckott/analogsea/issues/113#issuecomment-172122459.

sckott commented 8 years ago

After some digging, I think it results from port 22 not being quite open yet when the first ssh command is executed, looks like nmap is a nice tool to check on the CLI e.g nmap -A <ip address> -p 22 but not sure how portable that is, checking to see if there's a portable R tool

sckott commented 8 years ago

Okay, so we have a new internal fxn from @hrbrmstr for checking whether port 22 is open or not, and if not, we stop with informative error message.

docklet_create() %>% docklet_pull("postgres")
#> NB: This costs $0.01488 / hour until you droplet_delete() it
#> Waiting for create ...........................
#> 
#>  Error: port 22 is not open; wait a bit (try 5 - 10 sec.) and try again

We could build a toggle-able wait period, but users can easily do that themselves via e.g., Sys.sleep(), and I don't think this is always a problem, perhaps especially when you're spinning up a machine and docker

any thoughts @fmichonneau @hrbrmstr

ghost commented 8 years ago

:+1: the idea of putting the onus on the user. If they're using this, they clearly know what they're doing/what they want and make them do some work :-)

sckott commented 8 years ago

cool, will go with the this then

sckott commented 8 years ago

@fmichonneau let me know if this sorts you out, if not we'll re-open

fmichonneau commented 8 years ago

Thanks Scott!

On Tue, Mar 8, 2016 at 7:03 PM, Scott Chamberlain notifications@github.com wrote:

Closed #113 https://github.com/sckott/analogsea/issues/113.

— Reply to this email directly or view it on GitHub https://github.com/sckott/analogsea/issues/113#event-582552132.