Open nilmerg opened 3 weeks ago
Why does the web allow you to create users without an email address in the first place, when you expect that the daemon should treat this as an error? IMHO, web should force you to provide your email address if you choose email as a default channel and shouldn't delegate the error handling to the daemon.
Only the default is required or will be: https://github.com/Icinga/icinga-notifications-web/issues/74
At the moment, if a contact has no email address and should be / will be notified by email, an incident's history logs that an escalation has been reached, but no further log exists explaining what didn't happen.
In that situation, I'd expect a history entry with notification_state = 'failed'
. If that currently results in the entry remaining either pending or even being marked as sent, this sounds like a bug.
There's no entry at all.
That sounds even more like a bug.
There's no entry at all.
No way!
2024-06-10T12:12:12.928+0200 INFO incident Rule reached escalation {"object": "icinga-8!ping4", "incident": "#26", "rule": {"id": 1, "name": "default"}, "escalation": {"id": 1, "rule_id": 1, "name": "[S] Working Hours, [C] Yonas Habteab", "condition": "incident_severity>=ok"}}
2024-06-10T12:12:12.953+0200 INFO incident Notify contact "Yonas Habteab" via "Email" of type "email" {"object": "icinga-8!ping4", "incident": "#26", "channel_id": 1, "event_type": "state"}
2024-06-10T12:12:12.954+0200 ERROR incident Failed to send notification via channel plugin {"object": "icinga-8!ping4", "incident": "#26", "type": "email", "error": "contact user Yonas Habteab doesn't have an e-mail address"}
Please also test this with a manual subscribe.
Please also test this with a manual subscribe.
You didn't say that in your issue description, but either way works for me!
2024-06-10T14:34:17.916+0200 INFO incident Notify contact "Icinga Admin" via "Email" of type "email" {"object": "docker-master!swap", "incident": "#10", "channel_id": 1, "event_type": "state"}
2024-06-10T14:34:17.917+0200 ERROR incident Failed to send notification via channel plugin {"object": "docker-master!swap", "incident": "#10", "type": "email", "error": "contact user Icinga Admin doesn't have an e-mail address"}
At the moment, if a contact has no email address and should be / will be notified by email, an incident's history logs that an escalation has been reached, but no further log exists explaining what didn't happen.