3

I've gotten a few different error messages when trying to publish both a .Rpres and an .Rmd file to RPubs in RStudio. Besides the two below, another error is just a blank Error response. I've tried publishing both while connected to a VPN and while disconnected and can't find a pattern in the type of error I get back.

I've been able to successfully publish an .Rmd file to RPubs in the past (last about a month ago). When I republished that .Rmd that existed on RPubs it was overwritten and is now blank.

Not sure whether this is an openssl issue or something else. I don't think the error messages ever mentioned SSL explicitly, but just in case I tried re-installing openssl from homebrew, sudo accepting the xcodebuild license and from CRAN; everything looks okay (package ‘openssl’ successfully unpacked and MD5 sums checked).

I've also added options(rpubs.upload.method = "internal") to my .RProfile.

I'm running R version 3.3.3 and RStudio Version 1.1.383 on OSX version 10.13.


Error in function (type, msg, asError = TRUE) : Empty reply from server
Calls: <Anonymous> ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted

<!DOCTYPE html>
<html>
<head>
<title>Error</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>An error occurred.</h1>
<p>Sorry, the page you are looking for is currently unavailable.<br/>
Please try again later.</p>
<p>If you are the system administrator of this resource then you should check
the <a href="http://nginx.org/r/error_log">error log</a> for details.</p>
<p><em>Faithfully yours, nginx.</em></p>
</body>
</html>

Edit: full response when options(RCurlOptions = list(verbose = TRUE, capath = system.file("CurlSSL", "cacert.pem", package = "RCurl"), ssl.verifypeer = TRUE)) added to Rprofile`

*   Trying 50.19.223.253...
* TCP_NODELAY set
* Connected to api.rpubs.com (50.19.223.253) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /Users/amanda/Library/R/3.3/library/rsconnect/cert/cacert.pem
  CApath: /Users/amanda/Library/R/3.3/library/RCurl/CurlSSL/cacert.pem
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: CN=rpubs.com
*  start date: Oct 30 00:00:00 2017 GMT
*  expire date: Nov 30 12:00:00 2018 GMT
*  subjectAltName: host "api.rpubs.com" matched cert's "api.rpubs.com"
*  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
*  SSL certificate verify ok.
> POST /api/v1/document HTTP/1.1
Host: api.rpubs.com
User-Agent: rsconnect/0.8.5
Accept: */*
Connection: close
Content-Type: application/x-compressed
Content-Length: 10630431
Expect: 100-continue

< HTTP/1.1 100 Continue
* We are completely uploaded and fine
* Empty reply from server
* Connection #0 to host api.rpubs.com left intact
Error in function (type, msg, asError = TRUE)  : Empty reply from server
Calls: <Anonymous> ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
amanda
  • 321
  • 5
  • 12

1 Answers1

0

Proposed Solution:

I would suggest you add the following lines to your .RProfile

options(rpubs.upload.method = "internal")
options(RCurlOptions = list(verbose = FALSE, capath = system.file("CurlSSL", "cacert.pem", package = "RCurl"), ssl.verifypeer = TRUE))

Steps:

(1) Create a text file and enter the following line in it:

options(rpubs.upload.method = “internal”)

(2) Save the file in the same directory as your knitr project. The file name should be .Rprofile (or in your home directory)

Note that the name starts with a dot (.)

(3) Now change to the knitr project directory and compile your Rmd file.

(4) Open your browser and login to Rpubs with your user name and password. (This is optional, but some times it was found to be a necessary step).

(5) Back in R studio, press 'publish'.


If the above does not work remove and reinstall RCurl

remove.packages("RCurl")
install.packages("RCurl")

I would then restart RStudio and try to publish via RStudio. If it still fails my recommendation is to remove RStudio and reinstall.

Why? Well, the second line fixed my problems with RPubs publishing :-)

to debug you can set verbose = TRUE.

Further information:

What package manager are you using on Mac os x?

  • Brew or Macports?

I ask as the problem may be related to an underlying problem with your package installation. i.e. If you are using brew then you may need to do a brew doctor to check your config.

Proxy Config

If you are running behind a proxy you need to configure access.

Ref: https://support.rstudio.com/hc/en-us/articles/205002917-SSL-certificate-problem-when-publishing-to-RPubs

rCurl Debug Resources:

If you are still having problems I recommend you review:

RPubs Help Page:

Technophobe01
  • 8,212
  • 3
  • 32
  • 59
  • Thanks for the detailed answer! Unfortunately hasn't solved the problem. I added those lines to my .Rprofile and uninstalled and reinstalled the RCurl package. I've gotten `Error in function (type, msg, asError = TRUE) : Empty reply from server Calls: ... tryCatch -> tryCatchList -> tryCatchOne -> Execution halted` when RCurl option `verbose = FALSE` and (among longer message) `< HTTP/1.1 100 Continue * We are completely uploaded and fine * Empty reply from server * Connection #0 to host api.rpubs.com left intact` when `verbose = TRUE` – amanda Nov 10 '17 at 05:05
  • After uninstalling and reinstalling RStudio (to Version 1.2.164) all I get is the Upload Error Occurred pop-up with no text, even when `verbose=TRUE`. Also, I'm using brew. – amanda Nov 10 '17 at 05:11
  • Well, actually error messages are weirdly inconsistent. Everything from nothing at all to the full verbose response even when nothing has changed. – amanda Nov 10 '17 at 05:20
  • If it's useful, I've noticed that uploading .Rmds works but they are blank. Uploading an .Rpres is where I've noticed the errors above. – amanda Nov 10 '17 at 05:25
  • @amanda Here is what I would propose you try to validate proxy problem. Try to publish from a coffee shop (Starbucks) if that works great. If it doesn't then we have confirmed it is a machine config. – Technophobe01 Nov 10 '17 at 07:34
  • @amanda What the name of the file you are publishing to RPubs? It looks like a proxy issue due to the error message `ALPN, server did not agree to a protocol` message. The other issue is the file name is problematic. – Technophobe01 Nov 10 '17 at 07:43
  • It's just called `brewsentation.Rpres` and it's inside a `present/` directory in my RProject. I'll be able to try your idea of publishing from a coffee shop tomorrow. Do you think it might be worth creating a new RPubs account? – amanda Nov 11 '17 at 06:08
  • No, my sense is your working through a proxy server. if it works at the coffee shop, then we can infer it is the location. it is does'nt work then it is likely a machine config issue. – Technophobe01 Nov 11 '17 at 07:04
  • Yeah, so hasn't worked trying to publish from different locations. Same panoply of different errors :/ You've been super helpful, so thanks a bunch. I'm going to take a stab at understanding the RCurl article you posted and will of course post a solution if I find one. – amanda Nov 14 '17 at 02:13
  • no worries always happy to help. Let me noodle on this also. – Technophobe01 Nov 14 '17 at 07:04