question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mydeadlyvenomscommented, 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?

0reactions
stale[bot]commented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object mapper readValueAsString with a ServiceSpec that ...
UnrecognizedPropertyException: Unrecognized field "mode" (class com.github.dockerjava.api.model.ServiceModeConfig), not marked as ignorable ...
Read more >
Same dependencies and java code, but use Gradle will start ...
Same dependencies and java code, but use Gradle will start fail with: Unrecognized field "ID" (class com.github.dockerjava.api.model.
Read more >
Unrecognized field "stream" · Issue #321 · docker-java ... - GitHub
UnrecognizedPropertyException: Unrecognized field "stream" (class com.github.dockerjava.api.model.PullResponseItem), not marked as ignorable (6 known ...
Read more >
com.github.docker-java is not shaded and conflicts with the ...
UnrecognizedPropertyException: Unrecognized field "ID" (class com.github.dockerjava.api.model.Info), not marked as ignorable (48 known ...
Read more >
docker-java/ServiceSpec.java at master - GitHub
Java Docker API Client. Contribute to docker-java/docker-java development by creating an account on GitHub.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found