Closed BillPetti closed 4 years ago
Please provide a way for us to reproduce what you did so that we can investigate. Thank you.
Either a piece of code or log messages.
Here's how I created the droplet:
library(plumberDeploy)
library(analogsea)
plumberDeploy::do_provision(unstable = TRUE,
example = FALSE)
drops <- droplets()
drops[[1]]
drop_name <- drops[[1]]$name
drop_ip <- drops[[1]]$networks$v4[[1]]$ip_address
Then I deploy the api:
plumberDeploy::do_deploy_api(droplet = drop_name,
path = "geometry",
localPath = "./api/",
8000)
Then I waited about 12 hours and tried to redeploy an updated version of the api after I cleaned out the following directory (rm /var/plumber/geometry/api/*
) using the same code above and received the error I previously noted. This happened a few times over the past few days.
This is the plumber file:
#' Check which EDU territory encompasses an address
#' @param x longitude of the location
#' @param y latitude of the location
#' @get /intersects
#' @serializer html
function(x,
y) {
st_read_edu <- sf::st_read('https://services3.arcgis.com/bWPjFyq029ChCGur/arcgis/rest/services/California_Electric_Utility_Service_Areas/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=pgeojson&token=')
edus <- st_read_edu %>%
as.data.frame()
points <- data.frame(x = as.numeric(x),
y = as.numeric(y))
points_sf <- sf::st_as_sf(points, coords = c('x', 'y'), crs = 4326)
intersection <- sf::st_intersects(st_read_edu, points_sf, sparse = FALSE) %>%
as.data.frame() %>%
dplyr::mutate(edu = st_read_edu$Utility) %>%
dplyr::rename(within_edu_territory = V1) %>%
dplyr::filter(within_edu_territory == TRUE)
return(intersection)
}
I just tried it again and for some reason it worked. Is that an unseen error? Maybe it's a hiccup on my network and it needs time to correct itself?
Have you restarted you R session in between or are you behind a vpn? To me it seems like a connection timeout
I'm not behind a vpn. So far today it wouldn't work, then it randomly did, and now it is giving me the same error message. I have not restarted my R session at all today. I can ssh with no issues in Terminal.
I have no problem grabbing droplet information with analogsea::droplets()
, however, and that should be leveraging the ssh connection as well.
I'll try to replicate it, setting a wait time of 12 hours between deploy.
Little more information if it's helpful. Tried again this morning to run this:
plumberDeploy::do_deploy_api(droplet = drop_name,
path = "geometry",
localPath = "./api/",
8000)
And I get the following error message:
Error in ssh::ssh_info(session = session) :
ssh session has been disconnected
When I manually run session <- ssh::ssh(host = 'root@167.99.101.148')
I establish a connection, but it doesn't seem to get picked up by the do_deploy_api
function and I don't see a way to pass that session to the function explicitly.
Ok, I was able to reproduce. It seems digitalocean close the ssh session but this is not reflected during the check made while the package analogsea calls do_ssh
. This seems like it should be reported there.
You can run that to remove active sessions.
rm(list = ls(envir = analogsea:::analogsea_sessions), envir = analogsea:::analogsea_sessions)
Got it, I will report it over there. Really appreciate your help and the package.
I have deployed a working droplet and plumber api with the package, but after a day when I try to redeploy the plumber api I receive the following message:
Error: libssh failure at 'ssh_channel_open_session': Socket error: Connection reset by peer
Is there a function call to re-establish an ssh session I am missing? My ssh keys are established and were used to spin up the droplet originally.