You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to connect to a web server (in this case, the status page for Presto database) that is accessible via SSH and am having trouble creating a tunnel. Creating the tunnel by calling ssh directly works (note that host and port are in a hidden chunk of the reprex):
pid<-sys::exec_background(
"ssh",
args= c(host, "-L", glue::glue("{port}:localhost:{port}"), "-N")
)
Sys.sleep(2) # allow tunnel to be createdres<-httr::GET(glue::glue("http://localhost:{port}/ui/"))
httr::status_code(res)
#> [1] 200tools::pskill(pid)
The error from GET() is more descriptive when run interactively:
Error: libssh failure at 'channel_open_forward': Channel opening failure: channel 43 error (2) Connection refused
Execution halted
Warning message:
Disconnecting from unused ssh session. Please use ssh_disconnect()
Error in curl::curl_fetch_memory(url, handle = handle) :
Recv failure: Connection reset by peer
I would have expected the ssh_tunnel() approach to be equivalent to directly calling ssh. Curiously, I can use the ssh_tunnel() approach to connect to a different host and service (RStudio Server) and get the message
I am trying to connect to a web server (in this case, the status page for Presto database) that is accessible via SSH and am having trouble creating a tunnel. Creating the tunnel by calling
ssh
directly works (note thathost
andport
are in a hidden chunk of the reprex):Created on 2020-05-26 by the reprex package (v0.3.0)
But creating the tunnel with
ssh_tunnel()
does not work.Created on 2020-05-26 by the reprex package (v0.3.0)
The error from
GET()
is more descriptive when run interactively:I would have expected the
ssh_tunnel()
approach to be equivalent to directly callingssh
. Curiously, I can use thessh_tunnel()
approach to connect to a different host and service (RStudio Server) and get the messageOne possibility is that
ssh_tunnel()
eventually creates the tunnel using the string"localhost"
, which may be handled oddly by Presto? It seems that MySQL, for example, treatslocalhost
differently from127.0.0.1
.The text was updated successfully, but these errors were encountered: