Shiny v1.3 known regressions and serious issues

This thread tracks significant issues discovered since Shiny 1.3.0's release to CRAN. We will update this thread as new issues are discovered or existing issues are resolved.

Update (April 26th, 2019): Upgrading to shiny v1.3.2 fixes all known regressions and issues introduced by v1.3.0, except for the following:

1. Apps not loading correctly behind NGINX proxies #2372

See the detailed post below.

Current resolution: Fix your NGINX config according to the instructions given in the post, or by upgrading to httpuv's GitHub master version (remotes::install_github("rstudio/httpuv")). The next regularly scheduled CRAN release of httpuv will solve this issue.

2. Shiny no longer serves static file assets under www/shared

Current resolution: Rename the www/shared directory to something else under www/ (e.g., www/lib). Also, any files that link to this directory will have to be renamed accordingly.

12 Likes

Apps not loading correctly behind NGINX proxy

Background

We've had a number of reports of users upgrading to Shiny v1.3.0 and finding that their apps work fine locally, but not on Shiny Server (and presumably RStudio Server and RStudio Connect) when running behind an NGINX proxy. The HTML loads, but none of the styles are applied and none of the calculations run.

Thank you to all of you who reported this, especially @rogerjbos, who graciously spent part of his day screensharing with our engineers.

The cause

We've identified the cause as a subtle and common misconfiguration of NGINX, specifically a line like this:

proxy_set_header Connection "upgrade";

This directive causes NGINX to add a Connection: upgrade header to every HTTP request, when it's only supposed to be used for WebSockets.

This line is recommended by NGINX Inc. themselves, here and here; however, those recommendations are intended for proxying of traffic that is exclusively WebSockets, whereas Shiny traffic is a combination of normal HTTP requests and WebSockets. Older versions of shiny/httpuv didn't mind this situation, but the new versions are stricter.

Fixing your proxy configuration

To fix the issue in your NGINX configuration, use the following articles as guides:

All of these articles use NGINX directives that are appropriate for both normal HTTP requests and WebSockets. First, a map directive is used to dynamically set a $connection_upgrade variable:

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

Then, that variable is used to set the Connection header.

proxy_set_header Connection $connection_upgrade;

Future steps

Because this is such a common configuration for NGINX, and we know that not all Shiny users own the proxies that their apps run behind, the next version of httpuv will relax its interpretation of the Connection header. You can install the GitHub version of httpuv today with remotes::install_github("rstudio/httpuv"), or wait for the CRAN release of httpuv 1.5.2, which we hope to submit in the next couple of weeks.

9 Likes