-
Notifications
You must be signed in to change notification settings - Fork 227
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 [ERR_STREAM_WRITE_AFTER_END]: write after end #825
Comments
@glesage thanks for reporting! Do you know when this error starting popping up? Did it start after a dependency update or was it there from the start? Also do you have any insight as to whether this might be coming from the publisher or the subscriber? |
This started happening for us when we rolled out version 1.1.5 a few days ago. Before then we were at 0.21.1 so pretty big bump indeed Unfortunately I do not know for certain because the app that uses this is both a subscriber and publisher and the stack traces are very un-helpful /: No matter how many try catch blocks we add temporarily to debug they never seem to trigger and our app just crashes without correctly handling this error |
We are actually able to go up to v0.29.1 without this issue happening so it seems possible that v0.30.0 introduced it (or exposed it) - https://github.com/googleapis/nodejs-pubsub/releases/tag/v0.30.0 Maybe one of the changes to grpc extensions & dependencies has something to do with it. Will try to identify more clearly where it gets thrown tomorrow |
We've reverted to version 0.29.1 for now and been using for a week with no issues. Hopefully we'll find some time to debug this some more so we can upgrade but may be a while. Just throwing it out there for those who might be able to (: |
As a quick note just ran another test of this and still happening with 1.5.0 |
Hello, I can confirm the same behaviour. This usually happens after a couple of hours. After restarting the application everything works fine again. (v1.3) |
Yeah, and this happened in 0.30.0, too: We're looking at just reverting back to the gRPC C++ bindings for now. I'm talking with some folks on Monday before we commit to that. In the meantime, it's possible to manually switch to them and see if it helps:
|
Is this still an ongoing problem for everyone? I'm hoping to get us onto grpc-js 1.x soon. That library has really stabilized lately, and is no longer considered beta, so it may help with anything that gRPC C++ previously helped with. |
Yess. This issue is affecting a user running @google-cloud/pubsub v1.5.0 |
I spoke with @megaz94 separately, but I wanted to check once more on this - |
We're also seeing this in @google-cloud/pubsub v1.5.0 too |
We are still seeing this error on 2.0.0 |
@glesage @naugtur @matetukacs Can you all describe the character of data being sent and received which is problematic? To unpack that question a bit, I'm asking for e.g. the size of messages, the frequency of message, the length of time before the problem typically happens. That error stack looks like something from In general, it sort of looks like the HTTP/2 connection is getting closed on us and we don't realize it, and then we try to write more. The disconnection happens naturally at about 30 minutes in, and we're supposed to be catching that and restarting it. (There was a bug recently about that, which is why I was asking about the character of messages above.) |
Regardless, a similar issue was filed in the google-gax repository and it looks like grpc/grpc-node#1436 will address it. |
I think the |
Experiencing this issue on 2.1.0 |
Confirmed - I'm getting this error after idling and not receiving a message for about 15 mins. @google-cloud/[email protected] and [email protected]. I think I'll try switching to the C++ build of grpc |
Ah, darn. I was hoping 1.0.5 would fix it. I'm going to go ahead and bump the dependency version anyway, in case it helps the others' issues. |
Quick update on this, the consensus was that we probably shouldn't actually do the explicit dependency on grpc-js in here, because it might fall out of sync with other libraries accidentally. The gax library has been updating their dependencies, so in theory, that should be pulling in a newer one now. At some point I'll plan to update the gax dependency explicitly. This is related to this: #879 |
We are seeing this in v2.3.0 as well |
Going through all the existing issues today... is there anyone who's still having this issue on the latest version of the library? |
We had to roll back to older version because the grpc.js was causing some trouble. |
we are also experiencing the same issue, here is the stack trace.
|
Is there any solution for this? |
Not that I'm aware, but there is a new grpc-js coming out soon that has more debug info that might help us figure it out. There are some related issues happening across several libraries at the moment. |
The new grpc-js update should be available now, though you might have to remove package-lock.json and As before, please set these environment variables before running your app to see if we can get some more info:
|
We'll be upgrading soon and currently see this see this in production. I will follow up with our findings. |
@arbourd (or anyone else), any luck grabbing some more debug logs for the issue? |
Hey @feywind, thanks for reminding me. I'll go check out logs, hopefully the data is still around because I completely forgot about this. A couple of quick observations:
|
I pulled one out. Logs"(node:18) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)",2021-01-27T11:54:48.012083134Z
" at filterStack.sendMessage.then (/src/node_modules/@google-cloud/pubsub/node_modules/@grpc/grpc-js/src/call-stream.ts:745:26)"
" at ClientHttp2Stream.Writable.write (_stream_writable.js:296:5)"
" at writeAfterEnd (_stream_writable.js:248:12)"
(node:18) UnhandledPromiseRejectionWarning: Error [ERR_STREAM_WRITE_AFTER_END]: write after end
2021-01-27T11:54:48.011Z | call_stream | [3388] sending data chunk of length 66 (deferred)
2021-01-27T11:54:48.011Z | subchannel_refcount | 108.177.111.95:443 callRefcount 9 -> 10
2021-01-27T11:54:48.011Z | call_stream | [3388] attachHttp2Stream from subchannel 108.177.111.95:443
" te: trailers"
" :path: /google.pubsub.v1.Subscriber/StreamingPull"
" :method: POST"
" content-type: application/grpc"
" user-agent: grpc-node-js/1.2.3"
" :authority: pubsub.googleapis.com:443"
" accept-encoding: identity,gzip"
" grpc-accept-encoding: identity,deflate,gzip"
" grpc-timeout: 899997m"
2021-01-27T11:54:48.011Z | call_stream | Starting stream on subchannel 108.177.111.95:443 with headers
2021-01-27T11:54:48.011Z | call_stream | [3387] sending data chunk of length 66 (deferred)
2021-01-27T11:54:48.011Z | subchannel_refcount | 108.177.111.95:443 callRefcount 8 -> 9
2021-01-27T11:54:48.011Z | call_stream | [3387] attachHttp2Stream from subchannel 108.177.111.95:443
" te: trailers"
" :path: /google.pubsub.v1.Subscriber/StreamingPull"
" :method: POST"
" content-type: application/grpc"
" user-agent: grpc-node-js/1.2.3"
" :authority: pubsub.googleapis.com:443"
" accept-encoding: identity,gzip"
" grpc-accept-encoding: identity,deflate,gzip"
" grpc-timeout: 899997m"
2021-01-27T11:54:48.011Z | call_stream | Starting stream on subchannel 108.177.111.95:443 with headers
2021-01-27T11:54:48.011Z | call_stream | [3386] sending data chunk of length 66 (deferred)
2021-01-27T11:54:48.011Z | subchannel_refcount | 108.177.111.95:443 callRefcount 7 -> 8
2021-01-27T11:54:48.011Z | call_stream | [3386] attachHttp2Stream from subchannel 108.177.111.95:443
" te: trailers"
" :path: /google.pubsub.v1.Subscriber/StreamingPull"
" :method: POST"
" content-type: application/grpc"
" user-agent: grpc-node-js/1.2.3"
" :authority: pubsub.googleapis.com:443"
" accept-encoding: identity,gzip"
" grpc-accept-encoding: identity,deflate,gzip"
" grpc-timeout: 899997m"
2021-01-27T11:54:48.011Z | call_stream | Starting stream on subchannel 108.177.111.95:443 with headers
"error: Failed to subscribe ""sync"" - Error [ERR_STREAM_WRITE_AFTER_END]: write after end {""timestamp"":""2021-01-27T11:54:48.010Z""}" |
Still seeing this on |
Linked to the meta-issue about transport problems: b/242894947 |
We have determined that debugging issues like this require sharing more sensitive customer information and debugging at layers likely deeper than the Node Pub/Sub client library. Therefore, if you are experiencing this problem, please enter support ticket so those details can be gathered and the issue can be investigated further. |
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/c503f640-90ae-4547-bcc8-a154d32c609e/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@15013ef
Environment details
@google-cloud/pubsub
version: 1.x (1.1.5, tried reverting down to 1.0.0, same error, currently using 0.21.1)Steps to reproduce
Unclear so far but have been seeing it after publishing 10k+ messages to various topics. Will get back with more details when we can but if anyone else is seeing this to confirm this isn't a config issue let us know.
We are using our own wrapper around pubsub which you can find here: https://github.com/starchup/google-pubsub-wrapper, extremely bare bones
Error stacktrace
Thanks!
The text was updated successfully, but these errors were encountered: