# Alerts working but getting some errors - bad response code 400 and Template variables

**URL:** <https://forums.percona.com/t/alerts-working-but-getting-some-errors-bad-response-code-400-and-template-variables/5376>\
**Category:** PMM 1.x\
**Created:** [January 27, 2017, 12:42pm UTC](https://forums.percona.com/t/alerts-working-but-getting-some-errors-bad-response-code-400-and-template-variables/5376 "2017-01-27T12:42:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mthomas](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@mthomas](https://forums.percona.com/u/mthomas)\
**Post date:** [January 27, 2017, 12:42pm UTC](https://forums.percona.com/t/alerts-working-but-getting-some-errors-bad-response-code-400-and-template-variables/5376/1 "2017-01-27T12:42:33Z")

</div>

Hi,

I have setup a simple test alert, via email. It is working and we get the email when the alert fires - all good. When I TEST the alert it throws a “bad response code 400” error - see uploaded image.  
[IMG2=JSON]{“data-align”:“none”,“data-size”:“full”,“src”:“https://www.percona.com/forums/filedata/fetch?filedataid=544&type=thumb”}[/IMG2]

Also get the following error in grafana.log :-

Googling the errors seems to point to a Grafana bug that has been fixed in version 4.1.1.

[URL][https://github.com/grafana/grafana/issues/6254[/URL]](https://github.com/grafana/grafana/issues/6254%5B/URL%5D)  
[URL][https://github.com/grafana/grafana/issues/6488[/URL]](https://github.com/grafana/grafana/issues/6488%5B/URL%5D)  
[URL=“[fix(influxdb): fixes bug when using regexps/numbers in tags · grafana/grafana@56340bf · GitHub](https://github.com/grafana/grafana/commit/56340bfdfbb84a7899ee9b2e0c6ec4ebd2bf668b)”][https://github.com/grafana/grafana/c...6ec4ebd2bf668b[/URL]](https://github.com/grafana/grafana/c...6ec4ebd2bf668b%5B/URL%5D)

Any thoughts on this very welcome and if these errors are caused by a grafana bug, I assume they will be resolved by the next PMM release with an updated grafana version?

thanks

VERSIONS: 1.0.7 PMM server and clients

 ![photoid=47049](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/8/8c0c3c53b559cc2f801cf861003cfe1e2a0e4bc7.jpeg)

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [January 27, 2017, 1:11pm UTC](https://forums.percona.com/t/alerts-working-but-getting-some-errors-bad-response-code-400-and-template-variables/5376/2 "2017-01-27T13:11:38Z")

</div>

grafana definitely will be updated in the next release.  
But it can take some time.

if you want to be alpha tester,  
you can use “” container with grafana 4.1.1

```auto

docker run -d \
-p 80:80 \
--volumes-from pmm-data \
--name pmm-server \
--restart always \
delgod/pmm-server:1.0.7.grafana41

```

or build you own from the sources - [URL=“[https://github.com/delgod/pmm-server/commit/bb3bac739621133c5733ab58ab6e7fc7b52412ce](https://github.com/delgod/pmm-server/commit/bb3bac739621133c5733ab58ab6e7fc7b52412ce)”][https://github.com/delgod/pmm-server...6e7fc7b52412ce[/URL]](https://github.com/delgod/pmm-server...6e7fc7b52412ce%5B/URL%5D)

---

<div class="post-metadata">

**Author:** ![mthomas](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@mthomas](https://forums.percona.com/u/mthomas)\
**Post date:** [January 27, 2017, 2:40pm UTC](https://forums.percona.com/t/alerts-working-but-getting-some-errors-bad-response-code-400-and-template-variables/5376/3 "2017-01-27T14:40:43Z")

</div>

Thanks Mykola.

I upgraded the pmm-server to that “…delgod/pmm-server:1.0.7.grafana41” you kindly provided and re-created the alert.

That cleared the red box error when creating the alert “Template variables are not supported in alert queries”.

When I TEST RULE within the alert create, still getting the error “error tsdb.HandleRequest() error bad\_response: bad response code 400”. I’ll dig into that since may be a problem our end.
