【问题标题】:nginx and empty reply from server errors when publishing RMarkdown to RPubs将 RMarkdown 发布到 RPubs 时,nginx 和服务器错误的空回复
【发布时间】:2018-04-14 00:03:31
【问题描述】:

在尝试将 .Rpres 和 .Rmd 文件发布到 RStudio 中的 RPubs 时,我收到了一些不同的错误消息。除了下面的两个,另一个错误只是一个空白的错误响应。我尝试在连接到 VPN 和断开连接时发布,但在我返回的错误类型中找不到模式。

过去(大约一个月前)我已经能够成功地将 .Rmd 文件发布到 RPubs。当我重新发布存在于 RPubs 上的 .Rmd 时,它已被覆盖,现在为空白。

不确定这是 openssl 问题还是其他问题。我认为错误消息从未明确提到过 SSL,但以防万一我尝试从自制软件重新安装 openssl,sudo 接受 xcodebuild 许可证和 CRAN;一切看起来都很好 (package ‘openssl’ successfully unpacked and MD5 sums checked)。

我还在我的 .RProfile 中添加了 options(rpubs.upload.method = "internal")

我在 OSX 版本 10.13 上运行 R 版本 3.3.3 和 RStudio 版本 1.1.383。


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>

编辑:将options(RCurlOptions = list(verbose = TRUE, capath = system.file("CurlSSL", "cacert.pem", package = "RCurl"), ssl.verifypeer = TRUE)) 添加到 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

【问题讨论】:

  • 我解决了您的问题吗?如果没有如果你设置verbose = TRUE很高兴查看错误数据。
  • 太棒了,它已被添加到原始帖子中。

标签: r rstudio r-markdown


【解决方案1】:

建议的解决方案:

我建议您将以下几行添加到您的 .RProfile

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

步骤:

(1) 创建一个文本文件并在其中输入以下行:

选项(rpubs.upload.method = “内部”)

(2) 将文件保存在与您的 knitr 项目相同的目录中。文件名应为 .Rprofile(或在您的主目录中)

请注意,名称以点 (.) 开头

(3) 现在切换到 knitr 项目目录并编译您的 Rmd 文件。

(4) 打开您的浏览器并使用您的用户名和密码登录到 Rpubs。 (这是可选的,但有时它被认为是必要的步骤)。

(5) 回到 R 工作室,按“发布”。


如果上述方法不起作用,请删除并重新安装 RCurl

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

然后我会重新启动 RStudio 并尝试通过 RStudio 发布。如果仍然失败,我的建议是删除 RStudio 并重新安装。

为什么?好吧,第二行解决了我的 RPubs 发布问题 :-)

调试你可以设置verbose = TRUE

更多信息:

您在 Mac os x 上使用什么包管理器?

  • Brew 还是 Macports?

我问这个问题可能与您的软件包安装的潜在问题有关。即,如果您使用的是brew,那么您可能需要使用brew doctor 来检查您的配置。

代理配置

如果您在代理后面运行,则需要配置访问权限。

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

rCurl 调试资源:

如果您仍有问题,我建议您查看:

RPubs 帮助页面:

【讨论】:

  • 感谢您的详细解答!不幸的是并没有解决问题。我将这些行添加到我的 .Rprofile 并卸载并重新安装了 RCurl 包。当 RCurl 选项 verbose = FALSE 和(在更长的消息中)&lt; HTTP/1.1 100 Continue * We are completely uploaded and fine * Empty reply from server * Connection #0 to host api.rpubs.com left intact verbose = TRUE 时,我得到了 Error in function (type, msg, asError = TRUE) : Empty reply from server Calls: &lt;Anonymous&gt; ... tryCatch -&gt; tryCatchList -&gt; tryCatchOne -&gt; &lt;Anonymous&gt; Execution halted
  • 卸载并重新安装 RStudio(至版本 1.2.164)后,我得到的只是没有文本的“发生上载错误”弹出窗口,即使在 verbose=TRUE 时也是如此。另外,我正在使用 brew。
  • 嗯,实际上错误消息出奇地不一致。从一无所有到完整的详细响应,即使没有任何变化。
  • 如果有用,我注意到上传 .Rmds 有效,但它们是空白的。上传 .Rpres 是我注意到上述错误的地方。
  • @amanda 我建议您尝试验证代理问题。如果效果很好,请尝试从咖啡店(星巴克)发布。如果不是,那么我们已经确认它是一个机器配置。
猜你喜欢
  • 1970-01-01
  • 2022-12-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-07-02
  • 2015-03-04
  • 1970-01-01
相关资源
最近更新 更多