[Solved] Accessing Error log in shiny-server deployed on AWS instance

I have a shiny app that runs fine on my local machine in RStudio. I have launched an AWS EC2 Ubuntu instance and installed R and shiny-server on it. When I access the app via browser, the app crashes at a (seemingly) arbitrary point.

Where can I access the R console log in order to be able to debug the code? There is no file in /var/log/shiny-server. Furthermore, the console in the browser simply states:

The application unexpectedly exited.

Diagnostic information is private. Please ask your system admin for permission if you need to check the R logs.

I have tried working with options(shiny.sanitize.errors = FALSE) to no avail.

Solution #1:

I found the solution. One hast to add sanitize_errors false; to the shiny-server.conf and then restart shiny-server. Then the error log is displayed in the browsers console.

Respondent: Fabian Haribo
Solution #2:

To see logs:

Add the following line to your ui.R | server.R | app.R

options(shiny.sanitize.errors = FALSE)

Edit your shiny server .conf file:

sudo nano /etc/shiny-server/shiny-server.conf

add this line after “run_as” (don’t forget “;” at the end)

preserve_logs true;

Note 1: You may need to add this preserve_log to force shiny server to save logs to files.
(Remember to delete this setting after your debugging session. Shiny will start to create logs even for succesful app sessions and this can generate LOTS of log files)

Go to your log path:

$ cd /var/log/shiny-server/

Check the logs and see what’s going on

$ nano appName-shinyuser-yyyymmdd-hhmmss-41509.log

In my case, the problem was just a missing package.

Respondent: Luis Martins
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Most Popular

To Top
India and Pakistan’s steroid-soaked rhetoric over Kashmir will come back to haunt them both clenbuterol australia bossier man pleads guilty for leadership role in anabolic steriod distribution conspiracy