question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DEADLINE_EXCEEDED makes application not receiving messages at all

See original GitHub issue

Environment details

Node.js version: v12.7.0 npm version: 6.10.0 @google-cloud/pubsub version: “^1.0.0”,

Error:

insertId: "gnr3q1fz7eerd" jsonPayload: { level: "error" message: "unhandledRejection" originalError: { ackIds: [1] code: 4 details: "Deadline exceeded" } }

After receiving this error, the app does not receive messages anymore and we have to exit the application to recreate the kubernetes pod.

Any help would be appreciated!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:12
  • Comments:99 (29 by maintainers)

github_iconTop GitHub Comments

9reactions
bcoecommented, Oct 11, 2019

@pwrkpop @npomfret @xoraingroup, rather than rolling back to 0.29.1 of @google-cloud/pubsub I recommend one of the following workarounds:

Using grpc, rather than @grpc/grpc-js

  1. inside your project which uses @google-cloud/pubsub, add the dependency grpc (this is the old gRPC transport layer).
  2. use the following code when creating your library:
const {PubSub} = require('@google-cloud/pubsub');
const grpc = require('grpc');
const pubsub = new PubSub({grpc});

☝️ this same approach can be used for other libraries that use gRPC, e.g.,

const grpc = require('grpc');
const {Logging} = require('@google-cloud/logging');
const logger = new Logging({grpc});

Using the workaround recommended by @Redgwell


const initSubscriber = () => {
  const pubsub = new PubSub();
  const subscription = pubsub.subscription(topic, options);
  subscription.on('message', handler.handleMessage);
  subscription.on('error', e => {
    initSubscriber();  });
};

initSubscriber();

We potentially have a reproduction of the issue described in this thread (thanks @Redgwell for pointing us in the right direction), and will hopefully have a fix out soon that makes either of these workaround unnecessary.

5reactions
WaldoJefferscommented, Oct 7, 2019

I can confirm this after upgrading to PubSub ^1.0.0, all our services stop sending pubsubs after the error occurs.

The full stacktrace is

Retry total timeout exceeded before any response was received Error: Retry total timeout exceeded before any response was received
    at repeat (/app/node_modules/@google-cloud/pubsub/node_modules/google-gax/build/src/normalCalls/retries.js:80:31)
    at Timeout.setTimeout [as _onTimeout] (/app/node_modules/@google-cloud/pubsub/node_modules/google-gax/build/src/normalCalls/retries.js:113:25)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10) 

Can I suggest raising the priority on this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting DEADLINE_EXCEEDED errors on ...
When accessing Cloud Spanner APIs, requests may fail due to “Deadline Exceeded” errors. This error indicates that a response has not been ...
Read more >
gRPC DEADLINE_EXCEEDED even that the server is up ...
Do you set any deadline? ... you'll get DEADLINE_EXCEEDED X milliseconds after you opened a stream (not send or receive any messages!)
Read more >
Handle Context Deadline Exceeded error in Go (Golang)
Setting timeouts on requests is a good practice in a production environment to ensure that you always get a response (or error) in...
Read more >
Connectivity issues after upgrading to OpenShift Container ...
... Get "https://oauth-openshift.apps.openshift.example.com/healthz": context deadline exceeded (Client.Timeout exceeded while awaiting ...
Read more >
Fix problems sending, receiving or connecting to Messages
Learn how to change your default texting app. Make sure your carrier supports SMS, MMS, or RCS messaging. Check your plan or credit...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found