-
Notifications
You must be signed in to change notification settings - Fork 123
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
UnhandledPromiseRejectionWarning in IMAP handler #192
Comments
That's weird. I haven't used the lib to keep instances alive for a longer period. Do you happen to know what it is your imap server is sending? Could you set the log level to be verbose and see the incoming command? |
I'm a bit scared to flood our logging system if I turn on debug logging 😓 In the meantime, I checked the logs again and we actually have two different, alternating errors. Here is the first line of each so you can see the random intervals (datetimes are shown in UTC+2):
the stack trace for the other ("write after end") error always looks like this:
|
Oh, one more thing I can tell you without the debug logs showing one of those errors: the only thing happening on the IMAP client-side is idling (after setting
During the time range in which the most recent errors occurred (this week-end), no new email was sent to the mailbox. This code was triggered a few times (5 seconds after the errors occurred as we reconnect, and after heroku's daily reboot): client.search('INBOX', {unseen: true, not: {from: 'foo'}}, {byUid: true}) We never called |
Yet another kind of uncaught error popped up while the IMAP client was idling:
It's not entirely surprising that some network errors may occur after hours of keeping a connection alive, and it's easy enough to reconnect. The only problem I have here is the uncaught bit. Someday this will make Node.js just crash. |
See #195 ... I think it is the problem. |
Also seeing the UnhandledPromiseRejectionWarning: Error: Unexpected char at position 18 error. It's definitely occuring while the IMAP client is simply idling (not retrieving a message). The host I'm connected to is imap-mail.outlook.com:
|
Hi,
I randomly get this error when the connection has been open for about one to six hours (outlook.office.com IMAP server). It does trigger
client.onerror
but can't be caught by acatch
on the client's methods.Running on heroku with node ^10.
Haven't been able to reproduce it at will (it just happens on its own after some time, at which point I create a new client and reconnect and it works fine until it happens again, etc).
The text was updated successfully, but these errors were encountered: