# Alert rules provisioning question

**URL:** <https://community.grafana.com/t/alert-rules-provisioning-question/73439>\
**Category:** Configuration\
**Tags:** provisioning, alerting\
**Created:** [October 3, 2022, 7:27am UTC](https://community.grafana.com/t/alert-rules-provisioning-question/73439 "2022-10-03T07:27:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oleksiikalinin](https://avatars.discourse-cdn.com/v4/letter/o/d2c977/32.png) [@oleksiikalinin](https://community.grafana.com/u/oleksiikalinin)\
**Post date:** [October 3, 2022, 7:27am UTC](https://community.grafana.com/t/alert-rules-provisioning-question/73439/1 "2022-10-03T07:27:09Z")

</div>

- What Grafana version and what operating system are you using?  
9.1.6-oss

- **What** are you trying to achieve?  
Alert rules being provisioned with yaml files

- **How** are you trying to achieve it?  
Put `alerts.yaml` to `/etc/grafana/provisioning/alerting`

- What happened?  
Error when trying to execute the rule  
`failed to execute query A: bad_data: 1:1: parse error: no expression found in input`

- What did you **expect** to happen?  
Execution alert w/o error

- Can you copy/paste the configuration(s) that you are having problems with?

```auto
rules:
  - uid: my_id_1
    title: test_rule
    for: 60s
    labels:
      severity: critical
    annotations:
      summary: Pod {{ $labels.pod }} is not in running state
    condition: A
    data:
      - datasourceUid: prom0
        model:
          conditions:
          - evaluator:
              params:
              - 0
              - 0
              type: gt
            operator:
              type: and
            query:
              params: []
            reducer:
              params: []
              type: max
            type: query
          datasource:
            type: __expr__
            uid: __expr__
          expression: count(kube_pod_status_phase{namespace=~"cloud-.*", job="kube-state-metrics",phase!="Running"}
            == 1) by (pod, phase)
          hide: false
          intervalMs: 1000
          maxDataPoints: 43200
          refId: A
          type: math
        queryType: ''
        refId: A
        relativeTimeRange:
          from: 600
          to: 0

```

- Did you receive any errors in the Grafana UI or in related logs? If so, please tell us **exactly** what they were.

```auto
logger=tsdb.prometheus t=2022-10-03T07:26:00.002945796Z level=error msg="Range query failed" query= err="bad_data: 1:1: parse error: no expression found in input"
logger=ngalert uid=my_id_1 org=1 version=1 attempt=0 now=2022-10-03T07:26:00Z t=2022-10-03T07:26:00.003021866Z level=error msg="failed to evaluate alert rule" results="[{Instance: State:Error Error:failed to execute conditions: failed to execute query A: bad_data: 1:1: parse error: no expression found in input EvaluatedAt:2022-10-03 07:26:00 +0000 UTC EvaluationDuration:3.017576ms EvaluationString: Values:map[]}]" duration=2.416376ms

```

- Did you follow any online instructions? If so, what is the URL?  
[Provision Grafana | Grafana documentation](https://grafana.com/docs/grafana/latest/administration/provisioning/#rules)

---

<div class="post-metadata">

**Author:** ![darreng1234](https://avatars.discourse-cdn.com/v4/letter/d/57b2e6/32.png) [@darreng1234](https://community.grafana.com/u/darreng1234)\
**Post date:** [October 10, 2022, 4:24am UTC](https://community.grafana.com/t/alert-rules-provisioning-question/73439/2 "2022-10-10T04:24:38Z")

</div>

Hi I also have the same issue, trying to execute the alert without an error. I get the same error as above. Helm chart used grafana-6.40.3, App Version 9.1.7  
- refId: A  
queryType: ‘’  
datasourceUid: ‘P067175A64D1E8E5E’  
relativeTimeRange: {“from”: 600,“to”: 0}  
model:  
expression: (sum(rate(istio\_requests\_total{reporter=“destination”, response\_code=~“5.\*”, destination\_workload\_namespace=~“vn-dev”}[2m])) by (destination\_workload) / sum(rate(istio\_requests\_total{reporter=“destination”, destination\_workload\_namespace=~“vn-dev”}[2m])) by (destination\_workload))  
intervalMs: 1000  
range: true  
hide: false  
maxDataPoints: 43200  
refId: A  
- refId: B  
datasourceUid: ‘-100’  
queryType: ‘’  
model:  
conditions:  
- evaluator:  
params:  
- 0.1  
type: gt  
operator:  
type: and  
query:  
params:  
- A  
reducer:  
type: last  
type: query  
datasource:  
type: **expr**  
uid: ‘-100’  
expression: A  
intervalMs: 1000  
hide: false  
maxDataPoints: 43200  
refId: B  
type: classic\_conditions

```
        noDataState: NoData
        for: 360s
        annotations:
          value: value
        labels:
          severity: critical

```

---

<div class="post-metadata">

**Author:** ![wdttee332](https://avatars.discourse-cdn.com/v4/letter/w/eb8c5e/32.png) [@wdttee332](https://community.grafana.com/u/wdttee332)\
**Post date:** [October 21, 2024, 6:41am UTC](https://community.grafana.com/t/alert-rules-provisioning-question/73439/3 "2024-10-21T06:41:37Z")

</div>

Hi，did you fixed this issue？I am facing the same promblem too. I can’t figure out what’s exactly happenning when grafana giving this error.
