Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please don't parse dotfiles in loki alerts (ruler) directory #4654

Open
cronolio opened this issue Nov 5, 2021 · 3 comments
Open

please don't parse dotfiles in loki alerts (ruler) directory #4654

cronolio opened this issue Nov 5, 2021 · 3 comments

Comments

@cronolio
Copy link

cronolio commented Nov 5, 2021

docker image: grafana/loki:2.3.0

loki        | level=error ts=2021-11-05T09:38:49.153828932Z caller=ruler.go:481 msg="unable to list rules" err="failed to list rule groups for user fake: failed to list rule group for user fake and namespace .alerts.yml.swp: error parsing /etc/loki/alerts/fake/.alerts.yml.swp: /etc/loki/alerts/fake/.alerts.yml.swp: yaml: control characters are not allowed"
@stale
Copy link

stale bot commented Jan 9, 2022

Hi! This issue has been automatically marked as stale because it has not had any
activity in the past 30 days.

We use a stalebot among other tools to help manage the state of issues in this project.
A stalebot can be very useful in closing issues in a number of cases; the most common
is closing issues or PRs where the original reporter has not responded.

Stalebots are also emotionless and cruel and can close issues which are still very relevant.

If this issue is important to you, please add a comment to keep it open. More importantly, please add a thumbs-up to the original issue entry.

We regularly sort for closed issues which have a stale label sorted by thumbs up.

We may also:

  • Mark issues as revivable if we think it's a valid issue but isn't something we are likely
    to prioritize in the future (the issue will still remain closed).
  • Add a keepalive label to silence the stalebot if the issue is very common/popular/important.

We are doing our best to respond, organize, and prioritize all issues but it can be a challenging task,
our sincere apologies if you find yourself at the mercy of the stalebot.

@stale stale bot added the stale A stale issue or PR that will automatically be closed. label Jan 9, 2022
@ebini
Copy link

ebini commented Feb 1, 2022

same issue here, also with loki 2.4.2 (helm chart 0.42.1)

setup loki ruler config like in #3922:

loki:
  config: |
    ruler:
      alertmanager_url: {{ .Values.ruler.alertmanagerUrl }}
      enable_alertmanager_v2: true
      enable_api: true
      external_url: {{ .Values.ruler.alertmanagerExternalUrl }}
      ring:
        kvstore:
          store: memberlist
          prefix: rulers/
      rule_path: /tmp/loki
      storage:
        type: local
        local:
          directory: /etc/loki/rules/fake

and ruler:

loki:
  ruler:
    enabled: true
    directories:
      # in single tenant mode, the tenant ID is "fake"
      # https://grafana.com/docs/loki/latest/operations/multi-tenancy/ 
      # override this section in env-specific values
      fake: 
        testRules.yaml: |
          groups:
            - name: test1
              rules:
                - alert: test1
                  expr: |
                    1 > 0
                  for: 0m
                  labels:
                    # testing, post to #catchall for now
                    slack: slack-catchall
                    severity: warning
                  annotations:
                    summary: TEST: meowburgers and cheese

starting up loki:

 level=error ts=2022-02-01T20:09:15.359059977Z caller=ruler.go:485 msg="unable to list rules" err="failed to list rule groups for user ..2022_02_01_20_05_24.216789654: failed to list rule group for user ..2022_02_01_20_05_24.216789654 and namespace testRules.yaml: error parsing /etc/loki/rules/fake/..2022_02_01_20_05_24.216789654/testRules.yaml: /etc/loki/rules/fake/..2022_02_01_20_05_24.216789654/testRules.yaml: yaml: line 11: mapping values are not allowed in this context"

this is a mounted configmap and if i "shell into the pod"

/etc/loki/rules/fake $ ls -al
total 12
drwxrwsrwx    3 root     loki          4096 Feb  1 20:05 .
drwxr-xr-x    3 root     root          4096 Feb  1 19:58 ..
drwxr-sr-x    2 root     loki          4096 Feb  1 20:05 ..2022_02_01_20_05_24.216789654
lrwxrwxrwx    1 root     loki            31 Feb  1 20:05 ..data -> ..2022_02_01_20_05_24.216789654
lrwxrwxrwx    1 root     root            21 Feb  1 19:58 testRules.yaml -> ..data/testRules.yaml

@LinTechSo
Copy link
Contributor

Hi, any updates ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants