cortex-tools icon indicating copy to clipboard operation
cortex-tools copied to clipboard

Confusing parse error messages when using loki backend

Open ekpdt opened this issue 5 years ago • 4 comments
trafficstars

Given bug.yaml:

namespace: bug
groups:
  - name: bug
    rules:
      - alert: AlwaysFire
        expr: vector(1)

cortextool rules lint --backend=loki bug.yaml gives:

ERRO[0000] unable parse rules file                       error="could not parse expression: parse error at line 1, col 1: syntax error: unexpected IDENTIFIER" file=bug.yaml
cortextool: error: prepare operation unsuccessful, unable to parse rules files: file read error, try --help

There's nothing obviously wrong at line 1, col 1. I have an invalid logQL expression and cortextool should tell me that directly.

cortextool 0.3.2

ekpdt avatar Oct 08 '20 00:10 ekpdt

Hi, any updates ?

LinTechSo avatar Apr 12 '22 07:04 LinTechSo

Still seeing this in Nov 2022 with grafana/cortex-tools:v0.10.7.

dannystaple avatar Nov 10 '22 10:11 dannystaple

also see'ing this with metric rules. cortextool rules lint metrics_namespace.yaml

cortextool: error: prepare operation unsuccessful, unable to parse rules files: file read error, try --help```

cliddlebd avatar Jan 03 '23 16:01 cliddlebd

Same here.. still have this error with cortex-tools:v0.10.7.

snk-actian avatar Jan 30 '23 13:01 snk-actian