-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
unexpected file permission error in container #783
Comments
@jpetazzo can you take a look at this one? |
This is a kind of bug in AUFS. When a directory has a given permission mask in a lower layer, the upper layers cannot have a broader mask. Well, they can, but the more restrictive permission mask will be enforced anyways. The rationale is the following:
Multiple behaviors could be considered "acceptable" in this scenario:
My understanding is that the last solution should be used, but for some reason, AUFS doesn't behave correctly. It might be because the directory exists in a lower layer, then doesn't exist anymore (because of the rm), then exists again (because of the ADD). I'm willing to take a guess: the logic that decides whether or not to do a whiteout is not exactly the same as the one looking up permissions; so the first one stops when /etc/puppet is marked as non-existent in the middle layer, while the latter goes bottom up. Anyway! As a workaround, you can |
Labelling as aufs-related. |
Since this is documented aufs behavior, we can 1) close this as wontfix, 2) close + document the behavior in the docker docs, or 3) other? |
@jpetazzo what do you think? |
Hmmm... What about a "KNOWN BUGS AND ISSUES" section in the documentation? /cc @metalivedev |
Ok, some discussion here: https://botbot.me/freenode/docker-dev/msg/6889335/ |
This bit me. |
@xaviershay Could you give me the steps to reproduce the problem? I haven't been able to see an error with @astraw 's steps.
|
Having trouble replicating again. The shape of my setup was building an image on top of itself (which is potentially a terrible idea):
|
That looks to me like you'd run into the AUFS 42 layer limit pretty quickly. |
Yeah that was the next bug I hit :) Have since redone my process to always build off a single base image. |
Since Docker is moving away from AUFS to use DM in the next major release, this bug won't appear anymore. |
We're still going to have AUFS in 0.7, so I'm reopening this. :) |
Just got bit by this too. We've got sequential builds, and at several points we need to obliterate a directory that was ADDed in a previous build step. I was surprised that the following command silently fails:
I'm not 100% sure why, but the workaround suggested by @jpetazzo above seems to work:
The only reason we have to do the "rm" in the first place is because the following line is really a
|
The above discussion from several months ago at version 0.7 suggests that DeviceMapper became the recommended backend. But now we're on 0.9.1 and AUFS still seems to be the default backend. For end-users like me, default=recommended. This means docker is inconsistent. What should I be using? Also, where is the documentation on AUFS vs DeviceMapper vs whatever else? I don't see any. |
Also @jpetazzo
What is the next major release? Did you mean 1.0? |
James, aufs is the default if your system supports it. This is simply because it is the most battle-tested storage driver and has less moving parts in general. Devmapper is the default for non-aufs systems, which is the majority of systems in the wild since aufs is not part of the upstream kernel. In doubt, we recommend using the default - keeping in mind the default might be different from system to system. On Wed, Mar 26, 2014 at 12:26 PM, James Harrison Fisher
|
As for Jerome's statement, it is no longer accurate. Our initial plan was to phase out aufs completely because devmapper appeared to be the best option in 100% of cases. That turned out not to be trye, there are tradeoffs depending on your situation and so we are continuing to maintain both. On Wed, Mar 26, 2014 at 12:26 PM, James Harrison Fisher
|
@shykes okay, what are the tradeoffs? Are the issues with devmapper, say, performance tradeoffs, or outright bugs, like this one with aufs? If there are tradeoffs and the user is expected to make that decision, then those tradeoffs should be documented. |
Frankly, I believe that I should be allowed to shoot myself in the foot with the aufs thing. This isn't a funky implementation bug, it was a conscious decision. Does anyone have a patch for aufs that can toggle this behavior? |
@jameshfisher you are right but let's discuss this somewhere else, we are veering off-topic for this issue. |
Any progress on this? We are consistently seeing this behaviour with our mysql /var/lib/mysql directories under docker 0.11.1 and periodically in 0.9.1 |
@jberkus thanks for the info. I was able to reproduce it on Ubuntu 14.04 on kernel 3.19.something. Would be nice to know which version of aufs its solved in, possibly the Docker Mac team can bump the version to include the patch that's needed |
I can confirm encountering this issue on the the docker os x beta-15 (current version). I have switched back to docker-machine in the meantime. |
find /etc/pappet -type f | xargs -L1 rm -f Here is link to my Gist |
We are seeing a very similar issue with Overlay. Our current guess is that it is caused by the bug fixed in kernel 4.4.6 by this commit: https://lkml.org/lkml/2016/1/31/82 We have not yet managed to test with 4.4.6. |
PostgreSQL may fail at startup with /etc/ssl/private/ssl-cert-snakeoil.key permission denied. This is due to a limitation of the AUFS backend which can be worked around by recreating the /etc/ssl/private directory. Ref to gavodachs/docker-dachs#1 for the actual bug and moby/moby#783 for more details on the AUFS issue. Change-Id: I0afe01e880f4ace4a38d3751a8c621c97d97d658
Reorder layer commands in order to install ssl-cert in the first layer in order to avoid permission denied issue when starting postgresql on /etc/ssl/private/ssl-cert-snakeoil.key. This is due to a limitation of the AUFS docker backend. Ref to gavodachs/docker-dachs#1 for an instance of the bug and to moby/moby#783 for more details on the AUFS issue. Change-Id: I0afe01e880f4ace4a38d3751a8c621c97d97d658
On some distributions bundler would fail with writing to the rubygem cache. This seems to be the aufs bug mentioned in moby/moby#783 Fixes openSUSE#3940
… recent docker
Thanks, it works for me! |
I've narrowed down a problem in an originally more involved setup. Consider the following Dockerfile:
When run with the following:
I see an unexpected permission error in the final command. This is with Docker 0.3.4 from the PPA on Ubuntu 13.04 with kernel 3.8.0-19-generic. Interestingly, if I remove the like "RUN rm -rf /etc/puppet" from the Dockerfile, I no longer see the permission error.
The text was updated successfully, but these errors were encountered: