-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[Bug]: Default badger path is no longer writtable #4906
Comments
Makes sense, but I don't think we're going to fix that. You have a manual workaround of changing permissions on the existing files to non-root user (see #4906 (comment)). To play devil's advocate, how would you expect Jaeger to handle that? Changing to non-root user was the right choice from security perspective. The other thing is we should call this out in the release notes as a breaking change and suggest remediation steps, like running chown - would you like to submit a PR for that? |
Yes please. This is a breaking change, it should be in https://github.com/jaegertracing/jaeger/releases/tag/v1.50.0. I would submit a PR but i don't know what command i should run. |
I think if the directory is added into the container and have permissions created for it like this:
Then it works fine:
Minimal PR created #4910; if you're happy with this then can update all other Dockerfiles. |
## Which problem is this PR solving? - Resolves #4906 ## Description of the changes - Add #4783 to breaking changes for v1.50.0 ## Other * [ ] once this PR is merged, update release notes on GitHub Signed-off-by: Yuri Shkuro <[email protected]>
updated changelog and release notes |
thanks for reporting! |
I'm not a Docker expert, how would I prevent this problem from occurring with my existing Docker-compose file? services:
jaeger:
image: jaegertracing/all-in-one:latest
container_name: jaeger-demo
command: [ "--query.max-clock-skew-adjustment", "500ms" ]
environment:
- COLLECTOR_OTLP_ENABLED=true
- SPAN_STORAGE_TYPE=badger
- BADGER_EPHEMERAL=false
- BADGER_DIRECTORY_VALUE=/badger/data
- BADGER_DIRECTORY_KEY=/badger/key
volumes:
- jaeger_data:/badger
ports:
- "16686:16686" # UI
networks:
- default
volumes:
jaeger_data: |
@miparnisari Have you found a way to fix this directly in the docker-compose file? I'm facing the same problem. |
@t-pohl, no :( I just pinned the version of Jaeger. |
@miparnisari I managed to upgrade using the following instructions: Since version
Start a root shell:
Change the volume ownwership:
Afterwards start jaeger and check the logs. Maybe this can help you too. |
Turns out you can set |
I just tried an experiment, on MacOS with Docker Desktop (results could be different on different OS) With version before change
Here the container is running as With newer version after UID change
Here the Jaeger process is running as 10001 and files are owned by 10001 (I am not sure how the latter happens). The directory is writable by that UID. |
I enter the docker container(on rocky linux):
all files' owned by |
@ivanallen did you try to chown it to the new user? |
No, I didn't do anything. I executed the command in a completely new environment (rocky Linux). I temporarily rolled back to jaegertracing/all-in-one:1.49, which works fine in rocky Linux. |
While you can chown existing dirs from earlier installations, how would you do that if you start from scratch? I may be missing something, but isn't that some kind of a hen-and-egg problem? Shouldn't there be a |
@MarkusGeigerDev if you are starting fresh without previous data there should be no issues at all. If you are still getting permission issues it's likely the target directory does not allow writes by the container irrespective of which user id is used inside the container. Please provide reproducible example if you think otherwise, ie which OS, which containers runtime, which user it runs as, container command with volume mounting, and existing permissions on the parent directory on the host. |
@yurishkuro Thanks for getting back to me!
The problem seems to be that the user 10001 can't even create the internal directories /badger/keys and /badger/values on startup:
When I set When I remove the #-comment from the |
Did you create I would recommend running a shell inside the container and trying to create files (perhaps using different users), to see what's causing the permissions issue. NB: this could be Windows specific.
What if you try some other user that is palatable to Windows? The default 10001 in Jaeger Dockerfile is just "a suggestion", you don't have to run with it. But it would be nice to get to the bottom of this and add documentation. |
@yurishkuro: I added another service to my docker-compose that sets up everything before jaeger starts up:
The init-jaeger service still runs as root (to be able to |
@MarkusGeigerDev thanks! I suspect you can use the jaeger image itself, it has shell in it. Also, did you try to create just the /badger dir? I think it should be sufficient and less error prone (your solution seems to rely on some understanding of internal organization of badger sub-dirs) |
Haha, you're right, this works as well :)
EDIT: Oh, BTW, I totally forgot to answer your other suggestions - sorry for that:
You cannot easily map users from a Linux container to Windows users. Windows uses a very different technical scheme for users and groups called SIDs. For example, the "root" group ("Administrators", actually) is |
Documented in #5282 |
@MarkusGeigerDev @yurishkuro This is my values.yaml file -
helm chart - https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts I have tried using the root user as well and nothing changed. Error details -
What is the issue here? |
What happened?
With the release of 1.50, documented badger default path is no longer writable as it is owned by root after the changes in #4783
Steps to reproduce
Expected behavior
Jaeger to start up
Relevant log output
No response
Screenshot
No response
Additional context
No response
Jaeger backend version
1.50
SDK
No response
Pipeline
No response
Stogage backend
No response
Operating system
No response
Deployment model
No response
Deployment configs
No response
The text was updated successfully, but these errors were encountered: