-
Notifications
You must be signed in to change notification settings - Fork 204
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: Can't mount with -o allow_other
on WSL, and blobfuse2 print no error message and errno is 0
#1081
Comments
-o allow_other
on WSL, but blobfuse2 print no error message and errno is 0-o allow_other
on WSL, and blobfuse2 print no error message and errno is 0
"There is definitely a bug in blobfuse2, since it doesn't print error message and errno is 0 when the mount operation actually failed." : When fuse based system is mounted it forks into another process. This failure is hit in child process and by that time parent process is already complete and hence it can not print anything on that console. This is the reason to print the logs in a log file. Blobfuse will do config validation at its end before the fork where if any of your config is invalid, error will be printed and exit code will be non-zero but allow_other is a fuse config and hence it can not be validated by blobfuse binary itself. |
Why Blobfuse v1 can print error logs as expected but blobfuse2 can't? |
I think parent process should wait for child process until it has completed the mount operation successfully, otherwise we can never know whether the mount operation is successful or not. |
can we reopen this issue? |
@vibhansa-msft blob csi driver rely on the result of |
In case of v1 we cache the stderr handle and it uses that to print out the error message, but allow_other failure is not returned back in form of an error code. Once mount is complete (fork the child) parent always returns back with success there as well. |
One potential way to get the error on console and get a non-0 error code is to mount in foreground which means your shell will be blocked till the time blobfuse is running. |
User who has executed the mount command may not have access to /etc/fuse.conf file and hence we can not pre-validate that mount will work or not. Hence relying on fuse to provide the error is the only option we have here. |
Also, do you really need allow_other option to be there? It's more of a security threat using this option as this means your mount point is available to all the users on the system. So, unless really required you shall not use this feature. |
I've tried blobfuse v1 and the errno is non-zero. |
I think this behavior is acceptable, IMO, mount operation should be synchronized, otherwise we cannot know whether the mount point is ready for usage. |
No, it's just for testing. |
Yes I was investigating that from my end too. Reason for this is in v1 we fork using libfuse's mount api directly but in case of Golang, that does not work directly so we need to create a child process before we call libfuse's mount. Child process starts again from beginging and not from the point its forked and hence it's not possible here to catch that error code. I do not see any easy way out of this as of now. If possible either you can avoid using allow_other or try mounting in foreground which just means your shell will be hung up till blobfuse runs and may be you will need another bash to access the mount point. |
Is it possible to choose mounting in foreground using blobfuse2? |
Yes it is, you can provide a cli option "--foreground=true"to do the same. |
Is this a new option in blobfuse2 or blobfuse v1 also support? |
V1 also supports foreground mount with "-d" cli option, in V2 both -d and --foreground shall work fine. Also, just to reiterate if you mount in foreground your shell will be blocked until you unmount blobfuse. |
We never used this option in V1 before, but we did not encounter such problem ever. I wonder is there any behavior change between V1 and V2? |
Could you take a look to confirm whether there are any other similar issues like this could happen as well? |
#1079 Pod deletion will cause global mount point to disappear. The root cause is csi driver will bind mount the global mount point into Pod volume immediately after blobfuse2 mount return successfully. However, fuse is still mounting at background, so actually bind mount and fuse mount happened at the same time, this will lead to a problem that unmount the bind mount (when deleting a Pod) will cause the original mount point unmounted as well. #1081 Mount is actually failed, but the errno returned by blobfuse2 is 0 and no error log (both terminal and log file).
Which version of blobfuse was used?
blobfuse2 2.0.2
Which OS distribution and version are you using?
WSL2.0
If relevant, please share your mount command.
blobfuse2 mount ~/myblob -o allow_other --file-cache-timeout-in-seconds=120 --use-attr-cache=true --cancel-list-on-mount-seconds=10 -o attr_timeout=120 -o entry_timeout=120 -o negative_timeout=120 --log-level=LOG_WARNING --cache-size-mb=1000 --container-name=pvc-0e85db3b-d632-49ab-b4ba-cc93d332a132 --pre-mount-validate=true --use-https=true --empty-dir-check=false --tmp-path=/mnt/tmp
What was the issue encountered?
mount failed, but blobfuse2 print no error message, and the errno is 0.
![image](https://user-images.githubusercontent.com/44308864/224633636-24978f6d-0e93-42e4-922e-d6341cbcc409.png)
blobfuse mount failed as well, but it prints concrete error message which help me to solve this problem.
![image](https://user-images.githubusercontent.com/44308864/224635905-62cdb054-acf9-471a-ab3b-3abeb5be04be.png)
There is definitely a bug in blobfuse2, since it doesn't print error message and errno is 0 when the mount operation actually failed.
Another question is, why mount with
-o allow_other
on WSL would fail whereas Linux won't? I checked/etc/fuse.conf
, the content of them is the same:Have you found a mitigation/solution?
mount without -o allow_other on WSL
Please share logs if available.
The text was updated successfully, but these errors were encountered: