rstudio / rsconnect

Publish Shiny Applications, RMarkdown Documents, Jupyter Notebooks, Plumber APIs, and more
http://rstudio.github.io/rsconnect/
131 stars 80 forks source link

pin_write error while publishing #939

Closed stahengik closed 10 months ago

stahengik commented 1 year ago

We have recently upgrade our posit connect server to 2023.03.0 and we have issues with pin_write when we publish the content on posit connect.

In my rmd that I am trying to publish, I have this code chunk,

> board %>% pin_write(x = data_to_pin,
> name = "name for pin data",
> type = 'rds',
> title = "title for pin data",
> force_identical_write = TRUE)
> 

> Quitting from lines 105-122 [unnamed-chunk-8] (Fetch-and-Pin-GVL-H2-Comp-Data.Rmd)
> Error in `curl::curl_fetch_memory()`:
> ! necessary data rewind wasn't possible
> Backtrace:
> 1. board %>% ...
> 2. pins::pin_write(...)
> 4. pins:::pin_store.pins_board_connect(...)
> 9. pins:::rsc_content_update(board, guid, metadata, access_type = access_type)
> 10. pins:::rsc_PATCH(board, rsc_v1("content", guid), body = body)
> 11. pins:::rsc_POST(...)
> 12. httr::VERB(...)
> 13. httr:::request_perform(req, hu$handle$handle)
> 15. httr:::request_fetch.write_memory(req$output, req$url, handle)
> 16. curl::curl_fetch_memory(url, handle = handle)

I am using "force_identical_write " argument because, it kept warning that the hash did not change so it did now write the pin and I though that might have been the issue.

The code chunks run fine and are able to write the pins when running on local Rstudio IDE but it fails while publishing.

We have installed and updated curl on the server but it does not help:

> [q9q-extra@mss6300 bin]$ sudo yum install curl
> Updating Subscription Management repositories.
> Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)                         40 kB/s | 4.5 kB     00:00
> Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)                            37 kB/s | 4.1 kB     00:00
> Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (RPMs)                         41 kB/s | 4.5 kB     00:00
> Package curl-7.61.1-12.el8_2.4.x86_64 is already installed.
> Dependencies resolved.
> Nothing to do.
> Complete!
> [q9q-extra@mss6300 bin]$ sudo yum update curl
> Updating Subscription Management repositories.
> Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)                         50 kB/s | 4.5 kB     00:00
> Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)                            46 kB/s | 4.1 kB     00:00
> Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (RPMs)                         49 kB/s | 4.5 kB     00:00
> Dependencies resolved.
> Nothing to do.
> Complete!
hadley commented 1 year ago

Is there some chance the server you used in board_connect() now redirects?

stahengik commented 1 year ago

I can not say that I understand the question. but following are the details that may help answer.

Lets say my server name is Http://xyz9818, when I type this in my browser, the address becomes _http://xyz9818/connect/#/content/listing?filter=min_role:viewer&filter=content_type:all&view_type=compact_

Does this means its redirecting ?

Also, When I provided server and key in the board_connect, it does not work. board <- board_connect( auth = 'auto', server = 'SERVER', key = 'KEY') does not work.

It at least work on my machine when I am using board <- board_connect() without any arguments and it picks the server on it own from config/settings. I am not sure why it does not work when I do provide the server name and key!

Also, Please checkout some additional information here: Posit support ticket for curl Posit support ticket for board_connect()

stahengik commented 1 year ago

The older Rstudio Connect server does not redirects. The new server is on a new machine not connected to the old one in any way. I have removed the old connection from my machine.

hadley commented 1 year ago

Looking at the information sent to @kmasiello via support ticket, this looks more like an issue with your proxy.

stahengik commented 1 year ago

Thanks for your support so far. I am trying options suggested by Katie.

hadley commented 10 months ago

@stahengik are you still seeing this problem with the latest httr2 from CRAN?

stahengik commented 10 months ago

No, not anymore

On Fri, Oct 27, 2023 at 3:21 AM Hadley Wickham @.***> wrote:

@stahengik https://github.com/stahengik are you still seeing this problem with the latest httr2 from CRAN?

— Reply to this email directly, view it on GitHub https://github.com/rstudio/rsconnect/issues/939#issuecomment-1781941934, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACTFSSHWXAZDHBQYQJ6LA23YBLLMZAVCNFSM6AAAAAA26LSRXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBRHE2DCOJTGQ . You are receiving this because you were mentioned.Message ID: @.***>

hadley commented 10 months ago

Yay!