Failed to start container -- Exception handling request to /app/01_hello


#1

I’m trying to run the containerized ShinyProxy with a docker engine example. I am able to log in as a user but neither of the apps will run: Specificaly I get this error:

2018-11-27 11:54:11.375  INFO 1 --- [  XNIO-2 task-5] e.o.containerproxy.service.UserService   : User logged in [user: jack]
2018-11-27 11:54:15.483  INFO 1 --- [sync-executor-0] o.apache.http.impl.execchain.RetryExec   : I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: Connection refused
2018-11-27 11:54:15.485  INFO 1 --- [sync-executor-0] o.apache.http.impl.execchain.RetryExec   : Retrying request to {}->unix://localhost:80
2018-11-27 11:54:15.489  INFO 1 --- [sync-executor-0] o.apache.http.impl.execchain.RetryExec   : I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: Connection refused
2018-11-27 11:54:15.491  INFO 1 --- [sync-executor-0] o.apache.http.impl.execchain.RetryExec   : Retrying request to {}->unix://localhost:80
2018-11-27 11:54:15.493  INFO 1 --- [sync-executor-0] o.apache.http.impl.execchain.RetryExec   : I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: Connection refused
2018-11-27 11:54:15.497  INFO 1 --- [sync-executor-0] o.apache.http.impl.execchain.RetryExec   : Retrying request to {}->unix://localhost:80
2018-11-27 11:54:15.527 ERROR 1 --- [ XNIO-2 task-10] io.undertow.request                      : UT005023: Exception handling request to /app/01_hello

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is eu.openanalytics.containerproxy.ContainerProxyException: Failed to start container
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:986) ~[spring-webmvc-5.0.4.RELEASE.jar!/:5.0.4.RELEASE]
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:881) ~[spring-webmvc-5.0.4.RELEASE.jar!/:5.0.4.RELEASE]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) ~[javax.servlet-api-3.1.0.jar!/:3.1.0]
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:855) ~[spring-webmvc-5.0.4.RELEASE.jar!/:5.0.4.RELEASE]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javax.servlet-api-3.1.0.jar!/:3.1.0]
        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) ~[undertow-servlet-1.4.22.Final.jar!/:1.4.22.Final]
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) ~[undertow-servlet-1.4.22.Final.jar!/:1.4.22.Final]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320) ~[spring-security-web-5.0.3.RELEASE.jar!/:5.0.3.RELEASE]
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) ~[spring-security-web-5.0.3.RELEASE.jar!/:5.0.3.RELEASE]

I am able to start a container for the image openanalytics/shinyproxy-demo and have the app running via the command

$ docker run -it --rm -p 3838:3838 openanalytics/shinyproxy-demo

Any help would be appreciated! :slightly_smiling_face:

P.S: Running Docker Toolbox on Windows 8


#2

Hi @Jonas_Hall,

To run this example on Docker for Windows, two changes are needed:

  1. The docker socket (/var/run/docker.sock) doesn’t exist on Windows, so this volume bind won’t work: -v /var/run/docker.sock:/var/run/docker.sock and should be omitted from the docker run command.

  2. Instead of using the docker socket, you can use the HTTP port of the Docker service. This must be enabled in the Docker for Windows General settings: “Expose daemon on tcp://localhost:2375 without TLS”.

Configure it into your application.yml before building the docker image:

proxy:
  docker:
    url: http://host.docker.internal:2375
    internal-networking: true

Using the special host.docker.internal DNS name, because the docker0 adapter also doesn’t exist on Docker Windows (https://docs.docker.com/docker-for-windows/networking/#there-is-no-docker0-bridge-on-windows).


#3

Works like a charm, thanks for your reply!