After enabling the Ruler deployment in Loki using Tanka/Jsonnet, the ruler pods are failing like
mkdir : no such file or directory\nerror creating index client\ngithub.com/cortexproject/cortex/pkg/chunk/storage.NewStore\n\t/src/loki/vendor/github.com/cortexproject/cortex/pkg/chunk/storage/factory.go:176\ngithub.com/grafana/loki/pkg/loki.(*Loki).initStore\n\t/src/loki/pkg/loki/modules.go:287\ngithub.com/cortexproject/cortex/pkg/util/mod │
│ ruler-84d9c69b5-6nb5l
Can you paste your entire config file (masking any sensitive data), that error message implies a problem with a different section of the config I believe.
This is good information to know, thank you, because the error you posted is not one I would expect to see for a misconfigured ruler config… but here we are
The only thing you are missing which would be worth trying is adding rule_path: to your ruler config:
Loki needs a temporary directory for evaluating rules, it’s not required to be persisted.
enable_api is only necessary if you would like to interact with your rules via API, I added it here to note that it’s not enabled by default currently.
The ruler still crashes with the same error as before. From a rough reading of the code, I suspect it is loading the chunk config store.
level=error ts=2020-12-10T23:15:12.966824939Z caller=log.go:149 msg="error running loki" err="mkdir : no such file or directory\nerror creating index client\ngithub.com/cortexproject/cortex/pkg/chunk/storage.NewStore\n\t/src/loki/vendor/github.com/cortexproject/cortex/pkg/chunk/storage/factory.go:176\ngithub.com/grafana/loki/pkg/loki.(*Loki).initStore\n\t/src/loki/pkg/loki/modules.go:287\ngithub.com/cortexproject/cortex/pkg/util/modules.(*Manager).initModule\n\t/src/loki/vendor/github.com/cortexproject/cortex/pkg/util/modules/modules.go:103\ngithub.com/cortexproject/cortex/pkg/util/modules.(*Manager).InitModuleServices\n\t/src/loki/vendor/github.com/cortexproject/cortex/pkg/util/modules/modules.go:75\ngithub.com/grafana/loki/pkg/loki.(*Loki).Run\n\t/src/loki/pkg/loki/loki.go:204\nmain.main\n\t/src/loki/cmd/loki/main.go:130\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:203\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1373\nerror initialising module: store\ngithub.com/cortexproject/cortex/pkg/util/modules.(*Manager).initModule\n\t/src/loki/vendor/github.com/cortexproject/cortex/pkg/util/modules/modules.go:105\ngithub.com/cortexproject/cortex/pkg/util/modules.(*Manager).InitModuleServices\n\t/src/loki/vendor/github.com/cortexproject/cortex/pkg/util/modules/modules.go:75\ngithub.com/grafana/loki/pkg/loki.(*Loki).Run\n\t/src/loki/pkg/loki/loki.go:204\nmain.main\n\t/src/loki/cmd/loki/main.go:130\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:203\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1373" ```
I am also assuming that the chunk store bucket and rules buckets are different. Also, as we are using workload identity, the ruler does not need any permissions over the chunks bucket. Let me try tweaking the permissions a bit.
It isn’t the permissions but when using the boltdb-shipper, the ruler is not setting the arguments for boltdb.shipper.active-index-directory or boltdb.shipper.cache-location which the querier and ingester setup and mount to their PVC.
The question now I do have is, should I configure the ruler with a PVC and set a cache location like the querier?
Can someone guide me, if we are using a default rule_path([rule_path: <filename> | default = "/rules"]) does Loki still look for a tenant id? I am using helm chart and this is my target Revision 2.4.1
More details in this gitlab issue comment.