I'm having issues using the SFTP functionality of this package. Here is the issue I'm running into.
If I enter my credential information as such:
sftp_con <- sftp_connect(server = "sftp.name.com",
username = "username",
password = "password",
protocol = "sftp://",
port = 2222)
sftp_download("*")
I get the following error message:
Error in function (type, msg, asError = TRUE) :
Protocol "sftp" not supported or disabled in libcurl
Is there a way around this? If it helps, I'm on a Mac Book running this.
Related
I currently try to read a file from a remote machine via RCurl::scp() on linux.
I have added my public (~/.ssh/id_rsa.pub in open-ssh format) and private (~/.ssh/id_rsa) keys and am able to ssh and scp to the remote machine from the terminal.
Unfortunatley I cannot yet transfer or read a file from within R.
RCurl::scp(
user = "root", host = "hostname",
path = "/path/file",
)
#> Error in function (type, msg, asError = TRUE) :
#> Failure establishing ssh session: -5, Unable to exchange encryption keys
My question may be related to Using SCP function from Rcurl in R
I am trying to connect to shinyapps via Rstudio using the setAccountInfo function in the rsconnect package:
rsconnect::setAccountInfo(name='MYACCOUNTNAME',
token='TOKEN',
secret='<SECRET>')
But I am getting the following error:
Error in function (type, msg, asError = TRUE) :
Failed to connect to api.shinyapps.io port 443: Timed out
I am in my office PC and one of the more likely problems would be the firewall of the enterprise, so my questions would be:
Is there a way to workaround this problem and connect anyway?
If not, what would be the instruction I would have to give the IT department to be capable of connecting?
The following options should help you see whats happening:
library(rsconnect)
options(rsconnect.http.trace = TRUE, rsconnect.error.trace = TRUE, rsconnect.http.verbose = TRUE)
rsconnect::setAccountInfo(name='MYACCOUNTNAME',
token='TOKEN',
secret='<SECRET>')
By running this you should see what IP addresses rsconnect is trying to use. Try adding this to a whitelist for your firewall.
If this doesn't work it may be a proxy issue. Issue setting up my shinyapps.io + AUTHORIZE ACCOUNT + time out port 443 This should help set up a proxy in rStudio.
I am trying to connect Rstudio to Presto connectivity and am
receiving the error below. Please help me with support on this issue.
Error in curl::curl_fetch_memory(url, handle = handle) :
Empty reply from server
I am using the below steps, submitting the code to an Rstudio application:
library(RPresto)
library(dbConnect)
conn <- dbConnect(Presto(), catalog = 'ares', schema = 'default',
user = 'onur', host = 'localhost', port = 443,
session.timezone='US/Eastern')
dbListTables(conn, '%_iris')
dbDisconnect(conn)
I am able to get a API authentication token using the curl command on cygwin terminal on windows
curl -X POST -d '{"username":"usenamexxx","password":"passwordxxx"}' https://demo.website.com/api/token
output looks like
{"token":"87JrlYIOQa6g6aXciJOxNUK81","_links":{"DiscoveryPage":{"title":"Available API Resources","href":"https://demo.website.com/api"}}}
but when I try the POST command from R using the httr package I get the following error
library(httr)
tokenURL <- "https://demo.website.com/api/token"
s <- POST(tokenURL,body = list(username = "usenamexxx",password = "passwordxxx" ))
Error in function (type, msg, asError = TRUE) :
Unknown SSL protocol error in connection to demo.website.com:443
What am I doing wrong. Is there a different way to use POST?
Sorry I cannot provide a reproducible example as I cannot share my authentication details. If there is a way to provide more details please let me know.
This question already has answers here:
Use sendmailR with Windows
(4 answers)
Closed 8 years ago.
I am trying to use sendemailR package in R but I am getting an error I don't know how to fix.
When trying the default parameters:
library(sendmailR)
from <- "your_email"
to <- "your_email"
subject <- "Test send email in R"
body <- "It works!"
mailControl=list(smtpServer="smtp.gmail.com")
sendmail(from=from,to=to,subject=subject,msg=body,control=mailControl)
I get the error
Error in socketConnection(host = server, port = port, blocking = TRUE) :
cannot open the connection
In addition: Warning message:
In socketConnection(host = server, port = port, blocking = TRUE) :
Gmail SMTP Server:25 cannot be opened
So I change the port to 465 and it seems to work
library(sendmailR)
from <- "your_email"
to <- "your_email"
subject <- "Test send email in R"
body <- "It works!"
mailControl=list(smtpServer="smtp.gmail.com", smtpPort="465")
sendmail(from=from,to=to,subject=subject,msg=body,control=mailControl)
but then I get the following error
Error in if (code == lcode) { : argument is of length zero
Any idea what's happening?
This is the version of R and Windows
R version 3.0.3 (2014-03-06) -- "Warm Puppy"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
Thanks!
There are two things that need attention in your example:
As #David Arenburg commented, to should contain a valid email address.
The second thing is the smtp server you are using: smtp.gmail.com. This server need authentication which is not supported by sendmailR.
You can use an smtp server that does not require authentication (e.g. the restricted gmail smtp server: aspmx.l.google.com, port 25, see here for details)
The other option is to use the mailR package that allows authentication.
Try something like (of course you have to put valid email addresses and user.name and passwd to work):
library(mailR)
sender <- "SENDER#gmail.com"
recipients <- c("RECIPIENT#gmail.com")
send.mail(from = sender,
to = recipients,
subject="Subject of the email",
body = "Body of the email",
smtp = list(host.name = "smtp.gmail.com", port = 465,
user.name="YOURUSERNAME#gmail.com", passwd="YOURPASSWORD", ssl=TRUE),
authenticate = TRUE,
send = TRUE)
Hope it helps,
alex