Shiny App Greys Out in RStudio Cloud: Error during WebSocket handshake

I created an rstudio cloud project that can be used to run shiny apps (e.g. for teaching). While it worked fairly well initially, now the shiny app greys out when shown in an external browser. There is no error message in the R console, but the Javascript console shows an error like:

shinyapp.js:83 WebSocket connection to 'wss://' failed:
Error during WebSocket handshake: Unexpected response code: 500

The error arises both under Chrome and Firefox. Initially the error did not arise with R 3.4.4, only under R 3.5. But now I get consistently that problem.

Here is an example project to replicate the problem:

To start my (RTutor) shiny app, one can simply type:


The project also contains a very simple shiny app called SimpleTestApp that was created by File -> New File -> Shiny Web App. When I open the cloud project and start running SimpleTestApp in an external browser tab, it initially works. Yet, if I then run the RTutor app and afterwards try again running SimpleTestApp, then SimpleTestApp also greys out, with the WebSocket handshake error in the javascript console.

On my local R installation, I never encountered this problem. The RTutor app and my other shiny apps work fine, without Websocket errors.

There is some thinking that there are some issues in httpuv and the RStudio IDE at play here.
I am trying to get to the bottom of what combination is expected to work.

We merged a fix into httpuv. @skranz can you please try it out? To install it:


For reference, here is the issue we filed on httpuv:

And here is the pull request:

1 Like

Great, thanks a lot for that fast fix.

After updating httpuv, it worked directly with Firefox. However, I still got a grey screen and WebSocket error under Chrome. Yet, after restarting my computer and restarting the R session on, it also worked for Chrome.

I didn't run a long test series, yet. So I cannot rule out, that it works only with some probability as described in your Github issue. I will let you know if the WebSocket error returns sporadically.

Had the same issue. Works great now! Thanks

FYI @wch I did just notice the following warning after closing the app. This was the latest version of radiant from: install.packages("radiant", repos = "")

Listening on
Failed to create bus connection: No such file or directory
Warning in system("timedatectl", intern = TRUE) :
  running command 'timedatectl' had status 1

Stopped Radiant. State information is available in the r_state and r_info lists and the r_data environment. Use attach(r_data) to access data loaded into Radiant.

Project id: