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

Getting IllegalArgumentException: Address types of NameResolver 'unix' for 'pubsub.googleapis.com:443' not supported by transport #2158

Open
MoonOKC opened this issue Sep 3, 2024 · 1 comment
Assignees
Labels
api: pubsub Issues related to the googleapis/java-pubsub API.

Comments

@MoonOKC
Copy link

MoonOKC commented Sep 3, 2024

Deploying GCP Cloud function with Java 17 and <kotlin.version>2.0.20</kotlin.version>
. Have a PubsubClient which tries to build a Publisher from

 <dependency>
            <groupId>com.google.cloud</groupId>
            <artifactId>google-cloud-pubsub</artifactId>
</dependency> 

, and started to have issue with an upgrade in the below bom.

<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.45.0</version>

that bom uses google-cloud-pubsub:1.132.1

and function is working with

<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.44.0</version>

Code example

 private val publisher: Publisher = Publisher.newBuilder(
        TopicName.of(
            System.getenv("PROJECT_ID") ?: "myProjectID",
            System.getenv("TEST_TOPIC_ID") ?: "test-topic"
        )
    ).build()

this build() line references to (PubSubClient.kt:22) mentioned in the below stacktrace

Stack trace

Caused by: java.lang.IllegalArgumentException: Address types of NameResolver 'unix' for 'pubsub.googleapis.com:443' not supported by transport
	at io.grpc.internal.ManagedChannelImplBuilder.getNameResolverProvider(ManagedChannelImplBuilder.java:849)
	at io.grpc.internal.ManagedChannelImplBuilder.build(ManagedChannelImplBuilder.java:699)
	at io.grpc.ForwardingChannelBuilder2.build(ForwardingChannelBuilder2.java:272)
	at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createSingleChannel(InstantiatingGrpcChannelProvider.java:489)
	at com.google.api.gax.grpc.ChannelPool.<init>(ChannelPool.java:106)
	at com.google.api.gax.grpc.ChannelPool.create(ChannelPool.java:84)
	at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:262)
	at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:256)
	at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:236)
	at com.google.cloud.pubsub.v1.stub.GrpcPublisherStub.create(GrpcPublisherStub.java:203)
	at com.google.cloud.pubsub.v1.Publisher.<init>(Publisher.java:202)
	at com.google.cloud.pubsub.v1.Publisher.<init>(Publisher.java:91)
	at com.google.cloud.pubsub.v1.Publisher$Builder.build(Publisher.java:889)
	at com.myCompany.PubSubClient.<init>(PubSubClient.kt:22)
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/java-pubsub API. label Sep 3, 2024
@michaelpri10
Copy link
Contributor

Hello! This appears to be an issues within the underlying gRPC library used by the Pub/Sub Java client. From occurrences of similar issues (e.g., grpc/grpc-java#10853, grpc/grpc-java#10826), this may be an issue caused when building the "fat" jar, specifically when merging the service files. This comment and the following comment regarding the maven-shade-plugin may be helpful here. Please let me know if there are issues with following the linked advice for adjusting the build configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/java-pubsub API.
Projects
None yet
Development

No branches or pull requests

2 participants