authzed / authzed-java

Official SpiceDB client library for JVM languages
https://docs.authzed.com/reference/api
Apache License 2.0
19 stars 8 forks source link

gRPC version is out of sync in readme documentation, causing `NAME_RESOLUTION_DELAYED` errors #52

Closed JasonYao closed 1 year ago

JasonYao commented 1 year ago

The problem

When pulling in the library versions described in the README.md file, trying to make rpcs will result in errors that look like the following:

java.lang.NoSuchFieldError: NAME_RESOLUTION_DELAYED
    at io.grpc.internal.ManagedChannelImpl$RealChannel$PendingCall.reprocess(ManagedChannelImpl.java:1089) ~[grpc-core-1.55.1.jar:1.55.1]
    at io.grpc.internal.ManagedChannelImpl$RealChannel.updateConfigSelector(ManagedChannelImpl.java:1019) ~[grpc-core-1.55.1.jar:1.55.1]
    at io.grpc.internal.ManagedChannelImpl$NameResolverListener$1NamesResolved.run(ManagedChannelImpl.java:1816) ~[grpc-core-1.55.1.jar:1.55.1]
    at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:95) ~[grpc-api-1.54.1.jar:1.54.1]
    at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:127) ~[grpc-api-1.54.1.jar:1.54.1]
    at io.grpc.internal.ManagedChannelImpl$NameResolverListener.onResult(ManagedChannelImpl.java:1868) ~[grpc-core-1.55.1.jar:1.55.1]
    at io.grpc.internal.RetryingNameResolver$RetryingListener.onResult(RetryingNameResolver.java:98) ~[grpc-core-1.55.1.jar:1.55.1]
    at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:333) ~[grpc-core-1.55.1.jar:1.55.1]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[na:na]
    at java.base/java.lang.Thread.run(Thread.java:1589) ~[na:na]

Steps to reproduce

  1. Pull in these dependencies
    dependencies {
    implementation "com.authzed.api:authzed:0.5.0"
    implementation 'io.grpc:grpc-protobuf:1.54.1'
    implementation 'io.grpc:grpc-stub:1.54.1'
    }
  2. Make a CheckPermissionRequest rpc

Solution

Update the README.md to point to the grpc version in https://github.com/authzed/authzed-java/blob/main/build.gradle#L80-L97 from the above to the following:

dependencies {
    implementation "com.authzed.api:authzed:0.5.0"
    implementation 'io.grpc:grpc-protobuf:1.55.1'
    implementation 'io.grpc:grpc-stub:1.55.1'
}