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

Permission denied loki components #12797

Open
brunodeoliveiramacedo opened this issue Apr 26, 2024 · 2 comments
Open

Permission denied loki components #12797

brunodeoliveiramacedo opened this issue Apr 26, 2024 · 2 comments

Comments

@brunodeoliveiramacedo
Copy link

I am using Loki operator 0.6.0.

I am getting this error for index-gateway, ingester and compactor.

level=error ts=2024-04-26T01:41:45.697144768Z caller=log.go:230 msg="error running loki" err="mkdir /tmp/loki/index_cache: permission denied\nerror creating index client\ngithub.com/grafana/loki/pkg/storage.(*store).storeForPeriod\n\t/src/loki/pkg/storage/store.go:295\ngithub.com/grafana/loki/pkg/storage.(*store).init\n\t/src/loki/pkg/storage/store.go:177\ngithub.com/grafana/loki/pkg/storage.NewStore\n\t/src/loki/pkg/storage/store.go:155\ngithub.com/grafana/loki/pkg/loki.(*Loki).initStore\n\t/src/loki/pkg/loki/modules.go:690\ngithub.com/grafana/dskit/modules.(*Manager).initModule\n\t/src/loki/vendor/github.com/grafana/dskit/modules/modules.go:136\ngithub.com/grafana/dskit/modules.(*Manager).InitModuleServices\n\t/src/loki/vendor/github.com/grafana/dskit/modules/modules.go:108\ngithub.com/grafana/loki/pkg/loki.(*Loki).Run\n\t/src/loki/pkg/loki/loki.go:461\nmain.main\n\t/src/loki/cmd/loki/main.go:110\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:267\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1650\nerror initialising module: store\ngithub.com/grafana/dskit/modules.(*Manager).initModule\n\t/src/loki/vendor/github.com/grafana/dskit/modules/modules.go:138\ngithub.com/grafana/dskit/modules.(*Manager).InitModuleServices\n\t/src/loki/vendor/github.com/grafana/dskit/modules/modules.go:108\ngithub.com/grafana/loki/pkg/loki.(*Loki).Run\n\t/src/loki/pkg/loki/loki.go:461\nmain.main\n\t/src/loki/cmd/loki/main.go:110\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:267\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1650"

@hogisim314
Copy link

I got an error from compactor, index-gateway, ingestor too.
I don't know how to solve this. Did you solve it?

@brunooliveiramac
Copy link

brunooliveiramac commented May 20, 2024

I got an error from compactor, index-gateway, ingestor too. I don't know how to solve this. Did you solve it?

Rolled back to an older version loki:2.8.2

Then I'm patching:

kubectl patch statefulset lokistack-prod-index-gateway --namespace loki --patch '{
  "spec": {
    "template": {
      "spec": {
        "initContainers": [
          {
            "name": "fix-permissions",
            "image": "busybox:latest",
            "command": [
              "sh",
              "-c",
              "id; ls -la /tmp/; mkdir -p /tmp/loki; chown 10001:10001 /tmp/loki; mkdir -p /tmp/wal; chown 10001:10001 /tmp/wal; mkdir -p /tmp/loki/rules; chown 10001:10001 /tmp/loki/rules; mkdir -p /tmp/loki/index; chown 10001:10001 /tmp/loki/index;"
            ],
            "imagePullPolicy": "Always",
            "securityContext": {
              "privileged": true,
              "runAsUser": 0,
              "runAsGroup": 0,
              "runAsNonRoot": false
            },
            "terminationMessagePath": "/dev/termination-log",
            "terminationMessagePolicy": "File",
            "volumeMounts": [
              {
                "name": "storage",
                "mountPath": "/tmp/loki"
              }
            ]
          }
        ]
      }
    }
  }
}' --type merge

The patch doesn't work in Loki 3.0.0. I believe the operator rolls back when I make the change to the stateful set.

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

No branches or pull requests

4 participants