Skip to content

Unrecognized field "Labels" (class com.github.dockerjava.api.model.ServiceSpec) #918

Closed

Description

@mydeadlyvenoms

Hi everyone

After executing dockerClient.listServicesCmd().exec(); the following exception occurs.

Docker Version: 17.06.2-ce-mac27 (19124)
Docker-Java Version: 3.1.0-SNAPSHOT

Thank you very much for your help!

ERROR com.github.dockerjava.core.async.ResultCallbackTemplate - Error during callback
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "Labels" (class com.github.dockerjava.api.model.ServiceSpec), not marked as ignorable (6 known properties: "EndpointSpec", "Mode", "Networks", "Name", "TaskTemplate", "UpdateConfig"])
 at [Source: [B@70967e7a; line: 1, column: 193] (through reference chain: java.util.ArrayList[0]->com.github.dockerjava.api.model.Service["Spec"]->com.github.dockerjava.api.model.ServiceSpec["Labels"])
	at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:62)
	at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:834)
	at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1093)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1478)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1456)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:282)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140)
	at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:504)
	at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:111)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:276)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140)
	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:287)
	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:259)
	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3798)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2944)
	at com.github.dockerjava.netty.handler.JsonResponseCallbackHandler.channelRead0(JsonResponseCallbackHandler.java:40)
	at com.github.dockerjava.netty.handler.JsonResponseCallbackHandler.channelRead0(JsonResponseCallbackHandler.java:17)
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
...

Update 1: I just tried the Pull Request mentioned by @orzeh , the exception from above is gone. The following new exception occurs.

java.util.ArrayList[0]->com.github.dockerjava.api.model.Service["Spec"]->com.github.dockerjava.api.model.ServiceSpec["TaskTemplate"]->com.github.dockerjava.api.model.TaskSpec["Placement"]->com.github.dockerjava.api.model.ServicePlacement["Platforms"])
	at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:62)
	at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:834)
	at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1093)

Update 2: Here is another UnrecognizedPropertyException when calling dockerClient.inspectServiceCmd(...).exec();.

Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "PublishMode" (class com.github.dockerjava.api.model.PortConfig), not marked as ignorable (4 known properties: "Protocol", "TargetPort", "Name", "PublishedPort"])
 at [Source: [B@1e9fa6b4; line: 1, column: 503] (through reference chain: com.github.dockerjava.api.model.Service["Spec"]->com.github.dockerjava.api.model.ServiceSpec["EndpointSpec"]->com.github.dockerjava.api.model.EndpointSpec["Ports"]->java.util.ArrayList[0]->com.github.dockerjava.api.model.PortConfig["PublishMode"])
	at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:62)
	at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:834)
	at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1093)

Activity

  1. orzeh commented on Sep 21, 2017

    @orzeh
    Contributor

    @mydeadlyvenoms I think it is addressed in #917

  2. mydeadlyvenoms commented on Sep 21, 2017

    @mydeadlyvenoms
    Author

    Hi @orzeh - Ouu I guess I overlooked the pull request, you are right!

  3. fengxx commented on Sep 30, 2017

    @fengxx
    Contributor

    @mydeadlyvenoms I just updated the PR, please have a try

  4. mydeadlyvenoms commented on Oct 5, 2017

    @mydeadlyvenoms
    Author

    Hi @fengxx
    Don't you think it would be a good idea to add @JsonIgnoreProperties(ignoreUnknown = true) to all entities respectively to a base entity?

  5. darinhoward commented on Sep 4, 2019

    @darinhoward

    adding pull request to fix this all the other api models #1239

  6. stale commented on Jun 19, 2020

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  7. stale commented on Jul 19, 2020

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions