disconnected from server

Since January 2018 I have had a shiny-server running on an Ubuntu 16.04 'droplet' on Digital Ocean. Generally, modulo the occasional glitch things have worked fine (thanks to Dean Attali's thorough instructions for installation of the shiny server). Yesterday I began to get the dreaded 'failed to initialize error' with all my apps. I examined the server logs for the apps and discovered that a variety of packages were not loading because they had been installed under a 'previous version of R'. I reinstalled all these and shiny itself. Now the apps begin to load but after 1-2 seconds they are disconnected from the server. No logs are created in var/log/shiny-server for me to examine. Is there somewhere else to look nfor information about what is causing the apps to disconnect or, better, a likely known explanation for this behavior?

Hi rcgayle,

I think you could edit your server config file (see /etc/shiny-server/shiny-server.conf) so that logs are kept. You will need to add preserve_logs true; at the top of your file:

# Instruct Shiny Server to run applications as the user "shiny"
run_as username;
# run_as ubuntu;
preserve_logs true;
# Define a server that listens on port 3838
server {
  listen 3838;
  # 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;

    # 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 off;

Then stop and start the server or restart depending on its current state. Logs should be preserved in the /var/log/shiny-server directory.

Let me know how it goes!

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.