Preloaded Shiny Server Apps work fine however own apps failing to start?

shiny-server

#1

Working on deploying a Shiny App on my own domain through a Digital Ocean using Ubuntu.

After completing all the installation procedures I can access the :3838 port fine and that is displaying the welcome to shiny server page just fine, as well as the :3838/sample-apps/hello page also working as planned however when i try and bring up my own app that has been loaded onto the server I get an error warning saying that the "The application failed to start." and that "The application exited during initialization."

When I look a little deeper into the logs it brings up the following however I have yet to be able to find a solution.

Warning in readLines(file, warn = FALSE) : cannot open file '/srv/shiny-server/ESapp/global.R': Permission denied Error in readLines(file, warn = FALSE) : cannot open the connection Calls: runApp -> -> sourceUTF8 -> readUTF8 -> readLines Execution halted

Any advice would be much appreciated.

Link to Q StackOverflow


#2

When you see Permission denied, that should be an immediate indicator that file permissions are not setup as you need them to be. Shiny Server runs as a configured user on the system (usually shiny). That user needs to have read (and sometimes execute) privileges on the files in question.

The rest of the error message usually gives you a little bit more context. As we can see:

It looks like file privileges on global.R make the file not accessible to the user running processes on Shiny Server. Again, this will depend on your configuration, but it is the shiny user by default, I believe.

If you want to do more in-depth testing, you can assume the role of the user in question (i.e. sudo su shiny) and then try to execute the app / read the files / etc. Resolving the issue will just be a matter of setting the UNIX file permissions so that the files are readable (or writable / executable as the case may be).

A simple tutorial on UNIX file permissions