question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnhandledPromiseRejectionWarning: Error: Connection is closed. event_handler.js:115:25

See original GitHub issue

Some 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:closed
  • Created 4 years ago
  • Comments:11

github_iconTop GitHub Comments

2reactions
Apollon77commented, Oct 6, 2019

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?

0reactions
Apollon77commented, Sep 7, 2021

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 …

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found