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

When using backslashes in path, directory creation fails with "No such file or directory" #438

Closed
wchill opened this issue Jul 14, 2020 · 6 comments
Assignees
Labels

Comments

@wchill
Copy link

wchill commented Jul 14, 2020

Which version of the blobfuse was used?

1.2.3, 1.2.4

Which OS (please include version) are you using?

Ubuntu 16.04 (kernel 4.15.0), Ubuntu 20.04 (kernel 5.4.0)

What problem was encountered?

When attempting to create a directory using mkdir -p and a path that has backslashes, directory creation fails with "No such file or directory". Linux does handle this correctly if creating in a directory not backed by blobfuse.

Have you found a mitigation/solution?

Downgrade to 1.1.1 (it handles this correctly), or convert everything to forward slashes.

By default, blobfuse logs errors to syslog. If this is relevant, is there anything in the syslog that might be helpful?

Unfortunately this was encountered in a docker container without a syslog daemon.

If relevant, please share your mount command.

blobfuse /mnt/blobstorage/mount --tmp-path=/mnt/blobstorage/cache --file-cache-timeout-in-seconds=1000000 -o nonempty -o allow_other --config-file=/mnt/blobstorage/blobstore.cfg --log-level=LOG_WARNING
@vibhansa-msft
Copy link
Member

Kindly paste your 'mkdir -p' command here, it will help us root-cause the issue.

@wchill
Copy link
Author

wchill commented Jul 15, 2020

mkdir -p /mnt/workspaceblobstore/d\\a\\1\\s\\src\\PythonTests

@vibhansa-msft
Copy link
Member

vibhansa-msft commented Jul 15, 2020

What is your expectation. As you have mentioned 1.1.1 converts '\' to '/' then 'd\a' is no-longer a directory name, rather it represents 'd' as directory and 'a' as sub-directory. You want to create a directory 'd\a' or 'a' as sub-directory. Current implementation is creating the sub-directory structure. Only problem may be the error throwing part, which I will investigate.
If problem is 'd\a' as the directory name then I believe this limitation is coming from Azure Storage side itself.

@vibhansa-msft
Copy link
Member

Also in linux the same mkdir creates a directory with name 'd\a' and not a sub-directory structure.

@NaraVen
Copy link
Collaborator

NaraVen commented Jul 16, 2020

As per the Azure blob naming documentation: https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata it is a good practice to avoid backslashes.
Since directory is virtual in blob ( see below for details, you can still have the mkdir path mentioned below as a blob name , your mounted dir may look like a typical file structure though.
The Blob service is based on a flat storage scheme, not a hierarchical scheme. However, you may specify a character or string delimiter within a blob name to create a virtual hierarchy. For example, the following list shows valid and unique blob names. Notice that a string can be valid as both a blob name and as a virtual directory name in the same container:

/a

/a.txt

/a/b

/a/b.txt

You can take advantage of the delimiter character when enumerating blobs.

@NaraVen NaraVen reopened this Aug 7, 2020
@vibhansa-msft
Copy link
Member

Blobfuse will now replace '\' with '/' and file/directories will be created accordingly. Bug fix is checked in, will be part of next release.

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

No branches or pull requests

3 participants