Protocol sftp not supported or disabled in libcurl

2,038 views
Skip to first unread message

Vojta Dlapal

unread,
Jul 29, 2015, 9:24:21 AM7/29/15
to ShinyApps Users
Hi, I am having an issue with my basic shiny app deployed on shinyapps.io

I want to download csv file from sftp and analyze it. I use this code

        library(RCurl)
    ftpurl <- c("sftp://myftp.com/myfile")
    x <- getURL(ftpurl, userpwd="<name>:<pwd>",connecttimeout=120)
    writeLines(x, "mojeData.csv")
    data <- read.csv("mojeData.csv")


I works fine when I run app locally, but when I deploy it on shinyapps.io I get Error:Protocol sftp not supported or disabled in libcurl

Any ideas where is the problem and how can I fix it?

Thanks
Vojtech Dlapal


Andy Kipp

unread,
Jul 29, 2015, 9:35:42 AM7/29/15
to Vojta Dlapal, ShinyApps Users
So it looks like the version of libcurl that we use on shinyapps.io (which is just the version that ships with Ubuntu), does not support SFTP. 

I'm not sure what we can do about this at this time. To fix it, I guess we would have to build a custom version of libcurl.

Is there another library you can use?

-Andy


--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/f0534f06-d6aa-4b7a-9a0f-d773776ab0a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vojta Dlapal

unread,
Jul 29, 2015, 10:00:35 AM7/29/15
to Andy Kipp, ShinyApps Users
I am not aware of any other library, which might be suitable for my case...
 Anyways I believe that libcurl in ubuntu repos should be able to deal with sftp with no problems, so the problem might be a little more vague...

Cheers!
Vojtech Dlapal

Andy Kipp

unread,
Jul 29, 2015, 10:13:50 AM7/29/15
to Vojta Dlapal, ShinyApps Users
I found this Ubuntu bug that says that libcurl does not support sftp. 


Seems silly to me, but I'm not an Ubuntu maintainer. 

Johann de Boer

unread,
Sep 1, 2017, 4:49:52 AM9/1/17
to shinyapps.io Users, sadlomas...@gmail.com
Hi there, I'm encountering this issue as well. Does anyone have a workaround they can suggest? Would building my own Shiny Server be a suitable option to address this? I would prefer to host my app on shinyapps.io if the problem can be easily solved. Thanks.

Johann.

Joshua Spiewak

unread,
Sep 1, 2017, 10:19:26 AM9/1/17
to shinyapps.io Users, sadlomas...@gmail.com
The underlying Ubuntu support, even in 16.04, is still missing: https://bugs.launchpad.net/ubuntu/+source/curl/+bug/311029
You could try shelling out and using the system sftp command line instead, which is provided by the openssh-client package.

Johann de Boer

unread,
Sep 1, 2017, 1:20:27 PM9/1/17
to shinyapps.io Users, sadlomas...@gmail.com
With your suggestion of shelling out, would this be using the system2 command in R to execute an sftp system command with arguments being to run a batch file that handles the necessary remote ftp commands? I.e. sftp -b batchfile [user@]host

Is the openssh-client package pre-installed on shinyapps.io Shiny Server instances or would this need to be done each time a server is initiated?

Joshua Spiewak

unread,
Sep 1, 2017, 1:35:50 PM9/1/17
to shinyapps.io Users, sadlomas...@gmail.com
The list default system packages is listed here: http://docs.rstudio.com/shinyapps.io/appendix.html#default-system-packages
So sftp should be available as a system command without anything else needed.

Johann de Boer

unread,
Sep 2, 2017, 4:01:32 AM9/2/17
to shinyapps.io Users, sadlomas...@gmail.com
Hi Joshua, thanks for checking that for me. I tried to use the `sftp` system command, but as I need to authenticate using a password rather than SSH keys I believe I will require another method such as `lftp`. Unfortunately I could not find `lftp` in that list you linked to. I also tried `sshpass` but that also appeared to be unavailable.

Do you know if it is possible to run system commands from R to install either 'lftp' or 'sshpass' at the initiation of an instance on the shinyapps.io server? Would I be right in guessing that this would not be possible due to administrative access restrictions?

I wonder how this Ubuntu issue could be resolved or circumvented? What about other linux distributions? Any other ideas or suggestions you have would be great.

Thanks.

Joshua Spiewak

unread,
Sep 5, 2017, 9:45:38 AM9/5/17
to shinyapps.io Users, sadlomas...@gmail.com
Correct, users are not directly privileged to install system packages, they are installed as a side effect of installing R packages via shinyapps-package-dependencies
Unlikely we would switch our Linux distribution.

You might be better off self-hosting in this case.

niend...@gmail.com

unread,
Jan 30, 2018, 9:58:59 AM1/30/18
to shinyapps.io Users
Could you provide an example code line for the shelling out option? Or link to some examples of the openssh-client package? I can't find any documentation. Thanks a lot.

Op dinsdag 5 september 2017 15:45:38 UTC+2 schreef Joshua Spiewak:
Reply all
Reply to author
Forward
0 new messages