field route not found in type config.plain, field receivers not found in type config.plain

3,191 views
Skip to first unread message

Zarah Diarras

unread,
Jul 9, 2019, 8:58:53 AM7/9/19
to Prometheus Users
Hello guys

I am new to prometheus. I am setting up Alert manager to get email notification. the alerts are firing but i am not receiving mails beccause of my alertmanager.yml file.

this is how the file looks like

route:
  group_by: [Alertname]
  receiver: email-me

receivers:
- name: email-me
  email_configs:
  - to: receiver@.....
    from: sender@...
    smarthost: mail.domain.net:25  
    auth_username: " sender@domain.net"
    auth_identity: " sender@domain.net"
    auth_password: "mypass"

and this is the error message I get when i check the config.

 FAILED: parsing YAML file /etc/alertmanager/alertmanager.yml: yaml: unmarshal er                     rors:
  line 1: field route not found in type config.plain
  line 5: field receivers not found in type config.plain

alertmanager version is 0.17.0

alertmanager --version
alertmanager, version 0.17.0 (branch: HEAD, revision: c7551cd75c414dc81df027f691e2eb21d4fd85b2)
  build user:       root@932a86a52b76
  build date:       20190503-09:10:07
  go version:       go1.12.4

best regards.

Simon Pasquier

unread,
Jul 9, 2019, 10:56:12 AM7/9/19
to Zarah Diarras, Prometheus Users
There's something off with your YAML data for sure but what you pasted looks ok.
Can you share it on pastebin (or similar)?

On Tue, Jul 9, 2019 at 2:59 PM Zarah Diarras <timaza...@gmail.com> wrote:
>
> Hello guys
>
> I am new to prometheus. I am setting up Alert manager to get email notification. the alerts are firing but i am not receiving mails beccause of my alertmanager.yml file.
>
> this is how the file looks like
>
> route:
> group_by: [Alertname]
> receiver: email-me
>
> receivers:
> - name: email-me
> email_configs:
> - to: receiver@.....
> from: sender@...
> smarthost: mail.domain.net:25
> auth_username: " sen...@domain.net"
> auth_identity: " sen...@domain.net"
> auth_password: "mypass"
>
> and this is the error message I get when i check the config.
>
> FAILED: parsing YAML file /etc/alertmanager/alertmanager.yml: yaml: unmarshal er rors:
> line 1: field route not found in type config.plain
> line 5: field receivers not found in type config.plain
>
> alertmanager version is 0.17.0
>
> alertmanager --version
> alertmanager, version 0.17.0 (branch: HEAD, revision: c7551cd75c414dc81df027f691e2eb21d4fd85b2)
> build user: root@932a86a52b76
> build date: 20190503-09:10:07
> go version: go1.12.4
>
> best regards.
>
> --
> You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/bd4c70ca-45c3-4a8c-8168-eaa583358bbb%40googlegroups.com.

Zarah Diarras

unread,
Jul 10, 2019, 2:54:18 AM7/10/19
to Prometheus Users
done! here is the link
> To unsubscribe from this group and stop receiving emails from it, send an email to promethe...@googlegroups.com.

Simon Pasquier

unread,
Jul 10, 2019, 3:48:19 AM7/10/19
to Zarah Diarras, Prometheus Users
Hmm, I've run this:

curl -s https://pastebin.com/raw/YqtCxWC3 > alertmanager.yml && docker
run --rm -v $PWD/alertmanager.yml:/etc/alertmanager/alertmanager.yml
-p 9093:9093 prom/alertmanager:v0.17.0

And it worked for me...
> To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/9735ecd3-ebc3-4b4a-bb44-8e4f87f73c77%40googlegroups.com.

Zarah Diarras

unread,
Jul 10, 2019, 7:59:37 AM7/10/19
to Prometheus Users
so what do you suggest me to do? I regenerate the whole config but still getting the same error

Simon Pasquier

unread,
Jul 11, 2019, 10:20:32 AM7/11/19
to Zarah Diarras, Prometheus Users
Not sure about the issue since what you've shared works for me...
> To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/d353c19b-b651-47d9-a6e9-076f2c5bc6ba%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages