RSConnect QuickStart Issue - RStudio Desktop Connection

Followed guide and successfully authenticate in browser (see screenshot below).

However, RStudio Desktop IDE doesn't proceed to next step, and only option is to Cancel (see screenshot below).

Attempted with rsconnect::connectUser() in RStudio, and went through the above steps, but again stuck on being actually connected.

It’s me again!! Haha. Another weird one!! What version of the rsconnect package are you using?

packageVersion(“rsconnect”)

If you update to the latest on CRAN (or maybe try GitHub), hopefully that will fix?

devtools::install_github(“rstudio/rsconnect”)

If that doesn’t work, maybe try executing the following in the R console to see if that gives any more info:

options(rsconnect.http.verbose = TRUE)
options(rsconnect.http.trace.json = TRUE)

Was anxiously waiting for your reply, like a Halloween candy hunter :slight_smile:

Updated rsconnect, but skipped curl and rstudioapi.

Not good; now rsconnect() doesn't even recognizer server; same outcome via Tools > Global Options.

packageVersion("rsconnect")
#> [1] '0.8.15'

packageVersion("curl")
#> [1] ‘4.1’

packageVersion("rstudioapi")
#> [1] ‘0.10.0.9000’

options(rsconnect.http.verbose = TRUE)
options(rsconnect.http.trace.json = TRUE)

rsconnect::connectUser(account = "rstudio", "http://localhost:5000/rsconnect")
#> Error in serverInfo(server): server named 'http://localhost:5000/rsconnect' does not exist

Created on 2019-09-26 by the reprex package (v0.2.1)

Hahaha. That's great :joy: And weird!! One good thing (I guess?) - I can reproduce this behavior. Maybe try this flow. It unfortunately won't work great in a reprex b/c the browser hangs the process.

options(rsconnect.http.verbose = TRUE)
options(rsconnect.http.trace.json = TRUE)

rsconnect::addConnectServer("http://localhost:5000/rsconnect/", "quickstart")
rsconnect::connectUser("rstudio", "quickstart")

Apologies for delayed reply; same issue as before (unrecognized).


options(rsconnect.http.verbose = TRUE)
options(rsconnect.http.trace.json = TRUE)

rsconnect::addConnectServer("http://localhost:5000/rsconnect/", "quickstart")
#> Server 'quickstart' added successfully: http://localhost:5000/rsconnect/__api__
rsconnect::connectUser("rstudio", "quickstart")
#> Error in rbind(info, getNamespaceInfo(env, "S3methods")): number of columns of matrices must match (see arg 2)

Created on 2019-09-27 by the reprex package (v0.2.1)

Tried these and same issue:

  • Restarted RSConnect

  • Powered off .ova and relaunch

Very strange!! Connect is accessible at http://localhost:5000/rsconnect/ inside your browser on your local desktop, right? What do you get if you try something like the following from your R console:

httr::content(httr::GET("http://localhost:5000/rsconnect/__api__/server_settings"))

Yes, accessible from browser, but not detected in IDE.

WAT!? That is some different kind of wacky haha. :laughing: I'm really perplexed why your browser can access, but R cannot. It explains why the token activation process is failing though.

Do you mind looking at httr::status_code() of that GET request? And maybe any other information you can pull out? Maybe httr::http_error()?

If we can't figure this out, I think we can do the token activation manually, but that'll probably be pretty nasty. I would love for the R console and the browser to behave consistently from a networking perspective haha.

EDIT: Although, now that I think about it, deployment is going to be really tough if we can't get R talking to Connect somehow... Hm! I'm going to have to noodle on what is different between your R process and your browser...

What does going to this URL in the browser give you? http://localhost:5000/rsconnect/__api__/server_settings

(Nice gif, btw!!)

Running http://localhost:5000/rsconnect/__api__/server_settings gives:

{"code":92,"error":"XSRF token mismatch","payload":null}

Since httr::GET("http://localhost:5000/rsconnect/__api__/server_settings") gives an error, I can't do a httr::status_code() or httr::http_error() with no response back from GET.

Do you have "git bash" installed on your system? Any chance you can run curl -i http://localhost:5000/rsconnect/__api__/server_settings in the RStudio terminal? I'm not super familiar with Windows and whether or not that's possible inside of git bash :stuck_out_tongue:

I am admittedly more proficient with curl than httr, ironically enough. I'm super perplexed by this networking behavior!

Appreciate the prompt response, as usual.

Here's bash output.

$ curl -i http://localhost:5000/rsconnect/__api__/server_settings
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2060    0  2060    0     0   8765      0 --:--:-- --:--:-- --:--:--  8765HTTP/1.1 200 OK
Server: nginx/1.14.0 (Ubuntu)
Date: Fri, 27 Sep 2019 17:09:34 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: no-cache, no-store, must-revalidate
Expires: 0
Pragma: no-cache
Set-Cookie: rscid=MTU2OTYwNDE3NHxEdi1CQkFFQ180SUFBUkFCRUFBQV80TF9nZ0FEQm5OMGNtbHVad3dHQUFSSFZVbEVCbk4wY21sdVp3d21BQ1F4WmpSbU0yWTVPUzAxTURObUxUUTNZVGd0T1RFek5TMDJNakF3TWpoa01HVTVOamdHYzNSeWFXNW5EQWtBQjJOeVpXRjBaV1FGYVc1ME5qUUVCZ0Q4dXh5RW5BWnpkSEpwYm1jTUNRQUhjbVZtY21WemFBVnBiblEyTkFRR0FQeTdISVNjfPiLXr121YaFjkth36Jdtr-4qnEa5Ummbjo5lIrduchM; Path=/; Expires=Sun, 27 Oct 2019 17:09:34 GMT; Max-Age=2592000; HttpOnly
X-Content-Type-Options: nosniff
X-Frame-Options: DENY

{"version":"","build":"","about":"","authentication":{"handles_login":true,"external_user_data":true,"external_user_search":false,"groups_enabled":true,"external_group_data":false,"name_editable_by":"adminandself","email_editable_by":"adminandself","username_editable_by":"provider","role_editable_by":"adminandself","challenge_response_enabled":false,"name":"PAM","notice":"WARNING: This is a Quickstart Server and using it in production is not supported. Login with user/password rstudio/rstudio"},"license":{"ts":1569584293290,"status":"evaluation","expiration":0,"days-left":42,"edition":"","cores":"0","connections":"0","has-key":false,"has-trial":false,"type":"local","shiny-users":"0","users":"0","user-activity-days":"0","allow-apis":"1"},"google_analytics_tracking_id":"","viewer_kiosk":false,"mail_all":false,"mail_configured":true,"recent_visibility":"viewer","public_warning":"\u003cb\u003eWARNING: This is a Quickstart Server and using it in production is not supported\u003c/b\u003e","logged_in_warning":"\u003cb\u003eWARNING: This is a Quickstart Server and using it in production is not supported\u003c/b\u003e","logout_url":"__logout__","metrics_rrd_enabled":true,"metrics_instrumentation":true,"customized_landing":false,"self_registration":true,"prohibited_usernames":["connect","apps","users","groups","setpassword","user-completion","confirm","recent","reports","plots","unpublished","settings","metrics","tokens","help","login","welcome","register","resetpassword","content"],"username_validator":"permissive","http_warning":false,"queue_ui":false,"v1_dev_api":false,"license_expiration_ui_warning":true,"runtimes":["R","Python"],"dashboard_build_guid_based_routes":false,"dashboard_fail_id_based_routes":false,"expanded_view_ui":true,"default_content_list_view":"expanded","maximum_app_image_size":10000000,"list_scheduled_content":true,"server_settings_toggler":false,"vue_audit_logs_view":false,"vue_documentation_view":false,"vue_mail_settings_view":false,"vue_groups_view":false,"vue_app_settings_runtime":false,"git_enabled":false}

Waaat! The terminal is working fine!? :rofl:

So strange!! Maybe try updating the curl R package? I'm throwing randomness now.

We have the terminal working, so now the trick is to find something within R that works... httr isn't cutting it for some reason...

All of the rsconnect options are here: https://rdrr.io/cran/rsconnect/man/options.html

Maybe it's worth setting options("rsconnect.http" = "curl") to see if we can use the curl system facility (since that's working)? Then try the whole deployment process again (with verbose logging)? Any luck? :see_no_evil:

Same issue as original post; RSConnect says authentication is successful, but no way to proceed further in IDE.

Sad! Is there any logging in the R console while that's happening when you set those http.verbose and http.trace options?

I posted 2 replies with the console output, waiting for moderator to published :slight_smile:

1 Like

Glad to see something different this time, but not sure if it's actually working :thinking:

options(rsconnect.http.verbose = TRUE)
options(rsconnect.http.trace.json = TRUE)
options("rsconnect.http" = "curl")
rsconnect::addConnectServer("http://localhost:5000/rsconnect/", "quickstart")
rsconnect::connectUser("rstudio", "quickstart")
{ [915 bytes data]
* Connection #0 to host localhost left intact
*   Trying ::1...
* TCP_NODELAY set
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 5000 (#0)
> GET /rsconnect/__api__/users/current HTTP/1.1
> Host: localhost:5000
> User-Agent: rsconnect/0.8.15
> Accept: */*
> Date: Fri, 27 Sep 2019 22:24:18 GMT
> X-Auth-Token: Ta34a09b764874c4336b566dff5e9b673
> X-Auth-Signature: nXlgK6BFF5mqW4jXmeL5wRyDbJw0U/txtyiyA/oP++R8cGgRt0UFHRWlIgps2mWecBbtBc+jMcPHrsqooYMb8N/56gPo7yZtEdRl04Jx3ATJPKO1OW9gZXOOD6ockxGUAXOWOz8HGDCRi2a9mFU5G1TXHRQc26A4IT317t3mGqJA8AZYMyO3FL83WNt1tjXcfXFJXe0dHyTC4Ou/fMXnauwEVY2qAj/Z5AXjEVMWtBGUo1k/oVktUBOUlEqn9+i+bLNcDuEbJ/CoQG/NChUDG0ZHrdeq895RsylkNvY+vRj6MXkwXj9tbZWRjO4JQVV8i6DOToMpQUdFL8D6ZSM+/Q==
> X-Content-Checksum: 1B2M2Y8AsgTpgAmY7PhCfg==
> cookie: rscid=MTU2OTYwNTAwOHxEdi1CQkFFQ180SUFBUkFCRUFBQV80TF9nZ0FEQm5OMGNtbHVad3dHQUFSSFZVbEVCbk4wY21sdVp3d21BQ1EwTm1FeFl6VXpNQzFoWm1Ga0xUUmlZalV0T0RneU5DMDNPVE5tTWpkaFpUWTFaRE1HYzNSeWFXNW5EQWtBQjJOeVpXRjBaV1FGYVc1ME5qUUVCZ0Q4dXh5TElBWnpkSEpwYm1jTUNRQUhjbVZtY21WemFBVnBiblEyTkFRR0FQeTdISXNnfMNgh77ypftUrABoI8V8QlTXnMfXIn-noVNIZbXBFg4Z
> 
< HTTP/1.1 500 Internal Server Error
< Server: nginx/1.14.0 (Ubuntu)
< Date: Fri, 27 Sep 2019 17:24:13 GMT
< Content-Type: text/html;charset=utf-8
< Content-Length: 915
< Connection: keep-alive
< X-Content-Type-Options: nosniff
< 
{ [915 bytes data]
* Connection #0 to host localhost left intact
*   Trying ::1...
* TCP_NODELAY set
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 5000 (#0)
> GET /rsconnect/__api__/users/current HTTP/1.1
> Host: localhost:5000
> User-Agent: rsconnect/0.8.15
> Accept: */*
> Date: Fri, 27 Sep 2019 22:24:19 GMT
> X-Auth-Token: Ta34a09b764874c4336b566dff5e9b673
> X-Auth-Signature: XoTKCrK4ozr/mJ2tLkyPYa7BJspdQwf64NQBbfkLfDZSd4tIKJoPyPssRNwRvPlPjfHn0IEpfweuUtIQ0r1wQi5fxhrJ3XdEe5kHf23uajo4PrYYqAiS3hAT2dIXzKxavamkg9kJDz7T1ukjyXdslYI/HuZd2GMkwvk/wH0/374+CIyWqhY9e0rhn7Y/Rm1m0xmiUwar6ga5UMahTz2QSRpETDFXod05Pm1cRkH+DXpdgIHuqMA+Tg8DWBNdTU0EMAIcqdv5Rx6JNKPIeuDkELEJZJn49r7OIofCXWcEsbaAFf7sczt5rA//zT47Lth9qArog9F8LZo6BVFp9W8FWg==
> X-Content-Checksum: 1B2M2Y8AsgTpgAmY7PhCfg==
> cookie: rscid=MTU2OTYwNTAwOHxEdi1CQkFFQ180SUFBUkFCRUFBQV80TF9nZ0FEQm5OMGNtbHVad3dHQUFSSFZVbEVCbk4wY21sdVp3d21BQ1EwTm1FeFl6VXpNQzFoWm1Ga0xUUmlZalV0T0RneU5DMDNPVE5tTWpkaFpUWTFaRE1HYzNSeWFXNW5EQWtBQjJOeVpXRjBaV1FGYVc1ME5qUUVCZ0Q4dXh5TElBWnpkSEpwYm1jTUNRQUhjbVZtY21WemFBVnBiblEyTkFRR0FQeTdISXNnfMNgh77ypftUrABoI8V8QlTXnMfXIn-noVNIZbXBFg4Z
> 
< HTTP/1.1 500 Internal Server Error
< Server: nginx/1.14.0 (Ubuntu)
< Date: Fri, 27 Sep 2019 17:24:15 GMT
< Content-Type: text/html;charset=utf-8
< Content-Length: 915
< Connection: keep-alive
< X-Content-Type-Options: nosniff
< 
{ [915 bytes data]
* Connection #0 to host localhost left intact

This is what's in console...repeatedly.

*   Trying ::1...
* TCP_NODELAY set
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 5000 (#0)
> GET /rsconnect/__api__/users/current HTTP/1.1
> Host: localhost:5000
> User-Agent: rsconnect/0.8.15
> Accept: */*
> Date: Fri, 27 Sep 2019 22:30:02 GMT
> X-Auth-Token: Tfc48ee09d0f2d5cfe75c16a0ebd47b22
> X-Auth-Signature: AkYHqf5dP7S8rv45iyoZoLtsnamnSPdlxmYnOtUbsjF+z+7uNaEUWnaGBbOfm9GFJVdhsBz8oiYbwjVhGv8h930DAQmy91mu88qM7nYLmqAWpdQDwmc72KomGnLJ5Huxk1YEoy1qgxibGyI98Hc2KgAGUgIp90NLFADIq2wFJyj36arSszJJezGfza8992VvRSGPZB6teoP806yUEJGXC+zFPOiO1UJC3YEy3myWi16Q9nlL9/NVwtby9zTFQ5rn2ah5DOlAYRtvKgMt3WaMUsdvLS39RjYSnuFGQkY7TsvUe6eiP2wJ+C6cU4c0OcnlsBkb2zj23j+gw8ERQtCylQ==
> X-Content-Checksum: 1B2M2Y8AsgTpgAmY7PhCfg==
> cookie: rscid=MTU2OTYwNTAwOHxEdi1CQkFFQ180SUFBUkFCRUFBQV80TF9nZ0FEQm5OMGNtbHVad3dHQUFSSFZVbEVCbk4wY21sdVp3d21BQ1EwTm1FeFl6VXpNQzFoWm1Ga0xUUmlZalV0T0RneU5DMDNPVE5tTWpkaFpUWTFaRE1HYzNSeWFXNW5EQWtBQjJOeVpXRjBaV1FGYVc1ME5qUUVCZ0Q4dXh5TElBWnpkSEpwYm1jTUNRQUhjbVZtY21WemFBVnBiblEyTkFRR0FQeTdISXNnfMNgh77ypftUrABoI8V8QlTXnMfXIn-noVNIZbXBFg4Z
> 
< HTTP/1.1 500 Internal Server Error
< Server: nginx/1.14.0 (Ubuntu)
< Date: Fri, 27 Sep 2019 17:29:57 GMT
< Content-Type: text/html;charset=utf-8
< Content-Length: 825
< Connection: keep-alive
< X-Content-Type-Options: nosniff
< 
{ [825 bytes data]
* Connection #0 to host localhost left intact
*   Trying ::1...
* TCP_NODELAY set
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 5000 (#0)
> GET /rsconnect/__api__/users/current HTTP/1.1
> Host: localhost:5000
> User-Agent: rsconnect/0.8.15
> Accept: */*
> Date: Fri, 27 Sep 2019 22:30:03 GMT
> X-Auth-Token: Tfc48ee09d0f2d5cfe75c16a0ebd47b22
> X-Auth-Signature: nDnHkNmUrZLyygD6AmMshp4V9kEknlacLYY9zbIfhXScFcXP6oMo4i9T7+nAeAdoMBgi76CNNcKuGJoyzz2z6F7BEdYeBAQCzHzdlNlBY0jvk9qSxayl090p3xVk4b05QxfN6BzHBkBOnac/nnPdVxuvUH/B2Gw7pRtWK8/mTSJymmd8jXuqa0fViiReNMWRk4zSO8C4k592YxhkdzMMRQy44JhWsITCO6BEzw81Q+pJMRcvNUIV1az5gZ19/ufOkHmtlNSRSTDS125tPGGMZYDH/Iatkc1spOHz5CGzHNuvY8umrPdjozfGVAqc7yVu0ZnUOVC26bUOcU/lS4kZsg==
> X-Content-Checksum: 1B2M2Y8AsgTpgAmY7PhCfg==
> cookie: rscid=MTU2OTYwNTAwOHxEdi1CQkFFQ180SUFBUkFCRUFBQV80TF9nZ0FEQm5OMGNtbHVad3dHQUFSSFZVbEVCbk4wY21sdVp3d21BQ1EwTm1FeFl6VXpNQzFoWm1Ga0xUUmlZalV0T0RneU5DMDNPVE5tTWpkaFpUWTFaRE1HYzNSeWFXNW5EQWtBQjJOeVpXRjBaV1FGYVc1ME5qUUVCZ0Q4dXh5TElBWnpkSEpwYm1jTUNRQUhjbVZtY21WemFBVnBiblEyTkFRR0FQeTdISXNnfMNgh77ypftUrABoI8V8QlTXnMfXIn-noVNIZbXBFg4Z
> 

Woohoo!! That's good! That's what we want!

What's happening: the R process is polling to see if the token has been "activated" or "verified" by Connect yet. As soon as you activate in the browser, that 500 should turn into a 200 (on its next poll) and all should be well with the world!

You do have to keep that polling running while you activate in the browser though. Is that workflow working? Do you keep getting 500s after activating in the browser? Or do the responses change?

It stays at HTTP/1.1 500 Internal Server Error, even after authentication is successful.