Skip to content
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

Relative paths are not working in config file #1116

Closed
kostinalexey opened this issue Apr 21, 2023 · 8 comments · Fixed by #1126
Closed

Relative paths are not working in config file #1116

kostinalexey opened this issue Apr 21, 2023 · 8 comments · Fixed by #1126
Assignees
Milestone

Comments

@kostinalexey
Copy link

Which version of blobfuse was used?

v2

Which OS distribution and version are you using?

ubuntu 20.04 (WSL2)

If relevant, please share your mount command.

blobfuse2 mount data --config-file conf1.yaml

attr_cache:
  timeout-sec: 7200
azstorage:
  account-name: ***
  container: ***
  endpoint: https://***
  mode: key
  sdk-trace: true
  type: adls
  update-md5: false
  validate-md5: false
  virtual-directory: false
components:
- libfuse
- file_cache
- attr_cache
- azstorage
file_cache:
  max-size-mb: 4096
  path: ./cache
  timeout-sec: 120
libfuse:
  attribute-expiration-sec: 240
  entry-expiration-sec: 240
  negative-entry-expiration-sec: 120
logging:
  file-path: /***
  level: log_info
  type: base
read-only: false

What was the issue encountered?

If relative path is used in cache path then mount half-working. I can see container is mounted and can see files in the container. But it is not possible to read files because cache is not working.

BTW the cache directory is created correctly by blobfuse even with relative path in conf file.

Have you found a mitigation/solution?

Use absolute paths

Please share logs if available.

Fri Apr 21 12:34:34 BST 2023 : blobfuse2[24709] : LOG_ERR [cache_policy.go (96)]: cachePolicy::getCacheUsage : error running du [exit status 1]
Fri Apr 21 12:34:35 BST 2023 : blobfuse2[24709] : LOG_ERR [file_cache.go (806)]: FileCache::OpenFile : error creating directory structure for file ******* [mkdir cache: permission denied]
Fri Apr 21 12:34:35 BST 2023 : blobfuse2[24709] : LOG_ERR [libfuse_handler.go (647)]: Libfuse::libfuse_open : Failed to open ******* [mkdir cache: permission denied]
Fri Apr 21 12:34:35 BST 2023 : blobfuse2[24709] : LOG_ERR [file_cache.go (806)]: FileCache::OpenFile : error creating directory structure for file ******* [mkdir cache: permission denied]
Fri Apr 21 12:34:35 BST 2023 : blobfuse2[24709] : LOG_ERR [libfuse_handler.go (647)]: Libfuse::libfuse_open : Failed to open ******** [mkdir cache: permission denied]
Fri Apr 21 12:34:36 BST 2023 : blobfuse2[24709] : LOG_ERR [cache_policy.go (96)]: cachePolicy::getCacheUsage : error running du [exit status 1]
Fri Apr 21 12:34:36 BST 2023 : blobfuse2[24709] : LOG_ERR [cache_policy.go (96)]: cachePolicy::getCacheUsage : error running du [exit status 1]
Fri Apr 21 12:34:36 BST 2023 : blobfuse2[24709] : LOG_ERR [cache_policy.go (96)]: cachePolicy::getCacheUsage : error running du [exit status 1]
Fri Apr 21 12:34:36 BST 2023 : blobfuse2[24709] : LOG_ERR [cache_policy.go (96)]: cachePolicy::getCacheUsage : error running du [exit status 1]
@vibhansa-msft
Copy link
Member

"FileCache::OpenFile : error creating directory structure for file ******* [mkdir cache: permission denied]" : your "./cache" directory is not having permissions for the user who has mounted blobfuse. Kindly ensure required permissions are there.
For the second issue, 'du' command is not working on your system. You can either install it manually or ignore the error. It just tries to check the local disk space and do early eviction if disk is getting full. Not having 'du' will just fail this flow and files will be deleted from local-cache purely on basis of timeout (120 seconds in your case).

@vibhansa-msft vibhansa-msft self-assigned this Apr 22, 2023
@vibhansa-msft vibhansa-msft added this to the V2-2.0.3 milestone Apr 22, 2023
@kostinalexey
Copy link
Author

As I said in my original email the cache directory is created by the blobfuse and has correct permissions. The "du" command is also present on the system. As I suggested in the workaround if absolute paths are used all is working as expected.
Have you tried to reproduce the problem?

@vibhansa-msft
Copy link
Member

file_cache:

path: /mnt/blobfusetmp

path: ./blobfusetmp

for me both works fine and no issues observed. Tried both with directory already present vs not present. In any combination it works well for me. As per logs its clearly showing some permission issue. Can you add "-o allow_other" to your cli param and recheck.

@kostinalexey
Copy link
Author

I don't think WSL2 supports "allow_other", in any case I might not want to allow others to access the mount, so this is not a good solution. Here is the log:
log_with allow_other.txt

Here is the complete test showing it does not work with relative path. To reproduce the error it is important to try writing something to a file
image
Config file
conf_rel.yaml.txt
The log file is here
log_relative_path_to_cache.txt

Here is the complete test with absolute path to cache dir:
image
Config file
conf.yaml.txt
log_absolute.txt

@vibhansa-msft
Copy link
Member

Yes I have tried with both absolute and relative paths and for me it does not give any error. Able to read/write files as well in both the cases. This might be something to do with your system settings and permissions. For me read/write works even without allow_other.

@vibhansa-msft
Copy link
Member

In your relative path logs I see the same error related to permissions "Mon Apr 24 14:32:36 BST 2023 : blobfuse2[2511] : LOG_ERR [file_cache.go (806)]: FileCache::OpenFile : error creating directory structure for file 11 [mkdir cache: permission denied]"

May be on WSL the relative paths are not working properly for some reason. I do not see any blobfuse issue here as per my test results. Can you try the same case on a linux VM instead of WSL and validate.

@vibhansa-msft vibhansa-msft modified the milestones: V2-2.0.3, V2-2.0.4 Apr 27, 2023
@vibhansa-msft vibhansa-msft linked a pull request Apr 28, 2023 that will close this issue
@kostinalexey
Copy link
Author

I can confirm that on Ubuntu 20.04 I can replicate the issue

@vibhansa-msft
Copy link
Member

Can you try out the branch linked above and let me know if it resolves the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants