Skip to content
This repository has been archived by the owner on Jan 17, 2018. It is now read-only.

remotepath throws error #63

Closed
mrmunch opened this issue Sep 14, 2016 · 12 comments
Closed

remotepath throws error #63

mrmunch opened this issue Sep 14, 2016 · 12 comments

Comments

@mrmunch
Copy link

mrmunch commented Sep 14, 2016

I have an Azure Storage account called mystorageaccount with a file share called myshare and a directory inside this share called mydir.

works:
docker run -it -v $(docker volume create -d azurefile -o share=myshare):/data ubuntu

doesn't work:
docker run -it -v $(docker volume create -d azurefile -o share=myshare -o remotepath=mydir):/data ubuntu
I get:

docker: Error response from daemon: VolumeDriver.Mount: mount failed: exit status 1
output="mount.cifs: bad UNC (/mystorageaccount.file.core.windows.net/myshare/mydir)\n".

@ahmetb
Copy link
Contributor

ahmetb commented Sep 14, 2016

This looks interesting. I am not familiar with SMB and UNC paths myself. Does it work fine without the -o remotepath?

@zlatan any ideas if you see any issues with the UNC syntax, or how did it work for you?

@mrmunch
Copy link
Author

mrmunch commented Sep 14, 2016

Yes, as I wrote in the first command, it works when I don't use -o remotepath

@zlatan
Copy link
Contributor

zlatan commented Sep 15, 2016

@ahmetalpbalkan I reproduced the problem. In current implementation 'remotepath' work with only one level of depth, @mrmunch have two.

@mrmunch
Copy link
Author

mrmunch commented Sep 15, 2016

@zlatan So the share already counts as one level of depth? But isn't remotepath always a subdir of share? So remotepath might never work atm?

@ahmetb
Copy link
Contributor

ahmetb commented Sep 15, 2016

Hmm is this like we're constructing a bad UNC or is this an unsupported feature?

@williamayerst
Copy link

williamayerst commented Sep 16, 2016

I have done some more testing, and if 'remotepath' is used, on the first time the volume is created it errors. I appears the UNC path is missing a prepending '/'

ERROR: for busybox  Cannot start service busybox: VolumeDriver.Mount: mount failed: exit status 1
output="mount.cifs: bad UNC (/xxxx.file.core.windows.net/busybox/subdir)\n"

ERROR: for db  Cannot start service db: VolumeDriver.Mount: mount failed: exit status 1
output="mount.cifs: bad UNC (/xxxx.file.core.windows.net/postgres/data)\n"

Subsequently the volume object exists and so doesn't present any errors, it just doesn't work.

@ahmetb
Copy link
Contributor

ahmetb commented Sep 16, 2016

@zlatan I think I found a bug. This piece of code

mountURI := fmt.Sprintf("//%s.file.%s/%s", accountName, storageBase, options.Share)
if len(options.RemotePath) != 0 {
mountURI = path.Join(mountURI, options.RemotePath)
}
uses path.Join to append the remotepath into a string like //host/share.

However path.Join assumes // is redundant and simplifies the path by removing one of the slashes. https://play.golang.org/p/FFg_Iap2CQ

I will submit a fix.

@ahmetb
Copy link
Contributor

ahmetb commented Sep 16, 2016

@williamayerst @mrmunch can you please try v0.5.1-rc.0 binary? https://github.com/Azure/azurefile-dockervolumedriver/releases/tag/v0.5.1-rc.0

If it works for you I will tag and release it as v0.5.1. I appreciate your help, sorry for the inconvenience. I have no idea how this ever worked :)

@williamayerst
Copy link

Hurrah, I will check and let you know on Monday, thanks!

@zlatan
Copy link
Contributor

zlatan commented Sep 17, 2016

@ahmetalpbalkan Yes, it's a bug.

@mrmunch
Copy link
Author

mrmunch commented Sep 17, 2016

@ahmetalpbalkan I can confirm it works now! I also tested it with remotepath=dir/subdir.

@ahmetb
Copy link
Contributor

ahmetb commented Sep 18, 2016

Thanks.

@ahmetb ahmetb closed this as completed Sep 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants