connectapi icon indicating copy to clipboard operation
connectapi copied to clipboard

Handle redirects

Open colearendt opened this issue 1 year ago • 5 comments

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

@jspiewak

colearendt avatar Jul 31 '23 18:07 colearendt

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

nealrichardson avatar Jun 06 '24 18:06 nealrichardson

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.

jspiewak avatar Jun 06 '24 20:06 jspiewak

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

aronatkins avatar Jun 10 '24 12:06 aronatkins

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

colearendt avatar Jun 10 '24 12:06 colearendt

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

nealrichardson avatar Jun 10 '24 12:06 nealrichardson