UnhandledPromiseRejectionWarning: Error: Connection is closed. event_handler.js:115:25
See original GitHub issueSome users of my project which is using ioredis current version (npm latest) got:
UnhandledPromiseRejectionWarning: Error: Connection is closed.
at close (/opt/iobroker/node_modules/ioredis/built/redis/event_handler.js:115:25)
at Socket. (/opt/iobroker/node_modules/ioredis/built/redis/event_handler.js:82:20) at Object.onceWrapper (events.js:315:30) at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at TCP._handle.close [as _onclose] (net.js:561:12)(node:2345)
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: 1)
(node:2345) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
On my host the line number lead me to
self.flushQueue(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG));
Is there abug on your side? I’m not that fit in Promises and stuff.
Thank you having a look.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11
Top Results From Across the Web
UnhandledPromiseRejectionWar...
js . There seems to be an error in. UnhandledPromiseRejectionWarning: Error: The client is closed. (node:24640) UnhandledPromiseRejectionWarning ...
Read more >WebSocket: close event - Web APIs - MDN Web Docs
Returns a string indicating the reason the server closed the connection. This is specific to the particular server and sub-protocol.
Read more >MongoServerSelectionError: connection closed - MongoDB
Hi, When I try to submit a form in a localhost:5000 website, I am getting a MongoServerSelectionError: connection <monitor> closed at ...
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 FreeTop 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
Top GitHub Comments
Ok, I found the relevant command (it were "publish"s) and added a “catch(err =>{})” … so it works. DOn’t kniw if it should be that way … maybe add it to the documentation?
We did not patched the ioredis itself, but really made sure to catch all relevant errors. And in fact it was the .ctah as above in our code. Each Redis command can fail …