-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 on startup of Loki > 2.3.0 with docker volumes in docker-compose #5513
Comments
I tried your above config, and could not replicate that error message.
The documentation is incorrect; the WAL is enabled by default: If you add this under your wal:
enabled: false Then Loki will start up just fine. wal:
dir: /loki/wal |
Hi @dannykopping, looks like I copied the wrong line after scrolling up in my terminal. What is WAL ?? |
WAL is the "Write-Ahead Log" which the ingester uses to protect against data loss with unexpected crashes. |
I updated the docs so we accurately reflect that the WAL is enabled by default as of v2.4.0: |
Hm, I'm sorry, but I fail to see how that solves the problem. I'm not familiar with the details of WAL and the resulting permission error, but to me it sounds like there's maybe a |
The recommendation is to set the directory, not to turn it off:
We can't change anything in the docker image because otherwise the WAL will not be persisted. What we can do is update the docker instructions, which I'm busy trying to organise with my team. |
Sorry to hijack the thread, but @dannykopping seeing #1833 and #1949 I'm wondering where we are in how to use docker-compose with Loki 2.4.1. Is this new mapping to /loki instead of /tmp/loki already live? Also most of the example configs still use the /tmp structure |
Is it inherently wrong to use the /tmp structure? |
Was encountering this issue as well and realized the Loki container runs by default as user and group 10001. Solved the issue by changing the owner of the Loki bind to 10001:10001. This can also be resolved by passing the user and group of your preference as parameters when deploying the container. Ref: https://grafana.com/docs/loki/latest/installation/docker/ |
My solution:
docker run:
|
thank you, only your solution is working, if we want use host directory instead volume directory |
The giga chad solution that worked for me is to define user as root in compose user: "root" |
sudo chmod 777 /loki |
Describe the bug
When launching Loki in a docker-compose setup with a Docker volume to store the data, Loki runs into a permission denied error at startup.
To Reproduce
Steps to reproduce the behavior:
docker-compose.yml
from below with Loki version set to 2.3.0loki-config.yml
from belowdocker-compose up -d && watch docker ps -a
and observe that Loki 2.3.0 starts as expecteddocker-compose down && docker container rm db-loki && docker volume rm loki_data
to stop the container and delete the volumedocker-compose.yml
to use Loki version 2.4.0docker-compose up -d && watch docker ps -a
and observe that Loki 2.4.0 dies right at the startdocker-compose.yml
config-loki.yml
The logging output of the failed container shows the permission error:
Expected behavior
Starting Loki with storage in Docker volumes should work with any version.
Environment:
The text was updated successfully, but these errors were encountered: