Repository navigation
Unrecognized field "Labels" (class com.github.dockerjava.api.model.ServiceSpec) #918
Copy link
Copy link
Closed
Labels
Description
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)
Reactions are currently unavailable
Activity
orzeh commentedon Sep 21, 2017
@mydeadlyvenoms I think it is addressed in #917
mydeadlyvenoms commentedon Sep 21, 2017
Hi @orzeh - Ouu I guess I overlooked the pull request, you are right!
fengxx commentedon Sep 30, 2017
@mydeadlyvenoms I just updated the PR, please have a try
mydeadlyvenoms commentedon Oct 5, 2017
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?darinhoward commentedon Sep 4, 2019
adding pull request to fix this all the other api models #1239
stale commentedon Jun 19, 2020
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.
stale commentedon Jul 19, 2020
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.