← Winnitude! Search  ·  Reader Mode (871 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 6 LINKS

dockerClient.inspectContainerCmd(id).exec() throws exception. version 3.5.1 · Issue #2457 · docker-java/docker-java

Repository navigation

dockerClient.inspectContainerCmd(id).exec() throws exception. version 3.5.1  #2457


New issue

New issue

Open

Open
dockerClient.inspectContainerCmd(id).exec() throws exception. version 3.5.1 #2457

Description

@zhangyzGithub's profile zhangyzGithub opened on Jun 17, 2025

when i exec this ,
InspectContainerResponse inspectResponse = dockerClient.inspectContainerCmd(id).exec();

throws exception , like this.
java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.ValueInstantiationException: Cannot construct instance of com.github.dockerjava.api.model.Ports, problem: Error parsing ExposedPort '161/udp/tcp'
at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: com.github.dockerjava.api.command.InspectContainerResponse["HostConfig"]->com.github.dockerjava.api.model.HostConfig["PortBindings"])

Then, my container's info , 'HostConfig' likes this.
"HostConfig": {
"Binds": [

        ],
        "ContainerIDFile": "",
        "LogConfig": {
            "Type": "json-file",
            "Config": {}
        },
        "NetworkMode": "host",
        "PortBindings": {
            "161/udp/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "161"
                }
            ]
        },
 ......

From the error message, it can be seen that the port binding '161/udp/tcp' parsing error occurred.
How to solve it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions