rstudio / connectapi

An R package for interacting with the RStudio Connect Server API
https://pkgs.rstudio.com/connectapi/
Other
43 stars 24 forks source link

Handle redirects #201

Open colearendt opened 1 year ago

colearendt commented 1 year ago

We recently hit redirect issues where connectapi would just hang on redirects. We should handle redirects more nicely

@jspiewak

nealrichardson commented 1 month ago

Do you have a reproducer? IIRC there is a curl option to follow redirects, but it thought it was default to on.

jspiewak commented 1 month ago

It was likely a piece of content that was explicitly pointed at connect.rstudioservices.com that didn't gracefully handle when we migrated to connect.posit.it and put a redirect in place. But maybe Cole recalls more specifics.

aronatkins commented 1 month ago

An rsconnect issue from the same time (host rename): https://github.com/rstudio/rsconnect/issues/760

One problem we observed is that the initial request received a redirect response but the client didn't recognize that its payload needed to be resent.

This comment talks about what we saw for colorado: https://github.com/rstudio/rsconnect/pull/754#discussion_r1131878399

colearendt commented 1 month ago

Yeah, I believe this was related to these pins requests. I did them at the same time, at least 😅

https://github.com/rstudio/pins-r/issues/760 https://github.com/rstudio/pins-r/issues/759

The problem for this post was a few scheduled reports on Connect that were not handling redirects. As a result, they just blocked and filled the job queue so nothing else on the server could run. I'll DM the reports in question.

You're right though - a rudimentary check just now showed connectapi respecting redirects

nealrichardson commented 1 month ago

One problem we observed is that the initial request received a redirect response but the client didn't recognize that its payload needed to be resent.

That sounds like https://curl.se/libcurl/c/CURLOPT_POSTREDIR.html