# PMM 2.31.0 Failed to send test alert.: SMTP not configured, check your grafana.ini config file's \[smtp\] section

**URL:** https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946
**Category:** PMM 2.x
**Created:** [October 11, 2022, 1:09pm UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946 "2022-10-11T13:09:21Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Naresh9999](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/naresh9999/32/5568_2.png) [@Naresh9999](https://forums.percona.com/u/Naresh9999)
#### Post date: [October 11, 2022, 1:09pm UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946/1 "2022-10-11T13:09:21Z")

</div>

Hi Team,

After upgrading to 2.31.0, then we are unable send the mails and we are getting the below error.

Failed to send test alert.: SMTP not configured, check your grafana.ini config file’s [smtp] section

While I am testing the contact points I am getting the below error.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/c/cdf1d00c2e089a15991803c8aaa72fe98ac049c3.png)

Can you please help on this error?

---

<div class="post-metadata">

### Author: ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)
#### Post date: [October 11, 2022, 2:38pm UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946/2 "2022-10-11T14:38:13Z")

</div>

Just to clarify, did sending emails work before you upgraded?

---

<div class="post-metadata">

### Author: ![Naresh9999](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/naresh9999/32/5568_2.png) [@Naresh9999](https://forums.percona.com/u/Naresh9999)
#### Post date: [October 11, 2022, 2:46pm UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946/3 "2022-10-11T14:46:06Z")

</div>

Yes @matthewb I am able to send the emails. Even I have ran the migration script and I am able to see all the previous alerts which I have configured earlier version.

---

<div class="post-metadata">

### Author: ![steve.hoffman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/steve.hoffman/32/66_2.png) [@steve.hoffman](https://forums.percona.com/u/steve.hoffman)
#### Post date: [October 11, 2022, 3:12pm UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946/4 "2022-10-11T15:12:07Z")

</div>

There was a pretty big change between the tech preview version and the GA version of Alerting, namely that we switched to Grafana’s native alert engine (where before PMM did the alerting though a dedicated alertmanager). So the configuration UI we created to set your SMTP server went away because we rely on Grafana’s engine to deliver now.

That means you need to configure your SMTP settings again by either 1) editing the /etc/grafana.ini inside the pmm container (not recommended\*) or 2) set the appropriate variables when you create your docker container and [here](https://www.percona.com/blog/2020/07/07/enable-email-sending-in-percona-monitoring-and-management-2/) is a blog post on how to accomplish that via docker run but you can tailor it similarly for docker compose if that’s how you create your containers.

\*the reason we don’t recommend editing the grafana.ini directly is that from time to time our upgrade process might replace it with a new version and if you replace your container you will definitely lose any changes.

---

<div class="post-metadata">

### Author: ![Naresh9999](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/naresh9999/32/5568_2.png) [@Naresh9999](https://forums.percona.com/u/Naresh9999)
#### Post date: [October 11, 2022, 3:27pm UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946/5 "2022-10-11T15:27:51Z")

</div>

Hi @steve.hoffman

Thanks for you inputs. But if its a new server we would have use 2nd option but already running server, is it good to go with option 2?

---

<div class="post-metadata">

### Author: ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)
#### Post date: [October 11, 2022, 3:58pm UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946/6 "2022-10-11T15:58:17Z")

</div>

Hi @Naresh9999

Yes @steve.hoffman 's #2 option is to use the gmail relay as an example where 7 SMTP environment variables were set so that Grafana could properly route SMTP. This is the recommended approach to use 👍

---

<div class="post-metadata">

### Author: ![Dharmendra](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dharmendra/32/8045_2.png) [@Dharmendra](https://forums.percona.com/u/Dharmendra)
#### Post date: [October 12, 2022, 5:23am UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946/7 "2022-10-12T05:23:03Z")

</div>

Hi team,  
this is my /etc/grafana/grafana.ini configuration file  
 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/6/6a5a2eaa7ab88aeafea837dd7c168033d43e0366.png)

---

<div class="post-metadata">

### Author: ![Dharmendra](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dharmendra/32/8045_2.png) [@Dharmendra](https://forums.percona.com/u/Dharmendra)
#### Post date: [October 12, 2022, 5:23am UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946/8 "2022-10-12T05:23:44Z")

</div>

but i also got this errror ??? please help me out …

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/b/b65b4f115b660e1785a695082aa6de25fda7e1c0.png)

---

<div class="post-metadata">

### Author: ![steve.hoffman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/steve.hoffman/32/66_2.png) [@steve.hoffman](https://forums.percona.com/u/steve.hoffman)
#### Post date: [October 12, 2022, 6:09am UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946/9 "2022-10-12T06:09:10Z")

</div>

I think you meant that because it’s an existing server can you use option 1…you can BUT i would recommend you keep a backup copy of the resulting grafana.ini because at some point it’s going to get overwritten (this most recent release we went from grafana 8 to 9 so almost certainly overwrote the .ini).

Even with an existing server, you can still use option 2 with the env vars IF you use a separate volume for the pmm data (if you followed the install instructions you should have a container for pmm-data). At which point you can simply re-run your `docker run` command from your command history and add the env vars.

example:  
originally you may have run something like  
`docker run -d -p 8080:80 -p 8443:443 --volumes-from pmm-data --name pmm-server --restart always percona/pmm-server:2`

but you can stop and delete the pmm-server container and re-run as:  
`docker run -d -p 8080:80 -p 8443:443 --volumes-from pmm-data --name pmm-server --restart always -e GF_SMTP_ENABLED=true -e GF_SMTP_HOST=smtp.gmail.com:587 -e GF_SMTP_USER=email@domain.com -e GF_SMTP_PASSWORD=<password> -e GF_SMTP_SKIP_VERIFY=false -e GF_SMTP_FROM_ADDRESS=email@domain.com -e GF_SMTP_FROM_NAME=Grafana -e percona/pmm-server:2`

---

<div class="post-metadata">

### Author: ![Dharmendra](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dharmendra/32/8045_2.png) [@Dharmendra](https://forums.percona.com/u/Dharmendra)
#### Post date: [October 12, 2022, 6:39am UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946/10 "2022-10-12T06:39:20Z")

</div>

when i try this data not loaded…

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/5/5e4f229e0260b74f69fa492a28a04dbe40290dc4.png)

---

<div class="post-metadata">

### Author: ![Dharmendra](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dharmendra/32/8045_2.png) [@Dharmendra](https://forums.percona.com/u/Dharmendra)
#### Post date: [October 19, 2022, 5:20am UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946/11 "2022-10-19T05:20:09Z")

</div>

Hi team, please help to solve me this issue…

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/1/1a52514643b6df41c7007979e340e1f19c958022.png)

---

<div class="post-metadata">

### Author: ![elisetta1984](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/elisetta1984/32/5327_2.png) [@elisetta1984](https://forums.percona.com/u/elisetta1984)
#### Post date: [October 20, 2022, 3:37pm UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946/12 "2022-10-20T15:37:37Z")

</div>

Hi Steve!  
Which is the best solution to configure smtp for Grafana in a persistent way when PMM is installed using Podman (following this documentation: [Podman - Percona Monitoring and Management](https://docs.percona.com/percona-monitoring-and-management/setting-up/server/podman.html)), please?  
Thanks and Best Regards,  
Elisa

---

<div class="post-metadata">

### Author: ![steve.hoffman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/steve.hoffman/32/66_2.png) [@steve.hoffman](https://forums.percona.com/u/steve.hoffman)
#### Post date: [October 20, 2022, 4:57pm UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946/13 "2022-10-20T16:57:42Z")

</div>

@Dharmendra, hard to diagnose from that error…I’m going to guess it’s the square brackets you have around your host in your grafana.ini config from above. have you tried [host:587=smtp.grafana.com](http://host:587=smtp.grafana.com)?

you can run the test while you’re tailing the /srv/logs/grafana.log inside the pmm container (`docker exec pmm-server tail -f /srv/logs/grafana.log`) and that might give a better hint to what grafana doesn’t like about the ini file.

---

<div class="post-metadata">

### Author: ![steve.hoffman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/steve.hoffman/32/66_2.png) [@steve.hoffman](https://forums.percona.com/u/steve.hoffman)
#### Post date: [October 20, 2022, 5:04pm UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946/14 "2022-10-20T17:04:09Z")

</div>

hmmmm… @Denys_Kondratenko might be able to help (I’m no podman guru)…my guess is something like adding:

```auto
GF_SMTP_ENABLED=true
GF_SMTP_HOST=smtp.gmail.com:587
GF_SMTP_USER=email@domain.com
GF_SMTP_PASSWORD=<password>
GF_SMTP_SKIP_VERIFY=false
GF_SMTP_FROM_ADDRESS=email@domain.com
GF_SMTP_FROM_NAME=Grafana

```

to the `~/.config/pmm-server/pmm-server.env` file.

---

<div class="post-metadata">

### Author: ![Denys\_Kondratenko](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/denys_kondratenko/32/2798_2.png) [@Denys\_Kondratenko](https://forums.percona.com/u/Denys_Kondratenko)
#### Post date: [October 24, 2022, 7:55am UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946/15 "2022-10-24T07:55:28Z")

</div>

Hi @elisetta1984,

yes, if you run service as described in a doc - Steve’s comment is exactly correct. `pmm-server.env` would be passed as env inside container `--env-file=${PMM_ENV_FILE}`.  
So between restart and updates it would pass same envs to the container.

Thanks,  
Denys

---

<div class="post-metadata">

### Author: ![Denys\_Kondratenko](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/denys_kondratenko/32/2798_2.png) [@Denys\_Kondratenko](https://forums.percona.com/u/Denys_Kondratenko)
#### Post date: [October 24, 2022, 8:01am UTC](https://forums.percona.com/t/pmm-2-31-0-failed-to-send-test-alert-smtp-not-configured-check-your-grafana-ini-config-files-smtp-section/17946/16 "2022-10-24T08:01:07Z")

</div>

Hi @Dharmendra

> Hi team, please help to solve me this issue…  
> so in this case how did you set the settings?

> when i try this data not loaded…  
> it doesn’t look like related to the settings. Could you please describe exact steps you are performing ?

Thanks,  
Denys
