Closed akgold closed 2 years ago
Given that it's a 500 error, it might be useful to get the logs off the server.
@colearendt -- where would these logs be? Access log?
A couple of places - not in DataDog yet, so I poked around on the server:
# from connect3
127.0.0.1 - - [16/Nov/2021:11:10:48 +0000] "GET /bike_model_performance_app/ HTTP/1.1" 500 744
Do you know about what time it was that you got this 500?
I got the same thing on the same server at roughly 2021-11-18 10:27:55 UTC
There might be one or two more in the prior 10-15 minutes as I was testing.
I have unfortunately reached a bit of a dead-end here without a better way to get debug logging / information about what is being used to generate the signature. RSC is rejecting the signature:
2021/11/18 10:27:40 Warning: authentication failed for token Tb84764a081b2d99b6f1dce158bbd4f63: invalid signature for request '"GET\n/rsc/__api__/applications/\nThu, 18 Nov 2021 10:27:39 GMT\n1B2M2Y8AsgTpgAmY7PhCfg=="': crypto/rsa: verification error
✗ ssh soleng-connect3 -- sudo cat /var/log/rstudio-connect.access.log | grep ' 500'
127.0.0.1 - - [18/Nov/2021:10:15:44 +0000] "GET /__api__/server_settings HTTP/1.1" 500 824
127.0.0.1 - - [18/Nov/2021:10:16:14 +0000] "GET /__api__/applications/?filter=content_type%3Apin&count=1000 HTTP/1.1" 500 822
127.0.0.1 - - [18/Nov/2021:10:27:40 +0000] "GET /__api__/applications/?filter=content_type%3Apin&count=1000 HTTP/1.1" 500 822
I have a packet capture and enough to test / see what signature is/should have been generated (i.e. the request, the Date header, etc.), but our tooling is very tricky to do that, and we were not able to use the rsconnect.*
options to generate more verbose logs. Happy to provide some of this information or help test more if there is an easy way to either generate signatures from given inputs or increase logging verbosity.
From the error message and past experience, my only guesses are:
:443
port is getting injected into the signed url, which then fails on the server validation because :443
has been stripped (we saw this before)/rsc/
part of the path is getting added to the "file" that we md5, when it should not be? This works in rsconnect
though, so not sure what is going on with pins
/rsc/
part of the path is not getting added to the "file" that we md5 when it should be. (This may be the most likely scenario... I just tested a shell script that has this behavior and it reports the same error. Fixing the "file" by adding "/rsc" (the full URL path) resolves)Basically, token auth is not working on RSC at present. Either because of https
or because of the subpath that we host Connect at.
@colearendt can you tell me more about the 443 port? I don't see that port used anywhere in pins.
And are you saying the path passed to the signature is relative to the server root? Currently we're sending "rsc/__api__/server_settings"
. Are you saying that should be "__api__/server_settings"
?
Also it works for pins::board_rsconnect(server = "connect.rstudioservices.com")
so what's the difference between these servers?
After pairing with @jmcphers for 30 minutes and considering many exotic possible causes we discovered that it's a missing /
😬
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.
I can publish to Colorado RSC with accounts registered to
rsconnect
, but it does not work to auth inpins
. I can pin using API Key auth.The error is thrown in
pins:::rsc_GET
. I'm not sure what other diagnostic information to supply, but happy to do so...