nodejs-pubsub icon indicating copy to clipboard operation
nodejs-pubsub copied to clipboard

"Failed to connect before the deadline" error

Open AkioSarkiz opened this issue 4 years ago • 7 comments

Environment details

  • OS: Debian GNU/Linux 9
  • Node.js version: v10.22.1
  • npm version: 6.14.10
  • @google-cloud/pubsub version: ^2.18.1

Steps to reproduce

  1. Create subscription
import pb from '@google-cloud/pubsub';

const Pubsub = pb.PubSub;
const pubSubClient = new Pubsub();
// ***
const subscription = pubSubClient.subscription("some-name");
  1. Start worker npm run start
  2. After 30 hours. Errors appear "Failed to connect before the deadline"

issue 2019 year

AkioSarkiz avatar Oct 08 '21 13:10 AkioSarkiz

@AkioSarkiz I'd like to try to reproduce this on my test setup, but I wonder if you could provide a more complete reproduction sample. e.g. how you're listening to the subscription, any PubSub constructor parameters, etc.

feywind avatar Oct 14 '21 20:10 feywind

@feywind More context

import pb from '@google-cloud/pubsub';
// another

const Pubsub = pb.PubSub;

const SCOPES = ['https://www.googleapis.com/auth/gmail.modify'];
const TOKEN_PATH = 'token.json';
const SUBSCRIPTIONNAME = 'projects/some-project/subscriptions/some-project-sub';

export const subscribeToMassages = async() => {
  watchMailEver()
  const pubSubClient = new Pubsub();
  const subscription = pubSubClient.subscription(SUBSCRIPTIONNAME);
  const messageHandler = async message => {
      // logic
  };
  subscription.on('message', messageHandler);
}

AkioSarkiz avatar Oct 18 '21 11:10 AkioSarkiz

@feywind enough data?

AkioSarkiz avatar Nov 02 '21 09:11 AkioSarkiz

Hi all, I have the same problem from some weeks ago with different nodejs and pubsub versions.

Currently I'm using nodejs 12.19.0 and pubsub nodejs library v2.18.4.

It happens after different time frames.

Do you have some fix to this behaviour?

Thanks in advance

avalverdero avatar Dec 24 '21 15:12 avalverdero

We are having same issue - within 24 hours window the subscription stops receiving new messages and those are messages we can find in logs... We can't go to production with behavior :-(

vk185065 avatar Feb 15 '22 08:02 vk185065

I'm pretty sure this is related to the ongoing set of issues around the grpc stream disconnecting silently.

feywind avatar Mar 24 '22 19:03 feywind

Linked to the meta-issue about transport problems: b/242894947

feywind avatar Aug 17 '22 20:08 feywind

Ping, the meta-issue above is still under investigation.

feywind avatar Apr 03 '23 19:04 feywind

We have not been able to find a general way to approach debugging these problems, but instead have required customer-specific investigations around their setup. Please enter a support case with all of the details of your clients and the environments in which they run in order to continue the investigation. Thanks!

kamalaboulhosn avatar Jun 20 '23 18:06 kamalaboulhosn