-
Notifications
You must be signed in to change notification settings - Fork 121
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
gRPC-FUSE reports inaccurate executable permissions #5509
Comments
Just made an even simpler reproducible test case entirely in bash: bash-3.2$ docker run --rm --volume="$(pwd):/tmp" python:3 bash -c "
cd /tmp
rm -f testfile.tmp
touch testfile.tmp
stat --format='%a' testfile.tmp
[ -x testfile.tmp ] && echo 'access'"
644
access |
Further testing: docker run --rm --volume="$(pwd):/tmp" cirros sh -c "
cd /tmp
rm -f testfile.tmp
touch testfile.tmp
stat -c '%a' testfile.tmp
[ -x testfile.tmp ] && echo 'access'"
644 Interestingly, Likely, the version of |
More testing: |
I see exactly the same problem when I try to compile netty :/ |
Seems that the distributions that do not fail this test mostly use This makes me think that gRPC-FUSE is doing something where the access to file is being tested as root, which triggers a common edge-case behavior in the standard POSIX |
It saw this failing on centos... |
Still exists as of 3.3.1. docker run -u nobody --rm --volume="$(pwd):/tmp" debian sh -c "
cd /tmp
rm -f testfile.tmp
touch testfile.tmp
stat -c '%a' testfile.tmp
[ -x testfile.tmp ] && echo 'access'"
644
access |
/cc @djs55 |
Issues go stale after 90 days of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
/remove-lifecycle stale
…On Mon, Jul 26, 2021 at 9:00 PM docker-desktop-robot < ***@***.***> wrote:
Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen comment.
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or
#docker-for-windows.
/lifecycle stale
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5509 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABJNQUVACXS5ZR5JBI7UZDTZYAKJANCNFSM4Z2PVIXA>
.
--
Misha
|
Noticed this as well on macOS Big Sur (not using the new virt. framework), Docker Desktop Version 4.0.0 (4.0.0.12) with CentOS 6.10 image. |
I think this is the same as #5029 and has the same root cause as #5944 (comment) . Quoting from there: We use Linux FUSE to mount the host filesystem. There are 2 permission models: https://elixir.bootlin.com/linux/latest/source/fs/fuse/dir.c#L1197 . We delegate the permission checks to the server (by not setting However we also care about performance. Many filesystem options performed by Linux will be prefixed by a So it's a combination of
results in the inaccuracy of the |
@djs55 Fascinating and incredibly helpful context. Thank you! I am not familiar with the filesystem management on that level, but your proposal for the root cause makes sense to me—I haven't observed any behavior that would contradict it. I do think that this behavior is far enough outside the bounds of expectation that it should be possible to disable it without disabling all of gRPC-FUSE (maybe with a config-file-only setting?), which would provide most of the existing benefits and presumably still offer some performance benefit, even with the extra access calls. But whether or not it's worth it to work on a fix like that would depend on the performance impact tradeoff. Conversely, would it somehow be possible to disable the Finally, for the sake of any others others following this this post, I do also want to share the two workarounds you mentioned in the rest of that comment that do not involve turning off gRPC-FUSE, which might be helpful in some use-cases:
In addition to these workarounds, I'm wondering if there's any chance using the new BigSur virtualization framework could either resolve the issue, or otherwise improve performance to mitigate the impact of fixing it? Thanks again for looking into this. |
@myw thanks for the quick reply! For what it's worth, I'm not satisfied with the current state either. There are some improvements coming in macOS Monterey in the |
I came here after finding #5007. This impacts the database initialisation scripts I want to use with postgres (& mysql) images. |
Issues go stale after 90 days of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
/remove-lifecycle stale |
/lifecycle frozen |
This still exists in 4.34.3 (170107) Engine 27.2.0 on Mac OS X 15.0.1 (24A348) Surprised this bug has been in existence for so long - The difference between the
Is there any reason this can't be fixed? Seems like a pretty major issue. You can workaround this by simply not using mounted volumes and copy your files into the target container but this means you lose development speed. |
61A7AFC6-411E-4184-B8AE-A79CA0239084/20210326003855
Summary
gRPC-FUSE volumes seem to be incorrectly reporting some permissions. Namely,
python2.7
seems to think non-executable files are executable, when mounted via gRPC-FUSE volumes. I present a minimal test case below.Expected behavior
A host directory is mounted inside my container with a bind mount. When I test the access of non-executable file in that directory with Python, I expect it to tell me that it is non-executable. i.e. if
stat
tells me file foo has mode0644
,os.access('foo', os.X_OK)
should returnFalse
.When I try this with gRPC-FUSE turned off, this is what happens.
Actual behavior
When gRPC-FUSE is enabled,
os.access('foo', os.X_OK)
returnsTrue
, even though the file has mode0644
.Information
This is quite reproducible.
A minimal test case to highlight the issue is described below. For the sake of brevity, I am not posting further detailed examples, bit I have also verified that the erroneous behavior happens with a non-root user in the container. I have not tested with
python3
or with other python2 base images.Steps to reproduce the behavior
0. Control: Show that in a container without a bind mount,
python
correctly identifies a file with mode0644
as non-executable.Because the result of the Python expression is
False
,python
correctly identifies that it does not have execute permissions on the file.This is the expected behavior and is true regardless of whether or not Use gRPC FUSE for file sharing is enabled, because the file is not on a bind mount.
1. Expected Behavior With Use gRPC FUSE for file sharing DISABLED, run the same code as above, but have the file be on a bind mount. Note the addition of
--volume="$(pwd):/tmp"
is the only change to the command.The result is the same as the control: the expected behavior.
2. Actual Behavior Now, ENABLE Use gRPC FUSE for file sharing, and run the exact same code as in 1. above:
Now, even though Python correctly sees the mode of the file,
os.access
incorrectly returnsTrue
. One consequence of this behavior is thatnosetests
ignores all files by default because it thinks they are executable.Happy to provide additional information to help debug.
Thanks!
The text was updated successfully, but these errors were encountered: