Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • kresus kresus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 145
    • Issues 145
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • kresusapp
  • kresuskresus
  • Issues
  • #978
Closed
Open
Issue created May 19, 2020 by Nicolas Frandeboeuf@nicofrandDeveloper

Error when apprise notifications are enabled but not emails + alerts are enabled

"Regression" (not really: the error is thrown only since this commit but the code should not be called) from 0bd57dde

When the notifications are enabled but only apprise is configured and there is no email configuration, we still call getEmailer.send() (https://framagit.org/kresusapp/kresus/-/blob/master/server/lib/alert-manager.ts#L31), that will throw an error because I did not configure the emails.

Logs:

[2020-05-18T22:39:42.105] [INFO] apply-config - KRESUS_EMAIL_TRANSPORT = null
[2020-05-18T22:39:42.106] [INFO] apply-config - KRESUS_EMAIL_SENDMAIL_BIN = null
[2020-05-18T22:39:42.106] [INFO] apply-config - KRESUS_EMAIL_FROM = null
[2020-05-18T22:39:42.107] [INFO] apply-config - KRESUS_EMAIL_HOST = null
[2020-05-18T22:39:42.108] [INFO] apply-config - KRESUS_EMAIL_PORT = null
[2020-05-18T22:39:42.108] [INFO] apply-config - KRESUS_EMAIL_USER = null
[2020-05-18T22:39:42.109] [INFO] apply-config - KRESUS_EMAIL_PASSWORD = (hidden)
[2020-05-18T22:39:42.110] [INFO] apply-config - KRESUS_EMAIL_FORCE_TLS = false
[2020-05-18T22:39:42.110] [INFO] apply-config - KRESUS_EMAIL_REJECT_UNAUTHORIZED_TLS = true
[2020-05-18T22:39:42.111] [INFO] apply-config - KRESUS_APPRISE_API_BASE_URL = http://localhost:8000

...


[2020-05-18T22:40:53.002] [INFO] notifications - Notifier initialized for user 1
[2020-05-18T22:40:53.013] [INFO] notifications - Apprise url fetched for user 1
[2020-05-18T22:41:22.809] [WARN] emailer - One of emailFrom, smtpHost or smtpPort is missing: emails won't work.
[2020-05-18T22:41:22.811] [INFO] emailer - Reinitializing email recipient...
[2020-05-18T22:41:22.836] [INFO] emailer - Done!
[2020-05-18T22:41:22.837] [ERROR] helpers - Assertion error: fromEmail must have been initialized before sending emails
Error
    at panic (/home/user/app/build/server/helpers.js:31:46)
    at Object.assert (/home/user/app/build/server/helpers.js:38:9)
    at Emailer.sendToUser (/home/user/app/build/server/lib/emailer.js:98:19)
    at process._tickCallback (internal/process/next_tick.js:68:7)
[2020-05-18T22:41:22.838] [ERROR] alert-manager - Error when checking alerts for operations: Error: Assertion error: fromEmail must have been initialized before sending emails
Error
    at panic (/home/user/app/build/server/helpers.js:31:46)
    at Object.assert (/home/user/app/build/server/helpers.js:38:9)
    at Emailer.sendToUser (/home/user/app/build/server/lib/emailer.js:98:19)
    at process._tickCallback (internal/process/next_tick.js:68:7)
[2020-05-18T22:41:23.112] [INFO] accounts-manager - Post process: done.
Edited May 19, 2020 by Nicolas Frandeboeuf
Assignee
Assign to
Time tracking