Debugging container did not respond in time

I’ve been using ShinyProxy for about a year now, but my latest code deployment resulted in a “Container did not responde in time” error.

  1. The container runs with:
    sudo docker run -p 3838:3838 openanalytics/shinyproxy-demo R -e ‘shiny::run_01_hello()’
  2. The container does not run with (this is from
    sudo docker run -p 3838:3838 openanalytics/shinyproxy-demo R -e ‘shinyproxy::run_01_hello()’
    The error message is:
    Error in loadNamespace(name) : there is no package called ‘shinyproxy’
  3. There are no container logs for the failed container response.

Here is:
a) The Shinyproxy error log
b) The docker build log
c) My Dockerfile

I’m running Shinyproxy 2.3.0 behind Nginx on Ubuntu 18.04 on GCP. I have many smaller apps working fine and lots of container logs for them (so I think my configuration is correct). I suspect that, even though the docker build log shows no errors, some of the more exotic (GIS-related) Ubuntu packages are causing the problem.

Could anyone help point me in the right direction?

Additionally, what is the discrepancy between the Dockerfile standard ‘shiny::run_01_hello()’ and the troubleshooting standard ‘shinyproxy::run_01_hello()’?

It is a bit unclear what exactly didn’t work - running example image

or running your own image utiligize/asset_management (for which you attached logs)?

I’ll assume you are concerned about your package/image:
Does it run if started not inside shinyproxy, but with sudo docker run -p 3838:3838 utiligize/asset_management in the console? If not, which error do you see? If this works, but running within shinyproxy doesn’t, then one thing to check is whether the timeout is reached, which can happen if the application takes a long time to start - you can try to increase container-wait-time setting in this case.
Hope this helps.

Finally, regarding

I don’t think there is any discrepancy, maybe some confusion: the shiny::run_01_hello() runs run_01_hello function from the shiny R package, while the shinyproxy::run_01_hello() runs run_01_hello function from the demo shinyproxy R package (arguably named somewhat confusingly) that is installed in the openanalytics/shinyproxy-demo Docker image (and actually starts the same app, but this is not relevant). I believe the first option shiny::run_01_hello() is never actually mentioned in the shinyproxy website.

yes, running with utiligize/asset_management - I was just trying to state the concept, without referring to my organisation and app.

Then the app runs fine when running this command from the terminal.

I have set this to container-wait-time: 200000

It’s listed in the Dockerfile settings here: Is that because shinyproxy internally calls shiny?

Ok, I got it working, but I’m not sure why. In my application.yml file, why does this work:

  display-name: my_app_1
  container-cmd: ["R", "-e", "shiny::runApp('/root/app')"]
  container-image: utiligize/asset_management
  access-groups: developers

but not this?:

  display-name: my_app_2
  container-cmd: ["R", "-e", "shinyproxy::runApp('/root/app')"]
  container-image: utiligize/asset_management
  access-groups: developers

The shinyproxy demos using "shinyproxy::run_01_hello() work fine.

Good to hear that you got it working!

The explanation is simple: there is no function runApp in the R package shinyproxy (which is just a demo package with 2 simple functions, you can see its source at In addition there is no shinyproxy R package inside your Docker image…

What we try to advocate in general is the use of R packages for shiny apps, which has a number of benefits. In this approach, it is convenient to create a function in the package to launch the application, and this is illustrated with shinyproxy::run_01_hello.

However this is not an obligatory way, and using ‘traditional’ approach will also work just fine with ShinyProxy. In this case you don’t have any special function, so would just call shiny::runApp on your app folder.