So sad. Alas, it should not be!! See that X-Auth-Token in the header? Is that same token in the URL that you are redirected to for authentication / verifying the token?
Also, I had a random idea - and a complete long shot - any chance you have 2 QuickStarts running?
My flailing is getting a bit more complex and less productive - maybe I should think for a bit before giving any other advice I'm very perplexed by this behavior. Once the token is activated, Connect should accept authentication using that token...
My pleasure! Sorry for the trouble here! This is a strange one! I hope I'm not missing something obvious haha.
I doubt the corporate firewall is the issue here (as you said, b/c of localhost), although there are all manner of strange networking that could be configured internally to your desktop and causing issues. It also could be a weird package installation or some other funky issue causing trouble. I'd love to get to the root cause, but sometimes a workaround is the fastest solution that gets you moving.
EDIT: Something I didn't even think about... another long shot. What if you set http://127.0.0.1:5000/rsconnect/ as your server? I wonder whether IP address vs. hostname (localhost) makes a difference...
Setting "rsconnect.http" = "curl" doesn't seem to help.
A critical piece of our evaluation criteria is ease of deployment either via RStudio Desktop/Server, so it's less so the product, more so the process; I'm going to add RStudio Server to the VM and see if that works at least.
# get server info from RSTUDIO_CONNECT_SERVER
# get API key from RSTUDIO_CONNECT_API_KEY
library(connectapi)
options(rsconnect.http.verbose = TRUE)
options(rsconnect.http.trace.json = TRUE)
options("rsconnect.http" = "curl")
client <- connect()
#> Defining Connect with host: http://localhost:5000/rsconnect/
#> Problem talking to RStudio Connect at http://localhost:5000/rsconnect//__api__/server_settings
#> Error in rbind(info, getNamespaceInfo(env, "S3methods")): number of columns of matrices must match (see arg 2)
Woohoo!! So glad that the RStudio Server deployment worked! I suspect something weird is going on w/ your desktop's networking (and RStudio Server gets the benefit of having all networking "inside" of the QuickStart). It'd be great to figure this out in case future users experience though!
I will definitely poke around at this and see what I can reproduce or debug this week! Do you mind sharing packageVersion("httr")? That error message you're getting is an interesting one!
Also, I imagine this whole debugging process can be pretty discouraging (especially when "ease of deployment from the desktop" is a primary consideration). I will say that the QuickStart makes some of the networking semantics from the desktop a bit trickier to marshal than normal (Virtual Machine inside of your machine and whatnot). Further, this is definitely nonstandard publishing behavior and would certainly be covered under our professional support for a "real" installation
I found this thread that might be related to your issue! Perhaps some dependency of the httr package is corrupted? The mailing list suggests the following (potentially time consuming) exploration to see which package is causing trouble. Does library("httr") work for you, or does it throw the rbind error? I presume it succeeds b/c you can change the version of the package.
The gist is to see which package does not return "3" from this computation
Funny, I bumped into the exact post and that's how I realized/fixed my curl and httr issues
The Error in rbind(info, getNamespaceInfo(env, "S3methods")): number of columns of matrices must match (see arg 2) is gone, but still can't connect to RS Connect.
Sorry for the delayed response here!! Glad to hear we found the same solution
Do you mind sharing some updated info about the workarounds we aimed for that were failing with the rbind problem? I.e. the connectapi package, etc.? I'm curious what error messages we are receiving now!
My working theory is that something in your desktop networking is stripping off the X-Auth-Token header, but I have been tied up for a few days and have not had a chance to dig into whether I am missing something in the commands I have asked you to execute
Here are our trials so far, aside from using connectapi package. All resulted in the same repeated 500 response, even after successful authentication in browser.
We worked through this privately to cut down on the back-and-forth and make the thread a bit more concise. The problem ended up being time-sync, which was very apparent in the /var/log/rstudio-connect.log file (although nowhere else, which we would love to improve).
2019/10/05 20:18:03 Warning: authentication failed for token T537e76f75bfc1b0dff6433475702e191: unable to sanitize request: The Date header of the HTTP request is too different from the system clock. Ensure client/server clocks are synced.
The QuickStart usually manages time syncing itself, but it does so by depending on an internet connection. In an offline environment, the time sync can be off, which kills the token authorization process (and thus publishing from the IDE).
The recommended practice in this case is to:
Publish from RStudio Server Pro inside the QuickStart, which will have the same time as the Connect instance
Publish using programmatic or git-backed deployment, where time sync does not present a problem
If you want to go about syncing the time and do not have online access or a time sync server handy, you can set the time manually:
# see the server time
timedatectl status
# set the time
sudo timedatectl set-time 15:58:30
# for both date and time
# sudo timedatectl set-time '2015-11-20 16:14:50'
Just be sure that the dateand the time are the same. That one stumped us for a little bit. The time was in sync, but the date was off by a day.