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 when using named volume for loki storage #1833

Closed
Mario-Hofstaetter opened this issue Mar 22, 2020 · 1 comment · Fixed by #1834
Closed

Permission denied when using named volume for loki storage #1833

Mario-Hofstaetter opened this issue Mar 22, 2020 · 1 comment · Fixed by #1834

Comments

@Mario-Hofstaetter
Copy link
Contributor

Describe the bug
When using a named docker volume to persist data for directory: /tmp/loki loki fails to start with

level=error ts=2020-03-22T18:16:33.326631457Z caller=log.go:141 msg="error initializing bucket client" err="mkdir /tmp/loki/chunks: permission denied"

This is not the case with image grafana/loki:v1.3.0, because the USER changed recently:
45b51ef#diff-0d3766d51f4b0ce5183c885a65c6045b

To Reproduce
On any docker host (e.g. https://labs.play-with-docker.com) run:

  • wget https://gist.githubusercontent.com/Mario-Hofstaetter/184376e4449aa25733c286f9659dedcf/raw/a7ddb12495a37bd2228913510a430a24670af271/docker-compose.yml
    this has been edited from /master/cmd/loki/loki-local-config.yaml
  • Run docker-compose up loki

Expected behavior
Loki should able to use a named volume to persist data, at least for the default data directory.

Environment:

  • docker, image grafana/loki:latest (id /master/cmd/loki/loki-local-config.yaml)

Suggested Solution
This can be fixed by creating /tmp/loki and setting permissions in Dockerfile.
But /tmp/loki is a poor choice for the persistent data directory.

  • Change directory for lokal storage_config to /loki/
  • Set permissions for /loki/ and /etc/loki/
@Depechie
Copy link

Depechie commented Mar 23, 2022

Although this name change is ok, Tempo never had a problem with creating /wal and /blocks subfolders in /tmp/tempo and is still using /tmp naming.
Would be nice all grafana tools use the same setup for docker ( docker-compose ).

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

Successfully merging a pull request may close this issue.

2 participants