Shiny apps fail in Microsoft Edge with status 400

shiny

#1

All my self-hosted Shiny apps are failing with 400 status code when accessed by Microsoft Edge browser. There is nothing being reported in /var/logs/shiny-server.log or /var/logs/shiny-server/<app>.log. I'm running the apps on vanilla Shiny Server on Ubuntu 16.04 with Apache2. Grateful for suggestions.

This SO question shows I'm not the only one with this issue - https://stackoverflow.com/questions/46860927/shiny-app-does-not-work-on-microsoft-edge-browser

Worth noting that apps server by shinyapps.io work without a problem in my Edge.


#3

Just two weeks ago we did several full test passes with Edge, including with Shiny Server. What version of Shiny Server are you using, and do even simple apps fail?


#4

Thanks Joe. shiny-server.log reports Shiny Server v1.5.6.875 (Node.js v6.10.3).

Yes even the default Shiny Server homepage fails. When you call it in Edge the app initially loads (the It's Alive histogram), but then greys out as it hits the 400 error status.

If you've fully tested Edge I guess it could possibly be my organisation's sysadmins have implemented restrictive Edge settings. I'll follow up on this. But that still wouldn't explain why shinyapps.io apps do work in Edge.


#5

It's likely something with websockets? Try adding the line disable_websockets; to your /etc/shiny-server/shiny-server.conf, then systemctl restart shiny-server.


#6

Interesting. I still crash, but console no longer reports a 400 code. This is the readout:


#7

Hmmm, very mysterious.

What version of Edge? I'm on Microsoft Edge 41.16299.402.0 and Microsoft EdgeHTML 16.16299 (and it's working fine here).

Can you also try adding preserve_logs true; to your /etc/shiny-server/shiny-server.conf, then systemctl restart shiny-server? That will ensure log files don't get deleted from /var/log/shiny-server/ until you delete them (normally they're deleted if we don't think anything went wrong, but we're currently bad at telling if anything went wrong.)


#8

Another thought--for testing purposes, would it be possible for you to temporarily bypass the Apache2 layer and have your Edge request the app straight from Shiny Server? Whether it succeeds or fails, that would eliminate a huge variable.


#9

Good idea. Calling https://mydomain:3838 fails with "Network Error" ("Hmmm, we can't reach this page."). But this could be because my organisation has blocked ports other than 80/443.

Edge version is 38.xxx. I'll have to look into getting that upgraded. I'll also test your preserve logs idea. Thanks again.


#10

I have the exact same issue on Microsoft Edge 42.17134.1.0. I get the same results as @geotheory after disabling websockets in Shiny Server. Shiny Server is version 1.5.6.875, running on Ubuntu alongside Apache using a proxy. There are no issues on IE 11 or Chrome. Interestingly, Edge has no issues with apps on another Shiny server, but hosted on AWS and without the proxy.


#11

Update: For me, the issue was that the rewrite rules for some reason was outside my <VirtualHost></VirtualHost>. This did not affect Chrome or IE, but Edge gave a 400. The following rules work on Edge on Shiny server 1.5.6.875.

<Proxy *>
   Allow from localhost
</Proxy>

RewriteEngine on
RewriteRule ^/shiny$ /shiny/ [R]
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /shiny/(.*) ws://localhost:3838/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteRule /shiny/(.*) http://localhost:3838/$1 [P,L]

ProxyPreserveHost On
ProxyPass /shiny/ http://localhost:3838/
ProxyPassReverse /shiny/ http://localhost:3838/

#12

Just to report my company just upgraded Edge slightly (still 38.xx) and suddenly my Shiny apps seem to work ok. No idea why.