Alertmanager won't send an email notification if no SMTP authentication options are configured. These messages appear repeatedly in the log file:
level=error ts=2019-01-23T15:49:04.898510015Z caller=notify.go:332 component=dispatcher msg="Error on notify" err="missing password for PLAIN auth mechanism; missing password for LOGIN auth mechanism"
level=error ts=2019-01-23T15:49:04.898681067Z caller=dispatch.go:177 component=dispatcher msg="Notify for alerts failed" num_alerts=1 err="missing password for PLAIN auth mechanism; missing password for LOGIN auth mechanism"
Config:
global:
smtp_from: <my_email>
route:
receiver: root-route-receiver
group_by:
- alertname
group_wait: 2m
group_interval: 1m
repeat_interval: 24h
receivers:
- name: root-route-receiver
email_configs:
- to: <my_email>
smarthost: <my_smtp_host>:25
require_tls: false
Noticed this issue after updating to v0.16.0. My same configuration worked on 0.15.1.
This looks related to the changes from #1608 and #1555.
Cc @glefloch @danielkucera @mxinden
Seems like the assumption of the auth() function is to be only called if auth is requested in the alertmanager config. However, it seems to be called everytime the SMTP server advertises the AUTH extension.
Maybe we should return early at the beginning of auth() if no username is configured and log a debug message about continuing without any authentication?
Looking further, #1713 is going to implement a similar logic and might fix this.
Cc @metazool
Chiming in because I'm getting the same error.
I agree with @hoffie's analysis. And after reading rfc4954, it isn't mandatory for the client to authenticate even if the SMTP server advertises auth mechanisms. So in case there are no credentials, AlertManager should attempt to send the mail anyway.
I just saw this, thanks. I can try to update #1713 to add better logging. It's been interesting to learn a bit of Go
Not sure if it is related. But I have the same issue as OP after upgrading to 0.16.1 from 0.15.1
level=info ts=2019-03-25T12:40:47.545734791Z caller=silence.go:291 component=silences msg="Running maintenance failed" err="open /alertmanager/silences.395870c1a656c888: permission denied"
level=error ts=2019-03-25T12:41:11.240846092Z caller=notify.go:332 component=dispatcher msg="Error on notify" err="unknown auth mechanism: "
level=error ts=2019-03-25T12:41:11.240995145Z caller=notify.go:332 component=dispatcher msg="Error on notify" err="unknown auth mechanism: "
level=error ts=2019-03-25T12:41:11.241011693Z caller=dispatch.go:177 component=dispatcher msg="Notify for alerts failed" num_alerts=1 err="unknown auth mechanism: ; unknown auth mechanism: "
Not sure if it is related. But I have the same issue as OP after upgrading to 0.16.1 from 0.15.1
level=info ts=2019-03-25T12:40:47.545734791Z caller=silence.go:291 component=silences msg="Running maintenance failed" err="open /alertmanager/silences.395870c1a656c888: permission denied" level=error ts=2019-03-25T12:41:11.240846092Z caller=notify.go:332 component=dispatcher msg="Error on notify" err="unknown auth mechanism: " level=error ts=2019-03-25T12:41:11.240995145Z caller=notify.go:332 component=dispatcher msg="Error on notify" err="unknown auth mechanism: " level=error ts=2019-03-25T12:41:11.241011693Z caller=dispatch.go:177 component=dispatcher msg="Notify for alerts failed" num_alerts=1 err="unknown auth mechanism: ; unknown auth mechanism: "I have the same error..
level=info ts=2019-03-28T18:45:39.40811949Z caller=silence.go:291 component=silences msg="Running maintenance failed" err="open /alertmanager/silences.58bdc594c6f13e9b: permission denied"
level=error ts=2019-03-28T18:45:39.408236523Z caller=nflog.go:363 component=nflog msg="Running maintenance failed" err="open /alertmanager/nflog.e7b6e793c7034cc: permission denied"
level=info ts=2019-03-28T19:00:39.408124673Z caller=silence.go:291 component=silences msg="Running maintenance failed" err="open /alertmanager/silences.627a80836e089f47: permission denied"
Most helpful comment
level=info ts=2019-03-28T18:45:39.40811949Z caller=silence.go:291 component=silences msg="Running maintenance failed" err="open /alertmanager/silences.58bdc594c6f13e9b: permission denied"
level=error ts=2019-03-28T18:45:39.408236523Z caller=nflog.go:363 component=nflog msg="Running maintenance failed" err="open /alertmanager/nflog.e7b6e793c7034cc: permission denied"
level=info ts=2019-03-28T19:00:39.408124673Z caller=silence.go:291 component=silences msg="Running maintenance failed" err="open /alertmanager/silences.627a80836e089f47: permission denied"