nodejs-pubsub
nodejs-pubsub copied to clipboard
"Failed to connect before the deadline" error
Environment details
- OS: Debian GNU/Linux 9
- Node.js version: v10.22.1
- npm version: 6.14.10
@google-cloud/pubsubversion: ^2.18.1
Steps to reproduce
- Create subscription
import pb from '@google-cloud/pubsub';
const Pubsub = pb.PubSub;
const pubSubClient = new Pubsub();
// ***
const subscription = pubSubClient.subscription("some-name");
- Start worker
npm run start - After 30 hours. Errors appear "Failed to connect before the deadline"
@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 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);
}
@feywind enough data?
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
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 :-(
I'm pretty sure this is related to the ongoing set of issues around the grpc stream disconnecting silently.
Linked to the meta-issue about transport problems: b/242894947
Ping, the meta-issue above is still under investigation.
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!