slim-bean / loki-shell

How to use Loki to store and centralize your shell history from anywhere and search it using ctrl-r and fzf
Apache License 2.0
83 stars 8 forks source link

mkdir wal: permission denied\nerror #15

Open mrmodolo opened 2 years ago

mrmodolo commented 2 years ago

Hi!

The last version caused the error "mkdir wal: permission denied\nerror" to resolve I changed the configuration file "~/.loki-shell/config/loki-binary-config.yaml" and added the lines below in the ingester section:

  wal:
    dir: ~/.cache/loki/wal

I created the folder and restarted the service.

mkdir ~/.cache/loki/wal

Thanks, Marcelo Módolo

tonywl commented 2 years ago

Also saw the same error, but the change above didn't seem to help, any suggestions?

level=info ts=2022-06-20T23:31:57.390152638Z caller=table_manager.go:340 msg="loading local table index_19161"
level=info ts=2022-06-20T23:31:57.394115301Z caller=table_manager.go:340 msg="loading local table index_19162"
level=info ts=2022-06-20T23:31:57.397997915Z caller=shipper_index_client.go:108 msg="starting boltdb shipper in 0 mode"
level=info ts=2022-06-20T23:31:57.398467226Z caller=worker.go:109 msg="Starting querier worker using query-scheduler and scheduler ring for addresses"
level=info ts=2022-06-20T23:31:57.398543411Z caller=modules.go:598 msg="RulerStorage is nil.  Not starting the ruler."
level=error ts=2022-06-20T23:31:57.399597696Z caller=log.go:106 msg="error running loki" err="mkdir wal: permission denied\nerror initialising module: ingester\ngithub.com/grafana/dskit/modules.(*Manager).initModule\n\t/src/loki/vendor/github.com/grafana/dskit/modules/modules.go:108\ngithub.com/grafana/dskit/modules.(*Manager).InitModuleServices\n\t/src/loki/vendor/github.com/grafana/dskit/modules/modules.go:78\ngithub.com/grafana/loki/pkg/loki.(*Loki).Run\n\t/src/loki/pkg/loki/loki.go:322\nmain.main\n\t/src/loki/cmd/loki/main.go:96\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:255\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1581"
slim-bean commented 2 years ago

what was listed above should have worked?

I will note that the config @mrmodolo mentioned is not a top level config, wal is under the ingester top level config like so:

ingester:
  wal:
    dir: [path to some directory that the process has write permissions to]
MattSWakefield commented 2 years ago

I'm also seeing this issue. I've set 777 permissions on the directory but it still persists. Config is as follows:

ingester:
  lifecycler:
    address: 127.0.0.1
    ring:
      kvstore:
        store: inmemory
      replication_factor: 1
    final_sleep: 0s
  wal:
    dir: ~/.cache/loki/wal/
tonywl commented 2 years ago

@MattSWakefield there are separate config files for docker and binary installation, you probably need to update the one for your install.

If you don't have your own configuration, you can just move/remove the config dir and do a reinstall, that'll also create the correct file, I believe.

MattSWakefield commented 2 years ago

@tonywl - thank you - I am running in docker, I forgot to mention that. I have done as suggested and I've tried altering the location, creating the wal directory first etc but it always hits a permissions issue even if the permissions are much more open than they should be.

Djun-Kim-at-LDS commented 1 year ago

ingester.wal.dir should be a path in the loki container's file system. Since ~/.loki-shell/data is already mounted to /loki in the container, this should work:

  wal:
    dir: /loki/.cache/loki/wal/