grpc / grpc-kotlin

Kotlin gRPC implementation. HTTP/2 based RPC
https://grpc.io/docs/languages/kotlin
Apache License 2.0
1.2k stars 165 forks source link

kotlin-grpc v1.41 is not compatible with java-grpc v1.60+ #595

Closed vishr closed 7 months ago

vishr commented 7 months ago

Related: https://github.com/grpc/grpc-java/pull/10636

Apr 09, 2024 7:08:15 PM io.grpc.internal.ManagedChannelImpl$2 uncaughtException
SEVERE: [Channel<1>: (localhost:8080)] Uncaught exception in the SynchronizationContext. Panic!
java.lang.NoSuchMethodError: 'boolean io.grpc.LoadBalancer.acceptResolvedAddresses(io.grpc.LoadBalancer$ResolvedAddresses)'
    at io.grpc.internal.AutoConfiguredLoadBalancerFactory$AutoConfiguredLoadBalancer.tryAcceptResolvedAddresses(AutoConfiguredLoadBalancerFactory.java:142)
    at io.grpc.internal.ManagedChannelImpl$NameResolverListener$1NamesResolved.run(ManagedChannelImpl.java:1852)
    at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:94)
    at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:126)
    at io.grpc.internal.ManagedChannelImpl$NameResolverListener.onResult(ManagedChannelImpl.java:1866)
    at io.grpc.internal.RetryingNameResolver$RetryingListener.onResult(RetryingNameResolver.java:98)
    at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:333)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1583)

Exception in thread "main" io.grpc.StatusException: INTERNAL: Panic! This is a bug!
    at io.grpc.Status.asException(Status.java:548)
    at io.grpc.kotlin.ClientCalls$rpcImpl$1$1$1.onClose(ClientCalls.kt:300)
    at io.grpc.internal.DelayedClientCall$DelayedListener$3.run(DelayedClientCall.java:489)
    at io.grpc.internal.DelayedClientCall$DelayedListener.delayOrExecute(DelayedClientCall.java:453)
    at io.grpc.internal.DelayedClientCall$DelayedListener.onClose(DelayedClientCall.java:486)
    at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:576)
    at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:757)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:736)
    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
    at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.NoSuchMethodError: 'boolean io.grpc.LoadBalancer.acceptResolvedAddresses(io.grpc.LoadBalancer$ResolvedAddresses)'
    at io.grpc.internal.AutoConfiguredLoadBalancerFactory$AutoConfiguredLoadBalancer.tryAcceptResolvedAddresses(AutoConfiguredLoadBalancerFactory.java:142)
    at io.grpc.internal.ManagedChannelImpl$NameResolverListener$1NamesResolved.run(ManagedChannelImpl.java:1852)
    at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:94)
    at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:126)
    at io.grpc.internal.ManagedChannelImpl$NameResolverListener.onResult(ManagedChannelImpl.java:1866)
    at io.grpc.internal.RetryingNameResolver$RetryingListener.onResult(RetryingNameResolver.java:98)
    at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:333)
    ... 3 more

Process finished with exit code 1
vishr commented 7 months ago

Closing this as it worked for me. Appears that the build.gradle file was incorrect.