Container creation fails when not exposing all ports
shantur opened this issue · 1 comments
shantur commented
Container creation fails when image exposes a port but not declared in configuration.
Environment
Using release 1.3.1 ova
Steps to Reproduce
- Click
+Container
link to bring up new container flow. - Select
registry.hub.docker.com/library/mysql
image with tag5.7
- Enter name as
mysql-test
- Select
Environment
on top and add Environment variable nameMYSQL_ROOT_PASSWORD
and valuemysqlrootpw
- 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.