Search code examples
rdockercentossupervisordshiny-server

docker with shiny server pro issues


I have created two dockers with shiny server on centos:

  • Docker with shiny server - free edition here
  • Docker with shiny server pro (using a temporary license) here

These dockers are on centos, as it is assumed eventually will run on RHEL as a supported version of Linux (maybe dockerised or native). For the time being they offer a convenient way for testing and development.

They are mainly designed for development: they include R, RStudio Server and Shiny Server: probably not what a Docker purist would do or recommend (probably a production version will be based on docker compose).

The problem I have is that while the Docker with shiny server - free edition works fine, the Docker with shiny server pro does not work (maybe an issue with supervisord?).

2015-09-19 12:40:10,379 CRIT Supervisor running as root (no user in config file)
2015-09-19 12:40:10,385 INFO supervisord started with pid 1
2015-09-19 12:40:10,387 INFO spawned: 'shinyserver' with pid 8
2015-09-19 12:40:10,388 INFO spawned: 'rserver' with pid 9
2015-09-19 12:40:10,404 INFO success: rserver entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2015-09-19 12:40:10,405 INFO exited: rserver (exit status 0; expected)
2015-09-19 12:40:10,405 INFO received SIGCLD indicating a child quit
2015-09-19 12:40:10,955 INFO exited: shinyserver (exit status 8; not expected)
2015-09-19 12:40:10,955 INFO received SIGCLD indicating a child quit
2015-09-19 12:40:11,959 INFO spawned: 'shinyserver' with pid 31
2015-09-19 12:40:12,236 INFO exited: shinyserver (exit status 8; not expected)
2015-09-19 12:40:12,236 INFO received SIGCLD indicating a child quit
2015-09-19 12:40:14,243 INFO spawned: 'shinyserver' with pid 37
2015-09-19 12:40:14,520 INFO exited: shinyserver (exit status 8; not expected)
2015-09-19 12:40:14,521 INFO received SIGCLD indicating a child quit
2015-09-19 12:40:17,533 INFO spawned: 'shinyserver' with pid 43
2015-09-19 12:40:17,807 INFO exited: shinyserver (exit status 8; not expected)
2015-09-19 12:40:17,808 INFO received SIGCLD indicating a child quit
2015-09-19 12:40:18,811 INFO gave up: shinyserver entered FATAL state, too many start retries too quickly
2015-09-19 12:40:43,272 CRIT received SIGTERM indicating exit request

This is quite surprising as the code base is common (of course). Maybe an issue on how the processes are spawn?

It would be great if somebody would help me to find the bug in the shiny server pro config.


Solution

  • I've managed to resolve the issue. As expected it was a bad config of supervisord.conf.

    Shiny server needs to starts as root and I wrongly had user=shiny instead of user=root. I am surprised that this didn't generate an error in the free edition.

    Here for posterity the supervisor config that made it work:

    [supervisord]
    nodaemon=true
    logfile=/var/log/supervisor/supervisord.log
    pidfile = /tmp/supervisord.pid
    
    [program:rserver]
    user=root
    command=/usr/lib/rstudio-server/bin/rserver
    stdout_logfile=/var/log/supervisor/%(program_name)s.log
    stderr_logfile=/var/log/supervisor/%(program_name)s.log
    startsecs=0
    autorestart=false
    exitcodes=0
    
    [program:shinyserver]
    user=root
    startsecs = 0
    command=/bin/bash -c "exec shiny-server >> /var/log/shiny-server.log 2>&1"
    stdout_logfile=/var/log/supervisor/%(program_name)s.log
    stderr_logfile=/var/log/supervisor/%(program_name)s.log
    autorestart=false
    redirect_stderr=true
    

    The dockerfile etc. are available on my github page smartinsightsfromdata