Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shiny App unable to start on shiny server

I want to deploy a Shiny app on the Shiny server but not able to access the app from the local server URL.

enter image description here

This is the output of /var/log/shiny-server.log:

[2016-04-11 21:39:24.302] [INFO] shiny-server - Starting listener on 0.0.0.0:3838
[2016-04-11 21:42:29.564] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.
[2016-04-11 21:42:29.570] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.
[2016-04-11 21:43:15.156] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.
[2016-04-11 21:43:15.163] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.
[2016-04-11 21:43:28.593] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.
[2016-04-11 21:43:28.604] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.
[2016-04-11 21:43:54.549] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.
[2016-04-11 21:51:52.528] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.
[2016-04-11 21:52:20.004] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.
[2016-04-11 21:52:20.020] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.
[2016-04-11 21:52:26.843] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.
[2016-04-11 21:56:10.938] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.
[2016-04-11 21:56:10.946] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.

What is the problem?

like image 435
Megh Vidani Avatar asked Apr 11 '16 16:04

Megh Vidani


People also ask

Why does my app work locally but not on my Shiny server?

Your application may be dependent on packages that are installed and loaded in your environment, but aren't installed for the correct user on the Shiny Server. Make sure that all necessary packages are installed for the same user set under run_as in your Shiny Server configuration file.

Why does Shiny app disconnect from server?

The "Disconnected from Server" error is a generic message that means that the R session has shut down for some reason. This could happen for a multitude of reasons, ranging from missing objects, to data that takes too long to load, to the use of forbidden packages, to hitting the application timeout settings.


3 Answers

I have run into this situation before when my R code was failing. Since I write my R code on a windows machine and run my shiny server on ubuntu, some packages work fine in on windows but fail in ubuntu or if I forget to install the package on the ubuntu machine. To find out when that's happening you have to go to the apps log not the servers log.

There should be a log specific to your app in:

\var\log\shiny-server\YourAppName-20191112-170851-44977.log

The numbers after App Name have to do with the timestamp of when the app tried to run. This log file will contain the R output if there are any errors with specific packages or your R code causing the app to fail.

like image 156
Nick Avatar answered Oct 10 '22 03:10

Nick


Maybe you can have a look here.
I would focus on this error

[2016-04-11 21:39:24.302] [INFO] shiny-server - Starting listener on 0.0.0.0:3838

On the provided link you'll find that a couple of user double checked permissions: on port 3838 and on the shiny server.

Furthermore I recommend to have a look at this guide.
I was able to run my shiny app on an Ubuntu RStudio server by following it.

like image 22
Alessio Avatar answered Oct 10 '22 03:10

Alessio


I ran into this problem and all of my logs were empty / unopenable. After much banging my head against the wall I was able to fix this by changing the shiny user in the conf file (/etc/shiny-server/shiny-server.conf).

I changed "run_as shiny;" to "run_as :HOME_USER: shiny;".

Also, this:

https://docs.rstudio.com/shiny-server/

was more helpful than anything I could find on stackoverflow, github, or google groups.

like image 34
user3055034 Avatar answered Oct 10 '22 03:10

user3055034