googleapis / google-cloud-java

Google Cloud Client Library for Java
https://cloud.google.com/java/docs/reference
Apache License 2.0
1.89k stars 1.06k forks source link

PubSub -Unknown Host #7277

Closed henry-aj-jones closed 2 years ago

henry-aj-jones commented 4 years ago

I have an issue when I try and publish a message to gcp pubsub:

Environment details

OS type and version:

Red Hat Linux

Java version:

OpenJDK Runtime Environment (build 1.8.0_252-b09) OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

  1. google-cloud-java version(s):

    1.2.3.RELEASE org.springframework.cloud spring-cloud-gcp-starter-pubsub

Looking at mvn dependency:tree

[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.2.5.RELEASE:compile [INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:2.2.5.RELEASE:compile [INFO] | | +- org.springframework:spring-aop:jar:5.2.4.RELEASE:compile [INFO] | | - org.aspectj:aspectjweaver:jar:1.9.5:compile [INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.2.5.RELEASE:compile [INFO] | | +- com.zaxxer:HikariCP:jar:3.4.2:compile [INFO] | | - org.springframework:spring-jdbc:jar:5.2.4.RELEASE:compile [INFO] | +- jakarta.activation:jakarta.activation-api:jar:1.2.2:compile [INFO] | +- jakarta.persistence:jakarta.persistence-api:jar:2.2.3:compile [INFO] | +- jakarta.transaction:jakarta.transaction-api:jar:1.3.3:compile [INFO] | +- org.hibernate:hibernate-core:jar:5.4.12.Final:compile [INFO] | | +- org.jboss.logging:jboss-logging:jar:3.4.1.Final:compile [INFO] | | +- org.javassist:javassist:jar:3.24.0-GA:compile [INFO] | | +- net.bytebuddy:byte-buddy:jar:1.10.8:compile [INFO] | | +- antlr:antlr:jar:2.7.7:compile [INFO] | | +- org.jboss:jandex:jar:2.1.1.Final:compile [INFO] | | +- com.fasterxml:classmate:jar:1.5.1:compile [INFO] | | +- org.dom4j:dom4j:jar:2.1.1:compile [INFO] | | +- org.hibernate.common:hibernate-commons-annotations:jar:5.1.0.Final:compile [INFO] | | - org.glassfish.jaxb:jaxb-runtime:jar:2.3.2:compile [INFO] | | +- org.glassfish.jaxb:txw2:jar:2.3.2:compile [INFO] | | +- com.sun.istack:istack-commons-runtime:jar:3.0.8:compile [INFO] | | +- org.jvnet.staxex:stax-ex:jar:1.8.1:compile [INFO] | | - com.sun.xml.fastinfoset:FastInfoset:jar:1.2.16:compile [INFO] | +- org.springframework.data:spring-data-jpa:jar:2.2.5.RELEASE:compile [INFO] | | +- org.springframework.data:spring-data-commons:jar:2.2.5.RELEASE:compile [INFO] | | +- org.springframework:spring-orm:jar:5.2.4.RELEASE:compile [INFO] | | +- org.springframework:spring-tx:jar:5.2.4.RELEASE:compile [INFO] | | - org.springframework:spring-beans:jar:5.2.4.RELEASE:compile [INFO] | - org.springframework:spring-aspects:jar:5.2.4.RELEASE:compile [INFO] +- mysql:mysql-connector-java:jar:8.0.18:compile [INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:2.2.5.RELEASE:compile [INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.2.5.RELEASE:compile [INFO] | | +- org.springframework.boot:spring-boot:jar:2.2.5.RELEASE:compile [INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.2.5.RELEASE:compile [INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:2.2.5.RELEASE:compile [INFO] | | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile [INFO] | | | | - ch.qos.logback:logback-core:jar:1.2.3:compile [INFO] | | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.12.1:compile [INFO] | | | | - org.apache.logging.log4j:log4j-api:jar:2.12.1:compile [INFO] | | | - org.slf4j:jul-to-slf4j:jar:1.7.30:compile [INFO] | | +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile [INFO] | | - org.yaml:snakeyaml:jar:1.25:runtime [INFO] | +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.2.5.RELEASE:compile [INFO] | | +- org.springframework.boot:spring-boot-actuator:jar:2.2.5.RELEASE:compile [INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.10.2:compile [INFO] | | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.10.2:compile [INFO] | | | - com.fasterxml.jackson.core:jackson-core:jar:2.10.2:compile [INFO] | | - com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.10.2:compile [INFO] | - io.micrometer:micrometer-core:jar:1.3.5:compile [INFO] | +- org.hdrhistogram:HdrHistogram:jar:2.1.11:compile [INFO] | - org.latencyutils:LatencyUtils:jar:2.0.3:compile [INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.2.5.RELEASE:compile [INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.2.5.RELEASE:compile [INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.10.2:compile [INFO] | | - com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.10.2:compile [INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.2.5.RELEASE:compile [INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.31:compile [INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.31:compile [INFO] | | - org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.31:compile [INFO] | +- org.springframework.boot:spring-boot-starter-validation:jar:2.2.5.RELEASE:compile [INFO] | | +- jakarta.validation:jakarta.validation-api:jar:2.0.2:compile [INFO] | | - org.hibernate.validator:hibernate-validator:jar:6.0.18.Final:compile [INFO] | +- org.springframework:spring-web:jar:5.2.4.RELEASE:compile [INFO] | - org.springframework:spring-webmvc:jar:5.2.4.RELEASE:compile [INFO] | - org.springframework:spring-expression:jar:5.2.4.RELEASE:compile [INFO] +- org.springframework.cloud:spring-cloud-gcp-starter-pubsub:jar:1.2.3.RELEASE:compile [INFO] | +- org.springframework.cloud:spring-cloud-gcp-starter:jar:1.2.3.RELEASE:compile [INFO] | | +- org.springframework.cloud:spring-cloud-gcp-core:jar:1.2.3.RELEASE:compile [INFO] | | | - com.google.cloud:google-cloud-core:jar:1.93.4:compile [INFO] | | | +- com.google.protobuf:protobuf-java-util:jar:3.11.4:compile [INFO] | | | +- com.google.auth:google-auth-library-credentials:jar:0.20.0:compile [INFO] | | | +- com.google.auth:google-auth-library-oauth2-http:jar:0.20.0:compile [INFO] | | | - com.google.http-client:google-http-client-jackson2:jar:1.35.0:compile [INFO] | | - org.springframework.cloud:spring-cloud-gcp-autoconfigure:jar:1.2.3.RELEASE:compile [INFO] | +- org.springframework.cloud:spring-cloud-gcp-pubsub:jar:1.2.3.RELEASE:compile [INFO] | | - com.google.cloud:google-cloud-pubsub:jar:1.105.0:compile [INFO] | | +- io.grpc:grpc-api:jar:1.29.0:compile [INFO] | | | +- io.grpc:grpc-context:jar:1.29.0:compile [INFO] | | | - org.codehaus.mojo:animal-sniffer-annotations:jar:1.18:compile [INFO] | | +- io.grpc:grpc-stub:jar:1.29.0:compile [INFO] | | +- io.grpc:grpc-protobuf:jar:1.29.0:compile [INFO] | | | - io.grpc:grpc-protobuf-lite:jar:1.29.0:compile [INFO] | | +- com.google.api:api-common:jar:1.9.0:compile [INFO] | | | - javax.annotation:javax.annotation-api:jar:1.3.2:compile [INFO] | | +- com.google.protobuf:protobuf-java:jar:3.11.4:compile [INFO] | | +- com.google.api.grpc:proto-google-common-protos:jar:1.17.0:compile [INFO] | | +- com.google.api.grpc:proto-google-cloud-pubsub-v1:jar:1.87.0:compile [INFO] | | +- com.google.api.grpc:proto-google-iam-v1:jar:0.13.0:compile [INFO] | | +- com.google.guava:guava:jar:29.0-android:compile [INFO] | | | +- com.google.guava:failureaccess:jar:1.0.1:compile [INFO] | | | +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile [INFO] | | | +- org.checkerframework:checker-compat-qual:jar:2.5.5:compile [INFO] | | | - com.google.j2objc:j2objc-annotations:jar:1.3:compile [INFO] | | +- com.google.api:gax:jar:1.56.0:compile [INFO] | | +- com.google.api:gax-grpc:jar:1.56.0:compile [INFO] | | | +- io.grpc:grpc-auth:jar:1.29.0:compile [INFO] | | | +- io.grpc:grpc-netty-shaded:jar:1.29.0:compile [INFO] | | | - io.grpc:grpc-alts:jar:1.29.0:compile [INFO] | | | +- io.grpc:grpc-grpclb:jar:1.29.0:compile [INFO] | | | - org.conscrypt:conscrypt-openjdk-uber:jar:2.2.1:compile [INFO] | | +- org.threeten:threetenbp:jar:1.4.3:compile [INFO] | | +- com.google.code.findbugs:jsr305:jar:3.0.2:compile [INFO] | | +- io.opencensus:opencensus-api:jar:0.26.0:compile [INFO] | | +- io.grpc:grpc-core:jar:1.29.0:compile [INFO] | | | +- com.google.android:annotations:jar:4.1.1.4:compile [INFO] | | | - io.perfmark:perfmark-api:jar:0.19.0:compile [INFO] | | +- com.google.errorprone:error_prone_annotations:jar:2.3.4:compile [INFO] | | +- com.google.auto.value:auto-value-annotations:jar:1.7:compile [INFO] | | - com.google.http-client:google-http-client:jar:1.35.0:compile [INFO] | | - io.opencensus:opencensus-contrib-http-util:jar:0.24.0:compile [INFO] | - org.slf4j:slf4j-api:jar:1.7.30:compile [INFO] +- org.springframework.boot:spring-boot-starter-amqp:jar:2.2.5.RELEASE:compile [INFO] | +- org.springframework:spring-messaging:jar:5.2.4.RELEASE:compile [INFO] | - org.springframework.amqp:spring-rabbit:jar:2.2.5.RELEASE:compile [INFO] | - org.springframework.amqp:spring-amqp:jar:2.2.5.RELEASE:compile [INFO] +- org.springframework.amqp:spring-rabbit-junit:jar:2.2.5.RELEASE:test [INFO] | +- com.rabbitmq:amqp-client:jar:5.7.3:compile [INFO] | +- com.rabbitmq:http-client:jar:3.2.0.RELEASE:test [INFO] | +- org.assertj:assertj-core:jar:3.13.2:test [INFO] | +- org.springframework:spring-core:jar:5.2.4.RELEASE:compile [INFO] | | - org.springframework:spring-jcl:jar:5.2.4.RELEASE:compile [INFO] | - org.springframework:spring-test:jar:5.2.4.RELEASE:compile [INFO] +- org.springframework.amqp:spring-rabbit-test:jar:2.2.5.RELEASE:test [INFO] | +- org.hamcrest:hamcrest-core:jar:2.1:compile [INFO] | +- org.hamcrest:hamcrest-library:jar:2.1:test [INFO] | - org.mockito:mockito-core:jar:3.1.0:test [INFO] | +- net.bytebuddy:byte-buddy-agent:jar:1.10.8:test [INFO] | - org.objenesis:objenesis:jar:2.6:test [INFO] +- org.springframework.boot:spring-boot-starter-integration:jar:2.2.5.RELEASE:compile [INFO] | - org.springframework.integration:spring-integration-core:jar:5.2.4.RELEASE:compile [INFO] | +- io.projectreactor:reactor-core:jar:3.3.3.RELEASE:compile [INFO] | | - org.reactivestreams:reactive-streams:jar:1.0.3:compile [INFO] | - org.springframework.retry:spring-retry:jar:1.2.5.RELEASE:compile [INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.2.5.RELEASE:test [INFO] | +- org.springframework.boot:spring-boot-test:jar:2.2.5.RELEASE:test [INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.2.5.RELEASE:test [INFO] | +- com.jayway.jsonpath:json-path:jar:2.4.0:test [INFO] | | - net.minidev:json-smart:jar:2.3:test [INFO] | | - net.minidev:accessors-smart:jar:1.2:test [INFO] | | - org.ow2.asm:asm:jar:5.0.4:test [INFO] | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2:compile [INFO] | +- org.junit.jupiter:junit-jupiter:jar:5.5.2:test [INFO] | | +- org.junit.jupiter:junit-jupiter-params:jar:5.5.2:test [INFO] | | - org.junit.jupiter:junit-jupiter-engine:jar:5.5.2:test [INFO] | | - org.junit.platform:junit-platform-engine:jar:1.5.2:test [INFO] | +- org.mockito:mockito-junit-jupiter:jar:3.1.0:test [INFO] | +- org.hamcrest:hamcrest:jar:2.1:compile [INFO] | +- org.skyscreamer:jsonassert:jar:1.5.0:test [INFO] | | - com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test [INFO] | - org.xmlunit:xmlunit-core:jar:2.6.3:test [INFO] +- org.apache.commons:commons-lang3:jar:3.9:compile [INFO] +- org.testcontainers:mysql:jar:1.12.5:compile [INFO] | - org.testcontainers:jdbc:jar:1.12.5:compile [INFO] | - org.testcontainers:database-commons:jar:1.12.5:compile [INFO] +- org.testcontainers:junit-jupiter:jar:1.14.2:compile [INFO] | +- org.testcontainers:testcontainers:jar:1.14.2:compile [INFO] | | +- junit:junit:jar:4.12:compile [INFO] | | +- org.jetbrains:annotations:jar:19.0.0:compile [INFO] | | +- org.apache.commons:commons-compress:jar:1.20:compile [INFO] | | +- org.rnorth.duct-tape:duct-tape:jar:1.0.8:compile [INFO] | | +- org.rnorth.visible-assertions:visible-assertions:jar:2.1.2:compile [INFO] | | +- org.rnorth:tcp-unix-socket-proxy:jar:1.0.2:compile [INFO] | | | +- com.kohlschutter.junixsocket:junixsocket-native-common:jar:2.0.4:compile [INFO] | | | | - org.scijava:native-lib-loader:jar:2.0.2:compile [INFO] | | | - com.kohlschutter.junixsocket:junixsocket-common:jar:2.0.4:compile [INFO] | | - net.java.dev.jna:jna-platform:jar:4.5.2:compile [INFO] | | - net.java.dev.jna:jna:jar:4.5.2:compile [INFO] | - org.junit.jupiter:junit-jupiter-api:jar:5.5.2:compile [INFO] | +- org.apiguardian:apiguardian-api:jar:1.1.0:compile [INFO] | +- org.opentest4j:opentest4j:jar:1.2.0:compile [INFO] | - org.junit.platform:junit-platform-commons:jar:1.5.2:compile [INFO] +- net.mohc.testingtools:testingtools:jar:1.0.0:compile [INFO] | - org.springframework:spring-context:jar:5.2.4.RELEASE:compile [INFO] +- com.konghq:unirest-java:jar:standalone:3.7.02:compile [INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.11:compile [INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.4.13:compile [INFO] | | - commons-codec:commons-codec:jar:1.13:compile [INFO] | +- org.apache.httpcomponents:httpmime:jar:4.5.11:compile [INFO] | +- org.apache.httpcomponents:httpcore-nio:jar:4.4.13:compile [INFO] | +- org.apache.httpcomponents:httpasyncclient:jar:4.1.4:compile [INFO] | - com.google.code.gson:gson:jar:2.8.6:compile [INFO] +- io.github.resilience4j:resilience4j-core:jar:1.4.0:compile [INFO] | - io.vavr:vavr:jar:0.10.2:compile [INFO] | - io.vavr:vavr-match:jar:0.10.2:compile [INFO] +- io.github.resilience4j:resilience4j-retry:jar:1.4.0:compile [INFO] +- io.github.resilience4j:resilience4j-circuitbreaker:jar:1.4.0:compile [INFO] - io.github.resilience4j:resilience4j-timelimiter:jar:1.4.0:compile

Stack trace

com.google.api.gax.rpc.UnavailableException: io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
    at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:69)
    at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72)
    at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60)
    at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:97)
    at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)
    at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1050)
    at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30)
    at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1176)
    at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:969)
    at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:760)
    at io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:526)
    at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:501)
    at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
    at io.grpc.internal.ClientCallImpl.access$500(ClientCallImpl.java:66)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:689)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$900(ClientCallImpl.java:577)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:751)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:740)
    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
    at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
    at io.grpc.Status.asRuntimeException(Status.java:533)
    ... 16 common frames omitted
Caused by: io.grpc.netty.shaded.io.netty.channel.AbstractChannel$AnnotatedSocketException: Network is unreachable: pubsub.googleapis.com/2a00:1450:4009:818:0:0:0:200a:443
Caused by: java.net.SocketException: Network is unreachable
    at sun.nio.ch.Net.connect0(Native Method)
    at sun.nio.ch.Net.connect(Net.java:454)
    at sun.nio.ch.Net.connect(Net.java:446)
    at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:645)
    at io.grpc.netty.shaded.io.netty.util.internal.SocketUtils$3.run(SocketUtils.java:91)
    at io.grpc.netty.shaded.io.netty.util.internal.SocketUtils$3.run(SocketUtils.java:88)
    at java.security.AccessController.doPrivileged(Native Method)
    at io.grpc.netty.shaded.io.netty.util.internal.SocketUtils.connect(SocketUtils.java:88)
    at io.grpc.netty.shaded.io.netty.channel.socket.nio.NioSocketChannel.doConnect(NioSocketChannel.java:315)
    at io.grpc.netty.shaded.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.connect(AbstractNioChannel.java:248)
    at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.connect(DefaultChannelPipeline.java:1342)
    at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:548)
    at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:533)
    at io.grpc.netty.shaded.io.netty.channel.ChannelDuplexHandler.connect(ChannelDuplexHandler.java:54)
    at io.grpc.netty.shaded.io.grpc.netty.WriteBufferingAndExceptionHandler.connect(WriteBufferingAndExceptionHandler.java:150)
    at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:548)
    at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.access$1000(AbstractChannelHandlerContext.java:61)
    at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext$9.run(AbstractChannelHandlerContext.java:538)
    at io.grpc.netty.shaded.io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
    at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
    at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
    at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)

With: java.net.preferIPv4Stack=true

com.google.api.gax.rpc.UnknownException: io.grpc.StatusRuntimeException: UNKNOWN: Channel Pipeline: [WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
    at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:47)
    at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72)
    at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60)
    at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:97)
    at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)
    at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1050)
    at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30)
    at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1176)
    at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:969)
    at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:760)
    at io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:526)
    at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:501)
    at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
    at io.grpc.internal.ClientCallImpl.access$500(ClientCallImpl.java:66)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:689)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$900(ClientCallImpl.java:577)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:751)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:740)
    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
    at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: io.grpc.StatusRuntimeException: UNKNOWN: Channel Pipeline: [WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
    at io.grpc.Status.asRuntimeException(Status.java:533)
    ... 16 common frames omitted
Caused by: io.grpc.netty.shaded.io.netty.channel.ChannelPipelineException: io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$ClientTlsHandler.handlerAdded() has thrown an exception; removed.
    at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:624)
    at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.replace(DefaultChannelPipeline.java:572)
    at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.replace(DefaultChannelPipeline.java:515)
    at io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$ProtocolNegotiationHandler.fireProtocolNegotiationEvent(ProtocolNegotiators.java:767)
    at io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$WaitUntilActiveHandler.channelActive(ProtocolNegotiators.java:676)
    at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:230)
    at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:216)
    at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelActive(AbstractChannelHandlerContext.java:209)
    at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.channelActive(DefaultChannelPipeline.java:1398)
    at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:230)
    at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:216)
    at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.fireChannelActive(DefaultChannelPipeline.java:895)
    at io.grpc.netty.shaded.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:305)
    at io.grpc.netty.shaded.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:335)
    at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:702)
    at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
    at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
    at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
    at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    ... 1 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/alpn/ALPN$Provider
    at io.grpc.netty.shaded.io.netty.handler.ssl.JettyAlpnSslEngine.newClientEngine(JettyAlpnSslEngine.java:55)
    at io.grpc.netty.shaded.io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator$AlpnWrapper.wrapSslEngine(JdkAlpnApplicationProtocolNegotiator.java:142)
    at io.grpc.netty.shaded.io.netty.handler.ssl.JdkSslContext.configureAndWrapEngine(JdkSslContext.java:360)
    at io.grpc.netty.shaded.io.netty.handler.ssl.JdkSslContext.newEngine(JdkSslContext.java:335)
    at io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$ClientTlsHandler.handlerAdded0(ProtocolNegotiators.java:348)
    at io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$ProtocolNegotiationHandler.handlerAdded(ProtocolNegotiators.java:726)
    at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:971)
    at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:609)
    ... 21 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.alpn.ALPN$Provider
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:92)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    ... 29 common frames omitted

External references such as API reference guides used

This is using the spring boot GCP libs

Any additional information below

Thanks!

suztomo commented 4 years ago

For ClassNotFoundException, we develop a tool called Linkage Checker. Would you try this?

https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/Linkage-Checker-Enforcer-Rule

anguillanneuf commented 2 years ago

@henry-aj-jones Thanks for your patience.

Spring Cloud GCP is no longer part of the Spring Cloud release train since June, 2021.

The compatibility with Spring Cloud/Spring Boot/Spring Framework versions and Spring Cloud GCP versions is outlined here.

Please check out this migration guide for migrating from Spring Cloud GCP 1.x to 2.x.

For spring-cloud-gcp-starter-pubsub specifically, you can also check out these examples and this tutorial.