Error with E-Mail Alerting

Hello,

I tried to configure Alerting in Grafana on my Ubuntu VM.

I edited /usr/share/grafana/conf/defaults.ini

Note: I censored the PW for the screenshot.

Then restarted grafana-server.service.

I configured a Notification Channel in Grafana.

image

But when I try to test it I get

image

If I look under Alert Rules I see

Execution Error: tsdb.HandleRequest() error parse “192.168.1.10:8086”: first path segment in URL cannot contain colon

Edit: after I changed my InfluxDB from 192.168.1.10:8086 to http://192.168.1.10:8086 I didn’t get this anymore but I still get the “Failed to send alert notifications” error.

Source: Grafana 7, Alerting issue, error:"tsdb.HandleRequest() ... unsupported protocol scheme "influxdb"

at my Alert Rule.

Hope anyone can help.

Best regards Tobias

I also allowed less secure app access in Gmail.

The two errors are unrelated, though it sounds like you’ve fixed the InfluxDB query issue.

For the SMTP/emailing issue, there should be more details in your Grafana server log.

Yes InfluxDB issue is fixed.

Log entrys for SMTP issue:

t=2021-04-21T13:14:27+0000 lvl=info msg=“Sending alert notification to” logger=alerting.notifier.email addresses=[test.user.grafana@gmail.com] singleEmail=false

t=2021-04-21T13:14:37+0000 lvl=eror msg=“Failed to send alert notification email” logger=alerting.notifier.email error=“Failed to send notification to email addresses: test.user.grafana@gmail.com: dial tcp 64.233.166.109:587: i/o timeout”

t=2021-04-21T13:14:37+0000 lvl=eror msg=“failed to send notification” logger=alerting.notifier uid= error=“Failed to send notification to email addresses: test.user.grafana@gmail.com: dial tcp 64.233.166.109:587: i/o timeout”

t=2021-04-21T13:14:37+0000 lvl=eror msg=“failed to send notification” logger=alerting.notifier uid= error=“Failed to send notification to email addresses: test.user.grafana@gmail.com: dial tcp 64.233.166.109:587: i/o timeout”

t=2021-04-21T13:14:37+0000 lvl=eror msg=“Failed to send alert notifications” logger=context userId=1 orgId=1 uname=admin error=“Failed to send notification to email addresses: test.user.grafana@gmail.com: dial tcp 64.233.166.109:587: i/o timeout” remote_addr=192.168.1.101

t=2021-04-21T13:14:37+0000 lvl=eror msg=“Request Completed” logger=context userId=1 orgId=1 uname=admin method=POST path=/api/alert-notifications/test status=500 remote_addr=192.168.1.101 time_ms=10004 size=48 referer=http://192.168.1.10:3000/alerting/notification/1/edit

I guess the issue should be clear based on the above messages? Grafana can’t establish a network connection to the SMTP server.

image

Sure, but if I try to ping the SMTP Server it works.

Do I have to configure anything else in Grafana? Any ideas?

Hm…not sure in that case. I do remember having issues connecting to Gmail’s SMTP server at some point in the past (not specifically from Grafana) - there appears to be some nuance regarding TLS and/or SSL depending on the port.

This is not particularly scientific, but you could try some combination of the following:

  • Comment out the cert_file and key_file options, given that you’re not using them (and I don’t think they should be necessary). Just to make sure Grafana isn’t doing something funny because the option is there but set to empty
  • Try to set a different startTLS_policy option
  • Try port 465 instead of 587 (SSL instead of TLS security)
  • Set skip_verify=false

Sorry I can’t really be of more help. Maybe someone out there has a “proven working” configuration for Gmail SMTP (we use AWS…)

Wrote the same instruction…then looked that yours has appeared.

Lie down, try not to cry, cry a lot, teehee

Yes, Tobias, try this and that should definitely help.

When I had problems with fetching gmail emails - changing port was the decision.

1 Like

I got the same problem in the latest version 8.0.6 Have you solved it ?