grpc-node icon indicating copy to clipboard operation
grpc-node copied to clipboard

Error: No connection established

Open apatora opened this issue 7 years ago • 94 comments

Problem description

Since google-gax forced the grpc-js version to 0.6.4 (https://github.com/googleapis/gax-nodejs/commit/628db9e84c61017dfaba22ac7c2215e2c79c9745), I am having the following issue :

Error: No connection established
    at Http2CallStream.call.on (/usr/src/node_modules/@google-cloud/bigtable/node_modules/@grpc/grpc-js/build/src/call.js:68:41)
    at Http2CallStream.emit (events.js:203:15)
    at Http2CallStream.EventEmitter.emit (domain.js:448:20)
    at process.nextTick (/usr/src/node_modules/@google-cloud/bigtable/node_modules/@grpc/grpc-js/build/src/call-stream.js:75:22)
    at process._tickCallback (internal/process/next_tick.js:61:11)

Reproduction steps

The bug only happens after one hour. We are using grpc-js inside @google-cloud/bigtable and our bigtable instance is autoscaling.

apatora avatar Oct 04 '19 08:10 apatora

Thank you for the report! Just to confirm, does that mean that the script should have an hour of idle time with no network requests to experience that, or just an hour of runtime?

alexander-fenster avatar Oct 04 '19 16:10 alexander-fenster

Similar issue on @google-cloud/[email protected] After about 10 minutes of idle time with no network requests, any call to "publish" callbacks after 10 minutes (maxRetryDelayMillis) to say "Retry total timeout exceeded before any response was received" To be able to find this error "No connection established", I had to add logs in the google-gax module

harscoet avatar Oct 04 '19 16:10 harscoet

We are seeing the exact same issues as @harscoet with @google-cloud/[email protected]

reichjustin avatar Oct 04 '19 16:10 reichjustin

It happens after an hour of runtime (I had this issue on our main API). Then it starts to throw those errors on separate processes progressively.

Capture d’écran 2019-10-04 à 18 21 54

apatora avatar Oct 04 '19 16:10 apatora

Same issue when using @google-cloud/datastore which depends on google-gax

weipublic avatar Oct 04 '19 16:10 weipublic

We are looking into this and will either fix it ASAP, or release an update to google-gax that pins @grpc/grpc-js to an older version.

alexander-fenster avatar Oct 04 '19 17:10 alexander-fenster

Just to make sure I understand, are you making some requests that succeed, then going idle for a while, then making more requests and seeing these errors?

murgatroid99 avatar Oct 04 '19 17:10 murgatroid99

Also, do you folks run your code on a physical machine, or in any kind of cloud e.g. cloud functions?

alexander-fenster avatar Oct 04 '19 17:10 alexander-fenster

@murgatroid99 we are seeing that our services are running fine for 10ish minutes and then we start dropping connections. At this time we see deadline exceeded errors. Once this happens we are unable to have successful requests with both google-cloud/pubsub and google-cloud/datastore

@alexander-fenster we are seeing this using with services running within GKE containers

reichjustin avatar Oct 04 '19 17:10 reichjustin

We downgraded @grpc/grpc-js to 0.5.4 and also other related google libraries to a version that don't depend on @grpc/[email protected]. The problem seems gone. It may related to #1062 & #1061

weipublic avatar Oct 04 '19 18:10 weipublic

If my fix is right, this problem was actually in #1015 but it was overshadowed by other problems.

murgatroid99 avatar Oct 04 '19 18:10 murgatroid99

I have published version 0.6.5 of @grpc/grpc-js. You should pick it up if you update your dependencies. Please try that and see if it solves this problem.

murgatroid99 avatar Oct 04 '19 21:10 murgatroid99

@apatora @harscoet @reichjustin @weipublic Could you folks please check if the fix in v0.6.5 works for you all, and let us know? Thank you!

alexander-fenster avatar Oct 05 '19 00:10 alexander-fenster

@alexander-fenster I tried v0.6.5 and I still have the issue. Lots of Error: No connection established after an hour of runtime.

apatora avatar Oct 05 '19 10:10 apatora

Same here, with DataStore and PubSub, 0.6.5 doesn't fix the issue

Vinceveve avatar Oct 07 '19 13:10 Vinceveve

Same issues for us when using @google-cloud/datastore which depends on google-gax

bendoran avatar Oct 07 '19 14:10 bendoran

Can someone seeing this issue with grpc-js 0.6.5 run with the environment variables GRPC_TRACE=all and GRPC_VERBOSITY=DEBUG and share the log output? If you can't set environment variables the normal way you can set those on process.env before loading any libraries.

murgatroid99 avatar Oct 07 '19 17:10 murgatroid99

I would also like to understand how exactly this problem is manifesting. Are you seeing one or a few errors and then later calls succeed? Or do you see this error and then all subsequent calls fail with the same error? Or something else?

murgatroid99 avatar Oct 07 '19 18:10 murgatroid99

would be reasonable to suggest using pinned @grpc/grpc-js versions ? just to avoid a large impact when those sensitive dependencies run into issues.

rvillane avatar Oct 07 '19 19:10 rvillane

We have seen those errors starting to occur around 1 hour after a fresh pod creation. After those started, all subsequent calls were starting to fail. Pintpointing lib to previous working version (0.5.2) resolved the issue. (using google Firestore)

Meemaw avatar Oct 07 '19 20:10 Meemaw