Unhandled 'error' event crash
See original GitHub issueWhile using nodejs-speech I am facing crashes like the one shown here:
events.js:183
throw er; // Unhandled 'error' event
^
Error: 14 UNAVAILABLE: EOF
at createStatusError (/service/node_modules/grpc/src/client.js:64:15)
at ClientDuplexStream._emitStatusIfDone (/service/node_modules/grpc/src/client.js:270:19)
at ClientDuplexStream._receiveStatus (/service/node_modules/grpc/src/client.js:248:8)
at /service/node_modules/grpc/src/client.js:804:12
The Error code and message varies from crash to crash. Ie:
Error: 14 UNAVAILABLE: 502:Bad Gateway
…, but the crash stack trace is always the same. client.js
is emiting an error
event on an instance that does not have any listener for such event attached.
I opened the corresponding issue in in nodejs-speech https://github.com/googleapis/nodejs-speech/issues/62, but I believe this is the correct place for it.
It is reproducible even though it can take from 1 minute to almost 2 hours to happen. I can provide with the required information, some of which you can already see in the referenced issue.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:17 (7 by maintainers)
Top Results From Across the Web
How to Fix "throw er; // Unhandled 'error' event"?
It's only affecting watch -command and appears to be linked to a file-system incompatibility when watching file changes. The line number ...
Read more >How to "catch" the throw er; // Unhandled 'error' event in other ...
Even if any code I call has a coding error, it shouldn't completely crash my calling script. There should be a way for...
Read more >Unhandled 'error' event crash #62 - GitHub
As shown in the shared code, the streamingRecognize() write steam is re-generated on every data event which reports an error (typically being: ...
Read more >Let It Crash: Best Practices for Handling Node.js Errors on ...
When a JavaScript error is not properly handled, an uncaughtException is emitted. These suggest the programmer has made an error, and they ...
Read more >Crash reporting when CLR or Native Top Level Unhandled ...
How can i get data from the crash that are not catch by CLR Unhandled Exception Event, Native Top Level Unhandled Exception Filter...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No clue on how google-gax and nodejs-speech are working exactly - gRPC itself is issuing call objects when being asked to, and whichever is requesting them HAS to bind the error handler on them.
So something somewhere along the chain is breaking that API contract.
Hi @kjin,
For how much time did you try? It is sometimes easily reproducible, whereas the same piece of code may not crash that easily on a later execution… I’ve sometime got the crash within a minute or two, some other each 5 minutes and some other time 3 hours after starting… I wish I had a 100% reproducible code snippet.
I’m getting a real time audio stream from a gstreamer pipe (gst-launch), out of which I’m creating a readable Node.js stream, which I’m piping to the google-speech
streamingRecognize()
duplex stream.If you check the code I provided, the class has a method
start()
which expects a readable stream: https://github.com/googleapis/nodejs-speech/issues/62#issue-317169484As I said, and if you read the whole google-speech issue you will notice, I would reproduce it every 5 minutes for some time…, but then the crash didn’t appear until 80+ minutes of continuous execution.
In case it helps, here the logs of one of the latest time the process crashed last week. I put a log on every event handler of the duplex stream, consisting of a random ID and an counter. Everytime I create a
streamingRecognize()
duplex stream I assign it an incrementing numerical attribute which I use later for logging purposes.I use the
unpipe
event handler to create a new duplex stream which I then pipe to the audio read stream. Theunpipe
event is usually fired uponerror
event as can be seen.NOTE: the crash logs are at the very end