-
Notifications
You must be signed in to change notification settings - Fork 163
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
Errors on socket end, Cannot read properties of undefined (reading 'end')
#560
Comments
What version of the client are you on? |
This looks to me as a Proxy/Kubernetes or something that is holding on to the socket and not properly closing it. Stale connection means that the pings expected from the server were not received, but the connection is still open. |
We were using nats client version As for the Proxy/Kubernetes, we are using Docker's port forwarding for hosting our NATS cluster, via Docker Swarm. |
could try and put a guard on that socket reference in case that it was nullfied. I am thinking that perhaps some of the events are not coming in the right order (or the expected order). Just to be clear, do you think the client is hanging due to a crash, or is it that the socket is partially open for some unknown reason. |
If I make you a patch, could you partially deploy it and could monitor if it makes it better? |
Yeah that's what it feels like to me too. I'm honestly not sure if the client hang is related to this - we're still trying to get to the bottom of that. It's happening very irregularly and unpredictably, sometimes accompanied with this error and sometimes without. I'd be happy to deploy a patch and monitor and get back to you. This may take a few days to gather reports and monitor Sentry for changes. |
sounds like a plan. Give me a bit. |
@Cherry |
Thank you very much! I've deployed this and will report back in a few days as we see any changes. 🤞 |
As an update here, we haven't seen this specific error occur again with I think the changes in |
Awesome! |
@Cherry I am going to close this issue, but feel free to reopen or create a new issue for anything else. |
Thanks @aricart. Will the next version include the change in https://github.com/nats-io/nats.js/tree/fix-560, so we can get back on a mainstream release? |
Believe it is there |
If not I'll release |
From what I can tell, the fix doesn't appear to be in |
@Cherry you are right - taking care of it. |
@Cherry |
Thank you! |
We recently upgraded from version 1 to the latest version 2 of the NATS.js client, and over the last few weeks have been seeing a growing number of the following issue being reported in our Sentry:
With the following stack:
Raw:
As this happens, wee see the
reconnecting
event fromconnection.status()
fire, and it's also sometimes accompanied with aNatsError: 'Stale Connection'
error.The issue itself here doesn't seem to impact anything most of the time, and the client reconnects without issue. But we have sometimes seen cases where the client hangs and requires us to completely restart it.
The text was updated successfully, but these errors were encountered: