1

I am currently hosting a number of shiny apps on a shiny-server open source on a centos7 distro. All the apps were/are working fine but for one of the apps when I try to go to the url I get the following message:

This page isn't working <ip.address> did not receive any data. ERR_EMPTY_RESPONSE.

All the other shiny apps hosted on the same shiny server are working just fine. I checked /var/log/shiny-server and there is no log file for this App. As the other apps are working fine, I dont think its a port issue.

The only difference between other apps and this one is that it was used the most by its users. Is there some restriction/limit on shiny-server for runtime? I can't figure out what the problem is. The app runs fine on RStudio Server and if I copy it into a new directory in /srv/shiny-server/ with a different name, it also works fine.

zimia
  • 930
  • 3
  • 16

1 Answers1

1

A couple of thoughts:

  • If a process closes successfully, then shiny deletes the log files. So it's possible you may be missing some log files. You may override this with preserve_logs, see here. Your users may be triggering some error through their interactions with the app, but other sessions are successful, so shiny deletes the log files.
  • Shiny creates one process per app be default, but an unlimited number of session (see here). This means that if your app is the one that is used the most by users, each user is generating a new session. And if the app is computationally intensive, then some of the user sessions may be getting backlogged which might trigger the ERR_EMPTY_RESPONSE. You can fix this by using Docker to spin up a process for each user. Here are some options, I've found shinyproxy to be the most intuitive.
Jeff Parker
  • 1,809
  • 1
  • 18
  • 28
  • Hi thanks for the info. I will sort out the log file. I am aware of the fact that the app is single threaded but it is not computationally expensive so i doubt backlog is an issue. It wouldnt benefit from async via promise either. Unfortunately due to company policies I cant touch docker. It would have been my preferred option in the first place. However i do wonder if a user crashed the tool somehow and got disconnected, would that cause a backlog? I dont think so but i am guessing. – zimia Sep 10 '21 at 21:01
  • Even if it's not computationally intensive, too many users could overwhelm you box (as you suspect). If the error message is correlated with many users, then you have your answer, and you can look for solutions (Docker, RStudio Connect is another, bigger box, multi-thread). If you really need confirmation, you might look at the stats on your box and see if the CPU or something spikes when users start seeing the ERR_EMPTY_RESPONSE message. R Code won't fix your issues if this is the case. – Jeff Parker Sep 13 '21 at 22:37
  • Hi thanks once again. the preserve_logs did help! Quite stupidly and embarassingly i left an infinite loop inside the code! – zimia Sep 14 '21 at 12:57
  • No need for the self-deprecation! Stuff like that happens and that's why there are logs and debugging tools. I guess that's coding. Please accept the answer if works for you. – Jeff Parker Sep 15 '21 at 18:19