VIC Containers Fail In Management Portal "Unexpected error, status: 400"
book
Article ID: 336660
calendar_today
Updated On:
Products
VMware vSphere ESXi
Issue/Introduction
Symptoms: When deploying VIC Containers using the management portal. Containers may fail with the message "Unexpected error, status: 400"
The VIC Appliance may log the following messages in/storage/log/admiral/xenonHost.0.log.
[404][I][2018-04-23T20:50:05.092Z][62][RemoteApiDockerAdapterCommandExecutorImpl][createContainer][Creating container: https://vch00-00.gsslabs.org:2376/v1.24/containers/create?name=nginx-mcm781-72910153722] [405][I][2018-04-23T20:50:06.512Z][29][RemoteApiDockerAdapterCommandExecutorImpl][startContainer][Starting container: https://vch00-00.gsslabs.org:2376/v1.24/containers/a3e60f066600322755740100eab9f52e29caf5fa535b7703b9806abf3430bd 5b/start] [406][I][2018-04-23T20:50:29.887Z][65][RemoteApiDockerAdapterCommandExecutorImpl][inspectContainer][Inspecting container: https://vch00-00.gsslabs.org:2376/v1.24/containers/a3e60f066600322755740100eab9f52e29caf5fa535b7703b9806abf34 30bd5b/json] [407][S][2018-04-23T20:50:29.967Z][62][8282/adapters/docker-service][handleExceptions][java.lang.NullPointerException 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)
Cause
This is caused when there is not a value for the port bindings returning null.
Resolution
This is a known issue and is to be addressed in future releases of the product.
Workaround: Add a port binding under the "network" section of the provisioning options. This does not need to map to a "Host Port" through the VCH. Only needs port values on the "Container Port" side of the port bindings.
The port values that need to be used are under "ExposedPorts" when inspecting the image. For example nginx used port 80 as shown below. # docker --tls image inspect nginx … "ExposedPorts": { "80/tcp": {}
Next the port is added in the UI as part of the container provisioning as shown in the picture. Note, if there are multiple ExposedPorts, then map each of them.