Skip to content

Jackson 2.19.0 issues #7036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
manusa opened this issue Apr 25, 2025 · 6 comments · Fixed by #7038
Closed

Jackson 2.19.0 issues #7036

manusa opened this issue Apr 25, 2025 · 6 comments · Fixed by #7038
Milestone

Comments

@manusa
Copy link
Member

manusa commented Apr 25, 2025

          Just FYI: We use Jackson in our K8s related projects and also got this update via Renovate today. We are using Gradle, so bumping Jackson in our dependencies will indirectly also bump it for the fabric8 client. I've seen two issues so far (just in case those are not covered by the existing tests).

NullPointerException

No further invesigation, but saw this stack trace in one of our update PRs:

Caused by: com.fasterxml.jackson.databind.JsonMappingException: Cannot invoke "com.fasterxml.jackson.databind.JsonSerializer.serialize(Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)" because "keySerializer" is null (through reference chain: io.fabric8.kubernetes.api.model.ConfigMap["metadata"]->io.fabric8.kubernetes.api.model.ObjectMeta["managedFields"]->java.util.ArrayList[0]->io.fabric8.kubernetes.api.model.ManagedFieldsEntry["fieldsV1"]->io.fabric8.kubernetes.api.model.FieldsV1["getAdditionalProperties"]->java.util.LinkedHashMap["f:data"])
	at app//com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:400)
	at app//com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:359)
	at app//com.fasterxml.jackson.databind.ser.std.StdSerializer.wrapAndThrow(StdSerializer.java:324)
	at app//com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:810)
	at app//com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeWithoutTypeInfo(MapSerializer.java:763)
	at app//com.fasterxml.jackson.databind.ser.AnyGetterWriter.getAndSerialize(AnyGetterWriter.java:81)
	at app//com.fasterxml.jackson.databind.ser.AnyGetterWriter.serializeAsField(AnyGetterWriter.java:89)
	at app//io.fabric8.kubernetes.model.jackson.BeanPropertyWriterDelegate.serializeAsField(BeanPropertyWriterDelegate.java:68)
	at app//com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:760)
	at app//com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:183)
	at app//com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
	at app//io.fabric8.kubernetes.model.jackson.BeanPropertyWriterDelegate.serializeAsField(BeanPropertyWriterDelegate.java:68)
	at app//com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:760)
	at app//com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:183)
	at app//com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:119)
	at app//com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:79)
	at app//com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:18)
	at app//com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
	at app//io.fabric8.kubernetes.model.jackson.BeanPropertyWriterDelegate.serializeAsField(BeanPropertyWriterDelegate.java:68)
	at app//com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:760)
	at app//com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:183)
	at app//com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
	at app//io.fabric8.kubernetes.model.jackson.BeanPropertyWriterDelegate.serializeAsField(BeanPropertyWriterDelegate.java:68)
	at app//com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:760)
	at app//com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:183)
	at app//com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:503)
	at app//com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:342)
	at app//com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4859)
	at app//com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:4079)
	at app//io.fabric8.kubernetes.client.utils.KubernetesSerialization.asJson(KubernetesSerialization.java:172)
	... 10 more
Caused by: java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.databind.JsonSerializer.serialize(Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)" because "keySerializer" is null
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:796)
	... 36 more

CRD generation

With this Gradle build script the generated CRD has a ton of new additionalProperties:

getAdditionalProperties:
  additionalProperties:
    type: "object"
  type: "object"

Originally posted by @Donnerbart in #7035 (comment)

@manusa manusa changed the title Just FYI: We use Jackson in our K8s related projects and also got this update via Renovate today. We are using Gradle, so bumping Jackson in our dependencies will indirectly also bump it for the fabric8 client. I've seen two issues so far (just in case those are not covered by the existing tests). Jackson 2.19.0 issues Apr 25, 2025
r1c4r60 added a commit to r1c4r60/kubernetes-client that referenced this issue Apr 28, 2025
r1c4r60 added a commit to r1c4r60/kubernetes-client that referenced this issue Apr 28, 2025
r1c4r60 added a commit to r1c4r60/kubernetes-client that referenced this issue May 2, 2025
@JuergenKindler
Copy link

JuergenKindler commented May 2, 2025

Also see this happening - breaks applying kubectl manifests we use.
( Got hit by that via dependabot automatically updating from 7.1.0 to 7.2.0 )

@pvillard31
Copy link

We also have the problem on the Apache NiFi project where we cannot bump Jackson to 2.19.0 because of this.

io.fabric8.kubernetes.client.KubernetesClientException: An error has occurred.
	at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:109)
	at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:102)
	at io.fabric8.kubernetes.client.utils.KubernetesSerialization.asJson(KubernetesSerialization.java:189)
	at io.fabric8.kubernetes.client.utils.Serialization.asJson(Serialization.java:125)
	at io.fabric8.kubernetes.client.server.mock.crud.PostHandler.handle(PostHandler.java:66)
	at io.fabric8.kubernetes.client.server.mock.crud.KubernetesCrudDispatcherHandler.handle(KubernetesCrudDispatcherHandler.java:47)
	at io.fabric8.kubernetes.client.server.mock.KubernetesCrudDispatcher.lambda$process$0(KubernetesCrudDispatcher.java:93)
	at io.fabric8.kubernetes.client.server.mock.KubernetesCrudDispatcher.withLock(KubernetesCrudDispatcher.java:375)
	at io.fabric8.kubernetes.client.server.mock.KubernetesCrudDispatcher.process(KubernetesCrudDispatcher.java:91)
	at io.fabric8.kubernetes.client.server.mock.KubernetesCrudDispatcher.handleCreate(KubernetesCrudDispatcher.java:108)
	at io.fabric8.mockwebserver.crud.CrudDispatcher.dispatch(CrudDispatcher.java:52)
	at io.fabric8.kubernetes.client.server.mock.KubernetesMixedDispatcher.dispatch(KubernetesMixedDispatcher.java:67)
	at io.fabric8.mockwebserver.MockWebServer$1.onHttpRequest(MockWebServer.java:142)
	at io.fabric8.mockwebserver.vertx.HttpServerRequestHandler.lambda$handle$3(HttpServerRequestHandler.java:65)
	at io.vertx.core.impl.future.FutureImpl$1.onSuccess(FutureImpl.java:91)
	at io.vertx.core.impl.future.FutureImpl$ListenerArray.onSuccess(FutureImpl.java:310)
	at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:60)
	at io.vertx.core.impl.ContextImpl.execute(ContextImpl.java:312)
	at io.vertx.core.impl.DuplicatedContext.execute(DuplicatedContext.java:168)
	at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:57)
	at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:259)
	at io.vertx.core.http.impl.HttpEventHandler.handleEnd(HttpEventHandler.java:79)
	at io.vertx.core.http.impl.Http1xServerRequest.onEnd(Http1xServerRequest.java:640)
	at io.vertx.core.http.impl.Http1xServerRequest.lambda$pendingHandler$0(Http1xServerRequest.java:375)
	at io.vertx.core.streams.impl.InboundBuffer.handleEvent(InboundBuffer.java:279)
	at io.vertx.core.streams.impl.InboundBuffer.write(InboundBuffer.java:157)
	at io.vertx.core.http.impl.Http1xServerRequest.handleEnd(Http1xServerRequest.java:617)
	at io.vertx.core.impl.ContextImpl.execute(ContextImpl.java:327)
	at io.vertx.core.impl.DuplicatedContext.execute(DuplicatedContext.java:158)
	at io.vertx.core.http.impl.Http1xServerConnection.onEnd(Http1xServerConnection.java:215)
	at io.vertx.core.http.impl.Http1xServerConnection.onContent(Http1xServerConnection.java:206)
	at io.vertx.core.http.impl.Http1xServerConnection.handleOther(Http1xServerConnection.java:189)
	at io.vertx.core.http.impl.Http1xServerConnection.handleMessage(Http1xServerConnection.java:176)
	at io.vertx.core.net.impl.ConnectionBase.read(ConnectionBase.java:159)
	at io.vertx.core.net.impl.VertxHandler.channelRead(VertxHandler.java:153)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93)
	at io.netty.handler.codec.http.websocketx.extensions.WebSocketServerExtensionHandler.channelRead(WebSocketServerExtensionHandler.java:87)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:359)
	at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1519)
	at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1377)
	at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1428)
	at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:530)
	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:469)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:359)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1429)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:167)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.handle(AbstractNioChannel.java:445)
	at io.netty.channel.nio.NioIoHandler$DefaultNioRegistration.handle(NioIoHandler.java:383)
	at io.netty.channel.nio.NioIoHandler.processSelectedKey(NioIoHandler.java:577)
	at io.netty.channel.nio.NioIoHandler.processSelectedKeysOptimized(NioIoHandler.java:552)
	at io.netty.channel.nio.NioIoHandler.processSelectedKeys(NioIoHandler.java:493)
	at io.netty.channel.nio.NioIoHandler.run(NioIoHandler.java:470)
	at io.netty.channel.SingleThreadIoEventLoop.runIo(SingleThreadIoEventLoop.java:204)
	at io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:175)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1073)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Cannot invoke "com.fasterxml.jackson.databind.JsonSerializer.serialize(Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)" because "keySerializer" is null (through reference chain: io.fabric8.kubernetes.api.model.GenericKubernetesResource["getAdditionalProperties"]->java.util.LinkedHashMap["data"])
	at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:400)
	at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:359)
	at com.fasterxml.jackson.databind.ser.std.StdSerializer.wrapAndThrow(StdSerializer.java:324)
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:810)
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeWithoutTypeInfo(MapSerializer.java:763)
	at com.fasterxml.jackson.databind.ser.AnyGetterWriter.getAndSerialize(AnyGetterWriter.java:81)
	at com.fasterxml.jackson.databind.ser.AnyGetterWriter.serializeAsField(AnyGetterWriter.java:89)
	at io.fabric8.kubernetes.model.jackson.BeanPropertyWriterDelegate.serializeAsField(BeanPropertyWriterDelegate.java:68)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:760)
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:183)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:503)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:342)
	at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4859)
	at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:4079)
	at io.fabric8.kubernetes.client.utils.KubernetesSerialization.asJson(KubernetesSerialization.java:187)
	... 61 more
Caused by: java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.databind.JsonSerializer.serialize(Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)" because "keySerializer" is null
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:796)
	... 72 more

@manusa
Copy link
Member Author

manusa commented May 13, 2025

I'll try to see if a 7.2.1 with a patch is feasible and doesn't break anything.

#7038 is too breaking for a patch release. Considering a 7.3.0 with this single change.

@wleese
Copy link

wleese commented May 28, 2025

Will this fix be backported to 6.x?

I saw Spring Boot 3.5.0 released with Jackson 2.19.0, and (perhaps releasing today) Spring Cloud 2025.0.0 uses fabric8 kubernetes client 6.x and is not planning on moving to 7.x. This puts Spring Boot + Spring Cloud users in a bit of a bind.

@manusa
Copy link
Member Author

manusa commented May 28, 2025

Will this fix be backported to 6.x?

I saw Spring Boot 3.5.0 released with Jackson 2.19.0, and (perhaps releasing today) Spring Cloud 2025.0.0 uses fabric8 kubernetes client 6.x and is not planning on moving to 7.x. This puts Spring Boot + Spring Cloud users in a bit of a bind.

Given the Spring Cloud context, we might have to port it then.
Can you please create a specific issue for that so that we can track it?

@wleese
Copy link

wleese commented May 28, 2025

Sure, here it is: #7106

MarkEWaite added a commit to MarkEWaite/jenkins that referenced this issue May 29, 2025
The kubernetes client has issues with Jackson 2.19.0.

Original pull request that updated to 2.19.0 was:

* jenkinsci#10677

Reverted from the Jenkins plugin BOM in pull request:

* jenkinsci/bom#5114

Distribution suspended from Jenkins update center in:

* jenkins-infra/update-center2#869

Refer to the following Kubernetes client API issues:

* fabric8io/kubernetes-client#7036
* fabric8io/kubernetes-client#7106

Backport of the Jackson 2.19.0 change to Kubernetes client 6.x has been requested at:

* fabric8io/kubernetes-client#7107

Also described in detail in Spring Cloud issue report:

* spring-cloud/spring-cloud-kubernetes#1923

Also described in Jenkins issue report:

* https://issues.jenkins.io/browse/JENKINS-75712

Also verified as failing in kubernetes plugin pull request:

* jenkinsci/kubernetes-plugin#1702

Also mentioned in Kubernetes client API upgrade pull request:

* jenkinsci/kubernetes-client-api-plugin#292

This reverts commit 11e5d5c.
basil pushed a commit to jenkinsci/jenkins that referenced this issue May 29, 2025
The kubernetes client has issues with Jackson 2.19.0.

Original pull request that updated to 2.19.0 was:

* #10677

Reverted from the Jenkins plugin BOM in pull request:

* jenkinsci/bom#5114

Distribution suspended from Jenkins update center in:

* jenkins-infra/update-center2#869

Refer to the following Kubernetes client API issues:

* fabric8io/kubernetes-client#7036
* fabric8io/kubernetes-client#7106

Backport of the Jackson 2.19.0 change to Kubernetes client 6.x has been requested at:

* fabric8io/kubernetes-client#7107

Also described in detail in Spring Cloud issue report:

* spring-cloud/spring-cloud-kubernetes#1923

Also described in Jenkins issue report:

* https://issues.jenkins.io/browse/JENKINS-75712

Also verified as failing in kubernetes plugin pull request:

* jenkinsci/kubernetes-plugin#1702

Also mentioned in Kubernetes client API upgrade pull request:

* jenkinsci/kubernetes-client-api-plugin#292

This reverts commit 11e5d5c.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants