Getting grpc java.lang.NoSuchMethodError after update (dependency discrepancy)

Derek Lowe: We just upgraded from 1.3.1 to 1.3.2 and our deployments are failing with a Method Not found error. Has anyone else seen this? Here is our call:

val deployment = it.newDeployCommand().addResourceBytes(modelResource, resourceName).send().join()

Here is our response Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: 'boolean com.google.protobuf.GeneratedMessageV3.isStringEmpty(java.lang.Object)'\norg.springframework.web.util.NestedServletException

korthout: :thinking_face: I’m not sure what changes could’ve caused this.

Are you sure that’s the only change you’ve made? Between 1.3.1 and 1.3.2 the protobuf library has not been changed

Derek Lowe: Yes that is all we changed. We updated Zeebe and our java client to 1.3.2.

korthout: You should be able to use the 1.3.1 client against a newer zeebe version. Have you tried downgrading the client to see if that resolves it? Perhaps we can pinpoint the issue

Derek Lowe: I will give it a try.

Derek Lowe: Ok I tried 1.3.1, 1.3.0, and 1.2.9 just to see and they all gave the same response. Anything else I can try to get more info?

Nicolas: Can you elaborate? What version of Zeebe are you running for the cluster? And which client do you use? The official Java one, or spring-zeebe?

Derek Lowe: We are running Zeebe 1.3.2 self hosted and zeebe-client-java 1.3.2.

Derek Lowe: Digging in a little deeper I see this error in the addProcess function Method threw 'java.lang.NoClassDefFoundError' exception. Cannot evaluate io.camunda.zeebe.gateway.protocol.GatewayOuterClass$DeployProcessRequest$Builder.toString()

zell: Hm. Sure that you not using a snapshot version or something? :thinking_face: sorry for asking the question again :see_no_evil: Could you provide a reproducer project or some more code (+maven details and configs) and a complete stacktrace?

Derek Lowe: Don’t be sorry I appreciate any help. What do you mean by a snapshot version? I will add a stack trace and our gradle references below.

Derek Lowe: 2022-01-31 13:30:28.123 ERROR c.d.b.w.e.GlobalExceptionHandler.500 : Internal Server Error url=<http://cust1.mad-zuck.domorig.io/api/workflow/v1/models/deploy> method=POST details={} message=Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: 'boolean com.google.protobuf.GeneratedMessageV3.isStringEmpty(java.lang.Object)' --{"agentType":"postman","c":"2022-01-31 13:30:28.123 UNKNOWN domoapps 10.1.129.14 ERROR c.d.b.web.exception.GlobalExceptionHandler.500 C3M6VQ6JFY-NNCOF-RBBXR HNC0C-9GW5X cust1 27 qtp653131945-205 ","event":{"msg":"Internal Server Error url=<http://cust1.mad-zuck.domorig.io/api/workflow/v1/models/deploy> method=POST details={} message=Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: 'boolean com.google.protobuf.GeneratedMessageV3.isStringEmpty(java.lang.Object)'","exception":{"fingerprint":"SOUL6A4D2SZEN9P8X67KLLW849K4PN3","message":"Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: 'boolean com.google.protobuf.GeneratedMessageV3.isStringEmpty(java.lang.Object)'"}},"originIp":"10.3.200.231"}
java.lang.NoSuchMethodError: 'boolean com.google.protobuf.GeneratedMessageV3.isStringEmpty(java.lang.Object)'
at io.camunda.zeebe.gateway.protocol.GatewayOuterClass$ProcessRequestObject.getSerializedSize(GatewayOuterClass.java:11683)
at io.camunda.zeebe.gateway.protocol.GatewayOuterClass$DeployProcessRequest.getSerializedSize(GatewayOuterClass.java:10791) [2 skipped]
at io.grpc.protobuf.lite.ProtoInputStream.available(ProtoInputStream.java:108)
at io.grpc.internal.MessageFramer.getKnownLength(MessageFramer.java:205)
at io.grpc.internal.MessageFramer.writePayload(MessageFramer.java:137)
at io.grpc.internal.AbstractStream.writeMessage(AbstractStream.java:65)
at io.grpc.internal.ForwardingClientStream.writeMessage(ForwardingClientStream.java:37)
at io.grpc.internal.RetriableStream$1SendMessageEntry.runWith(RetriableStream.java:549)
at io.grpc.internal.RetriableStream.delayOrExecute(RetriableStream.java:526)
at io.grpc.internal.RetriableStream.sendMessage(RetriableStream.java:553)
at io.grpc.internal.ClientCallImpl.sendMessageInternal(ClientCallImpl.java:520)
at io.grpc.internal.ClientCallImpl.sendMessage(ClientCallImpl.java:506)
at io.grpc.stub.ClientCalls.asyncUnaryRequestCall(ClientCalls.java:308)
at io.grpc.stub.ClientCalls.asyncUnaryRequestCall(ClientCalls.java:294)
at io.grpc.stub.ClientCalls.asyncUnaryCall(ClientCalls.java:68)
at io.camunda.zeebe.gateway.protocol.GatewayGrpc$GatewayStub.deployProcess(GatewayGrpc.java:886)
at io.camunda.zeebe.client.impl.command.DeployProcessCommandImpl.send(DeployProcessCommandImpl.java:172)
at io.camunda.zeebe.client.impl.command.DeployProcessCommandImpl.send(DeployProcessCommandImpl.java:164)
at com.domo.odyssey.engine.WorkflowEngineController.deployModel(WorkflowEngineController.kt:108)
at com.domo.odyssey.models.ModelsController.deployModelVersion(ModelsController.kt:425)
at com.domo.odyssey.models.ModelsController.deployModel(ModelsController.kt:378)
at com.domo.odyssey.models.ModelsResource.deployModel(ModelsResource.kt:247)
at com.domo.odyssey.models.ModelsResource$$FastClassBySpringCGLIB$$98787e72.invoke(&lt;generated&gt;)
at com.domo.odyssey.models.ModelsResource$$EnhancerBySpringCGLIB$$c670be51.deployModel(&lt;generated&gt;) [8 skipped]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:665) [11 skipped]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:750) [1 skipped]
at com.domo.bedrock.web.support.RequestPoolPatternFilter.doFilterInternal(RequestPoolPatternFilter.java:80) [5 skipped]
at com.domo.bedrock.maestro.web.RequestContextAuthFilter.doFilterInternal(RequestContextAuthFilter.java:46) [3 skipped]
at com.domo.bedrock.maestro.web.ServiceLogFilter.doFilterInternal(ServiceLogFilter.java:187) [3 skipped]
at com.domo.api.identity.lib.util.ThreadLocalCacheFilter.doFilterInternal(ThreadLocalCacheFilter.java:29) [3 skipped]
at com.domo.domoapps.configuration.filter.LaunchFormRedirectFilter.doFilterInternal(LaunchFormRedirectFilter.kt:39) [19 skipped]
at com.domo.bedrock.web.security.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:87) [2 skipped]
at com.domo.domoapps.configuration.filter.RyuuFilter.doFilterInternal(RyuuFilter.kt:27) [6 skipped]
at com.domo.bedrock.maestro.client.RequestTimeoutFilter.doFilterInternal(RequestTimeoutFilter.java:52) [26 skipped]
at java.base/java.lang.Thread.run(Thread.java:829) [33 skipped]
... 115 common frames omitted
Wrapped by: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: 'boolean com.google.protobuf.GeneratedMessageV3.isStringEmpty(java.lang.Object)'
at javax.servlet.http.HttpServlet.service(HttpServlet.java:665) [4 skipped]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:750) [1 skipped]
at com.domo.bedrock.web.support.RequestPoolPatternFilter.doFilterInternal(RequestPoolPatternFilter.java:80) [5 skipped]
at com.domo.bedrock.maestro.web.RequestContextAuthFilter.doFilterInternal(RequestContextAuthFilter.java:46) [3 skipped]
at com.domo.bedrock.maestro.web.ServiceLogFilter.doFilterInternal(ServiceLogFilter.java:187) [3 skipped]
at com.domo.api.identity.lib.util.ThreadLocalCacheFilter.doFilterInternal(ThreadLocalCacheFilter.java:29) [3 skipped]
at com.domo.domoapps.configuration.filter.LaunchFormRedirectFilter.doFilterInternal(LaunchFormRedirectFilter.kt:39) [19 skipped]
at com.domo.bedrock.web.security.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:87) [2 skipped]
at com.domo.domoapps.configuration.filter.RyuuFilter.doFilterInternal(RyuuFilter.kt:27) [6 skipped]
at com.domo.bedrock.maestro.client.RequestTimeoutFilter.doFilterInternal(RequestTimeoutFilter.java:52) [26 skipped]
at java.base/java.lang.Thread.run(Thread.java:829) [33 skipped]

Derek Lowe: Here are our gradle dependencies for camunda

def zeebeVersion = '1.3.2'
    compile("io.camunda:zeebe-client-java:$zeebeVersion")

    compile("org.camunda.bpm.model:camunda-bpmn-model:7.16.0")
    compile("org.camunda.bpm.model:camunda-xml-model:7.16.0")

Alexey Vinogradov: Hey <@U0306BQDV2N>. We have encountered this either but with the 1.2 version. Please, make sure you have at least a 3.18.0 version of the com.google.protobuf:protobuf-java library. In our case it was a conflict in Spring Cloud Dependencies.

zell: Thanks @Alexey Vinogradov good to know!

Nicolas: Good catch! Yes, from the error it seemed like either a protobuf or grpc library version incompatibility. A good reminder that enforcing dependency convergence is a useful thing :slightly_smiling_face:

zell: Might help to debug your dependencies https://docs.gradle.org/current/userguide/viewing_debugging_dependencies.html e.g. dependency tree is mostly quite useful tool

Derek Lowe: @Alexey Vinogradov Thank you so much! That appears to have resolved the issue.

Derek Lowe: Also thanks everyone else for your time in helping me. I was totally stuck so I appreciate your time!

Note: This post was generated by Slack Archivist from a conversation in the Zeebe Slack, a source of valuable discussions on Zeebe (get an invite). Someone in the Slack thought this was worth sharing!

If this post answered a question for you, hit the Like button - we use that to assess which posts to put into docs.