Nullpointerexception on container creation

I created a docker image successfully, and when I do

docker run -p 3838:3838 celsiuspro/ems R -e 'shiny::runApp("/opt/ems")'

the shiny app works as expected.

This is my application.yml

shiny:    
  apps:
    - name: ems
      display-name: EMS
      docker-cmd: ["R", "-e shiny::runApp('/opt/ems')"]
      docker-image: celsiuspro/ems
      groups: scientists

When I run shinyproxy, however, I get this:

2017-10-31 17:42:47.713 WARN 43420 — [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘shinyProxyApplication’: Unsatisfied dependency expressed through field ‘dockerService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘dockerService’: Unsatisfied dependency expressed through field ‘dockerClient’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘getDockerClient’ defined in class path resource [eu/openanalytics/services/DockerService.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.spotify.docker.client.DockerClient]: Circular reference involving containing bean ‘dockerService’ - consider declaring the factory method as static for independence from its containing instance. Factory method ‘getDockerClient’ threw exception; nested exception is java.lang.NullPointerException

Plus a whole bunch of spring goodness, ending with

Caused by: java.lang.NullPointerException: null
at sun.nio.fs.UnixPath.normalizeAndCheck(UnixPath.java:77) ~[na:1.8.0_144]
at sun.nio.fs.UnixPath.(UnixPath.java:71) ~[na:1.8.0_144]
at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281) ~[na:1.8.0_144]
at java.nio.file.Paths.get(Paths.java:84) ~[na:1.8.0_144]
at eu.openanalytics.services.DockerService.getDockerClient(DockerService.java:175) ~[classes!/:1.0.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_144]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_144]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_144]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_144]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)

What am I missing? :slight_smile:

Hi @mredaelli,

This error means that the cert-path property is missing from the application.yml:

shiny:
  proxy:
    docker:
      cert-path: /home/none 

Even if you have no certificates, the property must be specified, pointing to an empty or nonexisting value.
We’ll get rid of this in the next update, so that the property can be omitted if no certificates are being used.

By the way, is that your full application.yml? There are more mandatory properties, such as shiny.proxy.authentication and shiny.proxy.docker.url.

Regards,
Frederick

Hi @mredaelli, thanks for reporting. The fix @fmichielssen mentioned has been released as part of ShinyProxy 1.0.2, see https://www.shinyproxy.io/downloads/