Skip to content

DEADLINE_EXCEEDED when using Cloud Pub/Sub library from Compute Engine #1430

@codemoped

Description

@codemoped

When 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

Metadata

Metadata

Labels

api: coreapi: loggingIssues related to the Cloud Logging API.api: pubsubIssues related to the Pub/Sub API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions