-
Notifications
You must be signed in to change notification settings - Fork 598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Endpoint read failed at /user_code/node_modules/@google-cloud/logging/node_modules/grpc/src/node/src/client.js:569:15 #2438
Comments
@ofrobots ever run into anything like this before? |
As an update, it seems to be more of an issue the first time a call is made to Stackdriver after a Firebase function is updated and restarted. Subsequent requests seem to go through ok. Although it does re-emerge sporadically. We really haven't been able to get to the bottom of it. Unfortunately, this causes the functions to timeout and throw an "Unhandled Exception", which is not going to work for us in production. So unless we can resolve this issue, we will have to replace Stackdriver with another logger. |
Here is one log entry where we see this...
|
I've been wondering if we're setting metadata incorrectly or something because of the But here's another one where it doesn't have that...
|
/cc @GoogleCloudPlatform/node-team @murgatroid99 |
The error indicates a TCP read error – which suggests that sporadically there are some network issues in the environment? |
@swalkowski @jasonpolites: any ideas if this could be an issue on Functions? |
@ofrobots Just so future readers are 100% clear on this... This code is being run as Firebase Functions, so it's 100% within the Google Cloud environment. |
Note: the part with the metadata is probably irrelevant. That is trailing response metadata, which is often empty. |
It seems like the gRPC client successfully establishes a TCP connection (if it didn't, the error would say "Connect failed"), then the first attempt to read from that TCP connection fails for some reason, and the request it was a part of failed. It might help to see more details of the TCP error, but that doesn't propagate far enough up the stack. It is possible to see it (along with a torrent of other information) by setting the environment variables |
@murgatroid99 any idea how to set an env var like that with Firebase Functions...or through the Cloud Function console? Put it in runtime.config.json? |
I am not familiar with Cloud Functions, but you should just be able to do |
We were experimenting with a few things and one thing we try is moving If ok, can we leave this open for a couple of days so that I can report back on if that fixed it or not? If that is in fact the issue, then Firebase may want to update their docs: https://firebase.google.com/docs/functions/reporting-errors#importing_dependencies |
Update: since we moved So I believe we have enough sample data to declare that a fix. Now whether or not that TCP error should in fact happen, is up to you guys to determine :-) I'm good to close this, but I'll let you guys at Google decide if it should be closed, since you probably want to get the Firebase guys to update their docs (https://firebase.google.com/docs/functions/reporting-errors#importing_dependencies) and their sample (https://github.com/firebase/functions-samples/blob/master/stripe/functions/index.js) I also logged an issue pointing to this issue for firebase: firebase/functions-samples#194 |
There are some related issues with other GCP node modules related to auth tokens expiring, which fits with the "fix" of moving initialization to function-scope, but does not fit with the "we only see if after re-deploy". On the other hand, network issues experienced at startup only might be related to slower-than-expected spool up of network resources, but that doesn't fit with the behavior of the "fix". More investigation on our (Google) end needed methinks. |
For me 'Error: "Endpoint read failed"' is often reported in Stackdriver when I call the Spanner API from a GCP Function which has been erroneously deployed with local node_modules from my computer (instead of allowing GCP to create the dependencies). |
We are deploying via Firebase and accoriding to this link, "If you are deploying through the Firebase CLI, the local node_modules folder will be ignored, and you must specify your dependencies in package.json" |
I get the error occasionally even with the correct deps. Yesterday was especially bad. This morning the error has been replaced with '"Function execution took 242 ms, finished with status: 'connection error'"' and the last log before that is the call to database.runTransaction. I do some more investigation and post the results here |
I have issues using GCP Functions and Spanner with JS client 0.7.1. I sometimes receive errors invoking GCP Functions through Postman or using the testing screen from within the GCP Functions web console. The same Function works fine if I invoke it locally during periods when errors are occurring with the remote code. This happens around 5-10% of the time but it is not consistent, sometimes there are periods of no errors. I am initializing the JS client using these instructions "https://cloud.google.com/spanner/docs/getting-started/nodejs/". At the moment the error seems to happen when the Function is cold i.e. after running it a few times with no errors, wait for 10min or so, run it again and see the errors, run it a few more times and see no errors. The errors are: database.runTransaction |
Thanks to all for explaining their situations in great detail. Please correct any mistakes I might make in my assumptions:
@8357753 -- you elaborated on your situation further in #2489, and a few others are involved in a discussion, so we'll pursue the specifics there. @jasonpolites -- do you still think there needs to be an investigation? Without much experience with GCF, my best interpretation of the situation now is that GCF is doing some type of caching of either old code or stale gRPC connections. If that's the case, I don't think we can solve much from GCN. If that's not the case, any help getting me up to speed on how I might be looking at this wrong would be appreciated. Thanks! |
Yeah, there's an internal bug on cloud functions here. They're doing some things to increase a timeout, but this issue absolutely still exists. |
@JustinBeckwith does that also apply to GAE NodeJS8 Standard Environment as well? |
Possibly. Are you seeing a similar callstack in an app engine standard app? cc @steren |
I can't remember/find the stack trace I'm afraid (I starred this issue after this comment I originally came here because of googleapis/nodejs-logging-winston#190, and just reverted back to a previous version of @google-cloud/logging-winston. |
@JustinBeckwith fwiw I am having this issue in GAE Standard with node 10. Do you know if there is an open issue within google/or their issue tracker? I am using the nodejs-logging-winston and see the TCP read failed and at the same time my redis connection to a GCE instance also has problems and gets a ECONNRESET.
Is it an issue in how internal communication is handled? |
Not sure if this is unrelated, since the original issue was related to logging Recently, we've been getting these more in our Node 8 cloud functions. We've isolated it down to a part of the code that writes to Firestore. It may be coincidental, but there seems to be a pattern. We tend to get this error in batches (i.e., many of them around the same time and then it stops). It also tends to happen around the time our app's load spikes. I have a hypothesis that during traffic bursts there may be some issue setting up resources as instances our scaled? Just a wild guess...
|
Edit: I was wrong |
Any work arounds for this issue? |
Not currently, but we're making progress on a fix |
Hi folks, We made some changes in @grpc/grpc-js grpc/grpc-node#1021 that might fix the problem described here. They are releases as v0.5.3. Can I bother you updating, checking if the issue is still here with v0.5.3, and sending the stack trace back if something still does not work? Thanks! |
@deremer 👋 hey, I just wanted to check in and see if @alexander-fenster's changes in |
We haven’t had a release to deploy with updated dependencies yet. I will report back once we do so and get some data. Lots of other folks on here too so they might see results sooner. |
@deremer @juanparadox @kyle-mccarthy, can you folks confirm that the latest release of |
@deremer I'm going to go ahead and close this issue, because it's been almost a month, and seems like things have been working okay for folks. Please feel free to re-open if you are continuing to bump into these issues. |
This error popped up this morning for the first time.
|
Greetings! Could you open a new issue with details? |
We are using Stack Driver to log errors for Firebase functions. We unpredictably get the error in the title. Typically it happens the first to we try to log an error after a function re-deploys. Subsequent error log writes will go through to StackDriver without issue, but occasionally we'll get the error again.
We're using
"@google-cloud/logging": "^1.0.2",
and deployed via Firebase Functions.Below is our module that implements the logging...
Anybody have any idea what is causing this?
The text was updated successfully, but these errors were encountered: