scalapb / zio-grpc

ScalaPB meets ZIO: write purely functional gRPC services and clients using ZIO
Apache License 2.0
257 stars 81 forks source link

Upgrading to 0.6.1 causes runtime error #620

Open omidb opened 2 months ago

omidb commented 2 months ago

When upgrading from 0.6.0 to 0.6.1, the server doesn't get started and it fails with this error:

- Top-level defect prevented test execution
  Exception in thread "zio-fiber-29" zio.test.TestFailure$Runtime: Runtime(Fail(java.lang.AbstractMethodError: Receiver class io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder$NettyTransportFactory does not define or inherit an implementation of the resolved method 'abstract java.util.Collection getSupportedSocketAddressTypes()' of interface io.grpc.internal.ClientTransportFactory.,Stack trace for thread "zio-fiber-":
  ),Map())

Here is the relevant dependencies:

val zioGrpcVersion = "0.6.1"

libraryDependencies ++= Seq(
  "com.thesamet.scalapb.zio-grpc" %% "zio-grpc-codegen" % zioGrpcVersion,
  "com.thesamet.scalapb" %% "compilerplugin" % "0.11.13")

and

  val grpcVersion = "1.50.1"
  val ziogrpc     = Seq(
    "io.grpc" % "grpc-netty" % grpcVersion,
    "com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapb.compiler.Version.scalapbVersion,
    "com.thesamet.scalapb" %% "scalapb-json4s" % "0.12.0"))
thesamet commented 2 months ago

zio-grpc 0.6.1 depends on grpc-netty 1.60.0. I believe the line you have that tries to set it to 1.50.1 does not have any effect since that version is evicted by sbt because the the version that zio-grpc brings is newer.

It would be impossible to debug the specific problem you have without additional information or a minimal example. Version 0.6.1 on its own works - we have tests etc, so there's something specific in your project that causes this. Can you work towards isolating the issue?