GeezerVison is showing github.com — DEADLINE_EXCEEDED when using Cloud Pub/Sub library from Compute Engine · Issue #1430 · googleapis/google-cloud-java
DEADLINE_EXCEEDED when using Cloud Pub/Sub library from Compute Engine #1430DescriptionWhen using the Cloud Pub/Sub library in a Java application that has been deployed in a Google Compute Engine instance, a DEADLINE_EXCEEDED exception occurs. The application resides in a Docker container within a Container Engine-managed Compute Engine instance. The Pub/Sub topic and the Compute Engine instance are in the same project.
The Compute Engine service account has project editor permissions.
No problems with the old google-api-services-pubsub library.
The code to create the instance looks like this:
InputStream credentialsStream = IOUtils.toInputStream(SERVICE_ACCOUNT_JSON, StandardCharsets.UTF_8);
Credentials credentials = ServiceAccountCredentials.fromStream(credentialsStream);
PubSubOptions options = PubSubOptions.newBuilder().setCredentials(credentials).build();
PubSub pubsub = options.getService();
Then doing something like this (or alternatively, create a topic):
for (Subscription subscription : pubsub.listSubscriptions().getValues()) {
...
}
results in the following:
com.google.cloud.pubsub.PubSubException: io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED
Versions:
google-cloud-pubsub - v0.6.0
google-auth-library-oauth2-http - v0.6.0
google-auth-library-credentials - v0.6.0
google-* - v1.22.0
I also found this issue at Stackoverflow Activitycolintemple commented on Nov 28, 2016 +1. I was the one who asked the question on Stack Overflow.
In my case, the following simple code caused DEADLINE_EXCEEDED errors when run on a Compute Engine instance within the same project as the Pub/Sub topic I wanted to publish to:
PubSub pubSub = PubSubOptions.getDefaultInstance().toBuilder()
.build().getService();
String messageId = pubSub.publish(topic, message);
I could communicate with Pub/Sub using google-api-services-pubsub library, or via gcloud from the command line on the instance. garrettjonesgoogle commented on Nov 29, 2016 I intend on investigating but it will take a couple days due to other commitments. added type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. on Dec 1, 2016timkettering commented on Dec 8, 2016 +1. Encountering this issue with any type of call made w/ the PubSub client. jonatanpettersson commented on Dec 9, 2016 +1. We had to revert back to the API while waiting for a fix to this. BodySplash commented on Dec 14, 2016 +1 I'm trying to find why in the mean time, even if I have no clue. garrettjonesgoogle commented on Dec 14, 2016 BodySplash commented on Dec 14, 2016 So far, not good. I tought maybe I was polling pubsub a bit to aggressively, but It works like a charm on my machine. Maybe a network issue of some sort in the way k8n nodes are configured ? qtxo commented on Dec 15, 2016 I had the same DEADLINE_EXCEEDED problem (for any pubsub request) in my windows 7 laptop, in GCE the same application runs fine. I fixed my problem forcing the Netty version to the one expected by google-cloud 0.8.0 that is 4.1.3.Final.
Before the fix I was using the version 4.1.5.Final as a dependency of vertx-core-3.3.3.jar. (I hope vertx is not affected by this change, but at least I know what the problem is)
I can reproduce DEADLINE_EXCEEDED errors in google-cloud-examples forcing Netty version to 4.1.5.Final or 4.16.Final, look at the pom.xml BodySplash commented on Dec 15, 2016 interesting, I have indeed a version conflict with netty. I'll try to fix my version to 4.1.3. BodySplash commented on Dec 16, 2016 didn't seem to change anything on my side :( garrettjonesgoogle commented on Dec 21, 2016 I was able to make a successful call to Pub/Sub from a docker image on GCE. Could someone who is still having a problem give their pom.xml (or build.gradle as the case may be)? BodySplash commented on Dec 22, 2016 Here you are. I tried de strip this files to the bare minimum.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|