Skip to content
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

Stopped working with gRPC-java 1.70.0 #633

Open
Rawa opened this issue Jan 30, 2025 · 1 comment
Open

Stopped working with gRPC-java 1.70.0 #633

Rawa opened this issue Jan 30, 2025 · 1 comment

Comments

@Rawa
Copy link

Rawa commented Jan 30, 2025

Hello!

We are using this dependency along with gRPC java to generate our gRPC interface. We've implemented it in a similar fashion as the example provided in this repo. However, when upgrading to grpc-java we seem to hit some issues. Compiled code for streaming calls seems to have stopped working.

The following generated (Generated from grpc-java as I understand it) to in our grpc java file is broken due to it seemingly referencing grpc-io.stub 1.57.2. BlockingClientCall can not be resolved.

    /**
     * <pre>
     * Control the daemon and receive events
     * </pre>
     */
    @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918")
    public io.grpc.stub.BlockingClientCall<?, mullvad_daemon.management_interface.ManagementInterface.DaemonEvent>
        eventsListen(com.google.protobuf.Empty request) {
      return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall(
          getChannel(), getEventsListenMethod(), getCallOptions(), request);
    }

Looking at my dependency structure:

|    +--- io.grpc:grpc-kotlin-stub:1.4.1
|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.0 -> 2.1.10 (*)
|    |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3 -> 1.10.1 (*)
|    |    +--- io.grpc:grpc-stub:1.57.2
|    |    |    +--- io.grpc:grpc-api:1.57.2 -> 1.70.0 (*)

It seems like grpc-kotlin-stub caused it to pull stub version 1.57.2. Looking from the source code only grpc-kotlin has a direct dependency on 1.57.2, see here, which doesn't play well with grpc-java since it then lacks the new streaming stub calls.

Is it possible to create a new release with some updated dependencies?

@ejona86
Copy link
Member

ejona86 commented Feb 3, 2025

You should be able to fix this by adding an explicit dependency on io.grpc:grpc-stub:1.70.0. That's actually normal, since generated code can require new versions of grpc-java and you are choosing the version of protoc-gen-grpc-java to use, so you are actually the one using grpc-stub:1.70.0. (Yes, I know tooling makes that less clear.) At times you can cheat by using grpc-kotlin's dependency on grpc-stub (if it compiles, it is probably fine), but technically that is just a trick and at times you may require the explicit dependency (like now).

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

No branches or pull requests

2 participants