16

I have an application that works on a local R server (port 8787). When I move it to Shiny Server (port 3838), I receive the message

ERROR: An error has occurred. Check your logs or contact the app author for clarification.

And there is no log file present in /var/log/shiny-server.log

This is my configuration file:

# Instruct Shiny Server to run applications as local user
run_as : HOME_USER:;

# Define a server that listens on port 3838
server {
  listen 3838;

#preserve_logs true;
  # Define a location at the base URL
 location / {

# Host the directory of Shiny Apps stored in this directory
site_dir /srv/shiny-server;

# Log all Shiny output to files in this directory
log_dir /var/log/shiny-server;
preserve_logs true;
# When a user visits the base URL rather than a particular application,
# an index of the applications available in this directory will be shown.
directory_index on;
 }
} 

Could someone check my configuration file? Thank you

A. Ganady
  • 347
  • 1
  • 3
  • 15

3 Answers3

16

Apparently sanitize error messages is true by default for my configuration. Add
options(shiny.sanitize.errors = FALSE) to your app.

In the configuration file, place

sanitize_errors false;
preserve_logs true;

within server to resolve permanently.

Dawny33
  • 10,543
  • 21
  • 82
  • 134
A. Ganady
  • 347
  • 1
  • 3
  • 15
3

Shiny also dumps errors and messages on the Console. You can access it by pressing Ctrl + Shift + J in your chrome or Opera browser.

enter image description here

M.Qasim
  • 1,827
  • 4
  • 33
  • 58
0

I had the same problem. In my server.R I was using another R file: once I renamed it to "global.R" everything worked.

I started getting meaningful logs about missing packages. The packages need to be installed using install.package("x", lib = "/usr/local/lib/R/site-library").
Make sure that the "shiny" user or whatever user you have specified in /etc/shiny-server/shiny-server.conf has access to /usr/local/lib/R/site-library.

Nipun
  • 2,217
  • 5
  • 23
  • 38
ori06
  • 31
  • 4