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

Native executable compiled with GraalVM fails to subscribe to Google Pub/Sub topic #35803

Closed
gpaolopedrazza opened this issue Sep 7, 2023 · 4 comments
Labels
area/native-image kind/bug Something isn't working

Comments

@gpaolopedrazza
Copy link

Describe the bug

I create a new Google Pub/Sub project for Quarkus following exactly the tutorial available on https://docs.quarkiverse.io/quarkus-google-cloud-services/main/pubsub.html using 3.2.0 Final as quarkus version. The only small difference was in the subscription name, because I already had one and therefore, I just used it like
ProjectSubscriptionName subscriptionName = ProjectSubscriptionName.of(projectId, pubSubSubscription);
Running the project on quarkus works like a charm, the subscriber works and messages are sent/received to/from the Pub/Sub subscription.
My problem comes when I try to build a native executable. I downloaded and installed Oracle GraalVM 20.0.2+9.1 and tried to build a native image.
mvnw --no-transfer-progress -f pom.xml -Pnative clean package -DskipTest
Due to following bug in GraalVM oracle/graal#5868, I had to implement following workaround apache/camel-quarkus#5006 (comment)
Probably precisely because of that GraalVM bug, Google Pub/Sub rejects the subscriber request with invalid argument error.
Is this really just a bug of GraalVM and I have to wait for the fix? Is there any different method/framework else I can use in order to make a PubSub subscriber working under Quarkus with a native build?

Expected behavior


--/ __ / / / / _ | / _ / /// / / / __/
-/ /
/ / // / __ |/ , / ,< / // /\ \
--___
// |//|//||_//
2023-09-07 15:56:42,364 INFO [io.quarkus] (Quarkus Main Thread) pubsub-quickstart 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.2.0.Final) started in 2.860s. Listening on: http://localhost:8080
2023-09-07 15:56:42,367 INFO [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2023-09-07 15:56:42,367 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, google-cloud-pubsub, resteasy-reactive, resteasy-reactive-jackson, smallrye-context-propagation, vertx]
2023-09-07 15:59:36,450 INFO [org.acm.PubSubResource] (executor-thread-1) Created subscriber
2023-09-07 15:59:36,704 INFO [org.acm.PubSubResource] (executor-thread-1) Subscriber running

Actual behavior

C:\source\pubsub-quickstart\target>pubsub-quickstart-1.0.0-SNAPSHOT-runner.exe


--/ __ / / / / _ | / _ / /// / / / __/
-/ /
/ / // / __ |/ , / ,< / // /\
--___
// |//|//||_//
2023-09-07 15:40:38,096 INFO [io.quarkus] (main) pubsub-quickstart 1.0.0-SNAPSHOT native (powered by Quarkus 3.2.0.Final) started in 0.086s. Listening on: http://0.0.0.0:8080
2023-09-07 15:40:38,099 INFO [io.quarkus] (main) Installed features: [cdi, google-cloud-pubsub, resteasy-reactive, resteasy-reactive-jackson, smallrye-context-propagation, vertx]
2023-09-07 15:46:19,031 INFO [org.acm.PubSubResource] (executor-thread-1) Created subscriber
2023-09-07 15:46:19,051 INFO [org.acm.PubSubResource] (executor-thread-1) Subscriber running
2023-09-07 15:46:19,591 SEVERE [com.goo.clo.pub.v1.StreamingSubscriberConnection] (Subscriber-SE-1-0) terminated streaming with exception: com.google.api.gax.rpc.InvalidArgumentException: com.google.api.gax.rpc.InvalidArgumentException: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Request contains an invalid argument.
at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:92)
at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:41)
at com.google.cloud.pubsub.v1.StreamingSubscriberConnection$1.onFailure(StreamingSubscriberConnection.java:340)

How to Reproduce?

  1. Follow the tutorial https://docs.quarkiverse.io/quarkus-google-cloud-services/main/pubsub.html and check the project works
  2. Install Oracle GraalVM 20.0.2+9.1 and build an executable
  3. Try to run the executable

Output of uname -a or ver

No response

Output of java -version

java 20.0.1 2023-04-18

GraalVM version (if different from Java)

20.0.2+9.1

Quarkus version or git rev

3.2.1

Build tool (ie. output of mvnw --version or gradlew --version)

mvnw --no-transfer-progress -f pom.xml -Pnative clean package -DskipTest

Additional information

No response

@gpaolopedrazza gpaolopedrazza added the kind/bug Something isn't working label Sep 7, 2023
@gsmet
Copy link
Member

gsmet commented Sep 7, 2023

@loicmathieu could you have a look at this one? I think it’s using your stuff and there is a reproducer. Thanks!

@loicmathieu
Copy link
Contributor

@gpaolopedrazza could you open an issue in this repo https://github.com/quarkiverse/quarkus-google-cloud-services with a reproducer ? There is an issue with Apache Arrow which will be fixed in 1.3 (not yet released last time I checked) and an issue with GraalVM (which will be fixed soon), and an issue with Google GAX (which will be fixed soon) so it's very complex to track all these stuff right now.

So the best is to add you reproducer to the other issue and close this one so I can synchronize all the issues and check when the fix will be integrated that they cover all the use cases.

@gpaolopedrazza
Copy link
Author

I opened quarkiverse/quarkus-google-cloud-services#494 as requested in the message above.

@loicmathieu
Copy link
Contributor

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/native-image kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants