vmware-archive/admiral

Container creation fails when not exposing all ports

shantur opened this issue · 1 comments

Container creation fails when image exposes a port but not declared in configuration.

Environment

Using release 1.3.1 ova

Steps to Reproduce

  1. Click +Container link to bring up new container flow.
  2. Select registry.hub.docker.com/library/mysql image with tag 5.7
  3. Enter name as mysql-test
  4. Select Environment on top and add Environment variable name MYSQL_ROOT_PASSWORD and value mysqlrootpw
  5. Click Provision

Expected Behaviour
Container is created

Actual Behaviour
Creation fails with Unexpected error, status: 400

In vic-admiral container logs xenonHost.0.log file shows the issue

        at com.vmware.admiral.adapter.docker.service.DockerAdapterUtils.filterHostConfigEmptyPortBindings(DockerAdapterUtils.java:189)
        at com.vmware.admiral.adapter.docker.service.DockerAdapterService.patchContainerState(DockerAdapterService.java:1229)
        at com.vmware.admiral.adapter.docker.service.DockerAdapterService.lambda$null$30(DockerAdapterService.java:1067)
        at com.vmware.admiral.adapter.docker.service.AbstractDockerAdapterService.handleExceptions(AbstractDockerAdapterService.java:382)
        at com.vmware.admiral.adapter.docker.service.DockerAdapterService.lambda$inspectContainer$31(DockerAdapterService.java:1065)
        at com.vmware.xenon.common.Operation.completeOrFail(Operation.java:1331)
        at com.vmware.xenon.common.Operation.complete(Operation.java:1233)
        at com.vmware.xenon.common.http.netty.NettyHttpServiceClient.lambda$sendHttpRequest$1(NettyHttpServiceClient.java:593)
        at com.vmware.xenon.common.Operation.lambda$nestCompletion$1(Operation.java:1362)
        at com.vmware.xenon.common.Operation.completeOrFail(Operation.java:1331)
        at com.vmware.xenon.common.Operation.complete(Operation.java:1233)
        at com.vmware.xenon.common.http.netty.NettyHttpServerResponseHandler.completeRequest(NettyHttpServerResponseHandler.java:191)
        at com.vmware.xenon.common.http.netty.NettyHttpServerResponseHandler.decodeResponseBody(NettyHttpServerResponseHandler.java:180)
        at com.vmware.xenon.common.http.netty.NettyHttpServerResponseHandler.completeRequest(NettyHttpServerResponseHandler.java:160)
        at com.vmware.xenon.common.http.netty.NettyHttpServerResponseHandler.channelRead0(NettyHttpServerResponseHandler.java:67)
        at com.vmware.xenon.common.http.netty.NettyHttpServerResponseHandler.channelRead0(NettyHttpServerResponseHandler.java:42) 

WorkAround
When exposed port is added in configuration, container is created correctly.

Hi Shantur,

Thank you for reporting that issue. It has been fixed with commit 0cb6bf6 and will be released with next VIC