Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

UnhandledPromiseRejectionWarning: Handle missing To field #9

Closed
erm3nda opened this issue Jun 27, 2019 · 9 comments
Closed

UnhandledPromiseRejectionWarning: Handle missing To field #9

erm3nda opened this issue Jun 27, 2019 · 9 comments

Comments

@erm3nda
Copy link
Contributor

erm3nda commented Jun 27, 2019

System keeps working, but there's no report about the number of emails on system or other.

root@serveros:~# pm2 logs 0

[TAILING] Tailing last 15 lines for [0] process (change the value with --lines option)
/root/.pm2/logs/email-out.log last 15 lines:
0|email |
0|email | > void-mail@0.0.0 start /root/email
0|email | > node ./bin/www
0|email |

/root/.pm2/logs/email-error.log last 15 lines:
0|email | (node:1969) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'flatMap' of undefined
0|email | at ImapService._createMailSummary (/root/email/mailbox/imap-service.js:166:5)
0|email | at mails.forEach.mail (/root/email/mailbox/imap-service.js:223:11)
0|email | at Array.forEach ()
0|email | at ImapService._getMailHeadersAndPublish (/root/email/mailbox/imap-service.js:219:10)
0|email | at process._tickCallback (internal/process/next_tick.js:68:7)
0|email | (node:1969) 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)
0|email | (node:1969) [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.

@synox

This comment has been minimized.

@synox
Copy link
Owner

synox commented Jun 27, 2019

I was able to preproduce the problem.

Can you please share your pm2 config?

@erm3nda
Copy link
Contributor Author

erm3nda commented Jun 27, 2019 via email

@synox
Copy link
Owner

synox commented Jun 27, 2019

Maybe you could add to https://github.com/synox/void-mail/blob/master/docs/installation.md how to use pm2.

I am working on a patch, its coming soon today.

@synox
Copy link
Owner

synox commented Jun 27, 2019

Commit e818f06 should resolve the issue. Please test.

@synox synox changed the title UnhandledPromiseRejectionWarning UnhandledPromiseRejectionWarning: Handle missing To field Jun 27, 2019
@synox synox closed this as completed Jun 27, 2019
@erm3nda
Copy link
Contributor Author

erm3nda commented Jun 27, 2019 via email

@synox
Copy link
Owner

synox commented Jun 27, 2019

You can update now.

@erm3nda
Copy link
Contributor Author

erm3nda commented Jun 27, 2019

Fixed, thanks.

@erm3nda
Copy link
Contributor Author

erm3nda commented Jul 2, 2019

The problem is there again. Seems that is being triggered by a new email.

0|email | > void-mail@0.0.0 start /root/email
0|email | > node ./app.js
0|email |

/root/.pm2/logs/email-error.log last 15 lines:
0|email | (node:2179) 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)
0|email | (node:2179) [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.
0|email | (node:7942) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toLowerCase' of undefined
0|email | at MailRepository.add (/root/email/domain/mail-repository.js:22:29)
0|email | at mail.to.forEach.to (/root/email/application/mail-processing-service.js:56:24)
0|email | at Array.forEach ()
0|email | at MailProcessingService.onNewMail (/root/email/application/mail-processing-service.js:55:11)
0|email | at ImapService.imapService.on.mail (/root/email/app.js:28:24)
0|email | at ImapService.emit (events.js:198:13)
0|email | at mails.forEach.mail (/root/email/application/imap-service.js:222:11)
0|email | at Array.forEach ()
0|email | at ImapService._getMailHeadersAndEmitAsEvents (/root/email/application/imap-service.js:218:10)
0|email | at process._tickCallback (internal/process/next_tick.js:68:7)
0|email | (node:7942) 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)
0|email | (node:7942) [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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants