rstudio / rsconnect

Publish Shiny Applications, RMarkdown Documents, Jupyter Notebooks, Plumber APIs, and more

Home Page:http://rstudio.github.io/rsconnect/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Republishing to RPubs, Error: HTTP/2 stream 1 was reset

zhengxiaoUVic opened this issue · comments

AN ERROR OCCURS when I knit an Rmd into HTML and republish (update existing) it to RPubs. There is no problem with the initial upload or republishing long ago Rmd.

Error in curl::curl_fetch_memory(url, handle = handle) : HTTP/2 stream 1 was reset Calls: <Anonymous> -> http -> <Anonymous> Execution halted

I have tried the simplest HTML document. So, the error is not due to the file size.

R version 4.3.1
RStudio version 2023.09.0+463
macOS Ventura 13.5.2
MacBook Air, M2

I fixed the republishing issue by downgrading the "rsconnect" R package.

remove.packages("rsconnect") #Remove Installed Packages
remotes::install_version("rsconnect", version = "0.8.29") #Installing a Specific Version of a Package

Any higher versions of rsconnect (e.g., 1.0.0, 1.0.1, 1.0.2, 1.1.0 and latest 1.1.1) will cause the error regarding "HTTP/2 stream 1 was reset". After downgrading "rsconnect", RMD files with failed republishing will still not be republished. You need to upload a fresh one.

I think there's a bad call to deploymentRecord in rpubs.R. Here's the function signature in deployments.R:

deploymentRecord <- function(name,
                             title,
                             username,
                             account,
                             server,
                             envVars = NULL,
                             hostUrl = NULL,
                             appId = NULL,
                             bundleId = NULL,
                             url = NULL,
                             version = deploymentRecordVersion,
                             metadata = list()) {

Here's the call site in rpubs.R:

    rpubsRec <- deploymentRecord(recordName, "", "", "rpubs", "rpubs.com", "rpubs.com", id, id,
                                 url, as.numeric(Sys.time()))

So here's how the parameters match up to the arguments:

name=recordName
title=""
username=""
account="rpubs"
server="rpubs.com"
envVars="rpubs.com"
hostUrl=id
appId=id
bundleId=url
url=as.numeric(Sys.time())
metadata=(omitted)

envVars="rpubs.com" seems wrong, and everything after that seems off by one. I suspect envVars was added later, and the call from rpubs.R was never updated.

I believe the change to envVars happened here: ee06339
in April of this year, likely rsconnect >= 1.0.0

Additional changes to deploymentRecord occurred in #702...

It's probably my fault 😭

Argument removal (when and last-sync) in 8f19a2a

It's probably my our fault 😭

The collective!

image

I don't know what I am doing wrong. Here is my updated dcf:

name: Document
title:
username:
account: rpubs
server: rpubs.com
hostUrl: rpubs.com
appId: https://api.rpubs.com/api/v1/document/1099849/f24f13c92bd4430a8e6d83d25154f1fc
bundleId: http://rpubs.com/publish/claim/1099849/37d672b76e4748539e6d5983395371e5
url:  https://rpubs.com/bellj39/1099849
version: 1