Using an folder in an Azure file share as a virtual directory

Think you've found a bug? Post a description here.

Moderator: Serin

Post Reply
phornby
New User
Posts: 3
Joined: Wed Feb 03, 2016 2:42 am

Using an folder in an Azure file share as a virtual directory

Post by phornby » Wed Feb 03, 2016 3:48 am

I have a file server system running Windows Server 2012 R2. The system is a Microsoft Azure Virtual Machine. One intended usage pattern for this server is that external users upload files to it using SFTP. To that end, I have installed Cerberus FTP Server - Professional Edition v8.0.0.0 on the system. The uploaded files are made available to other systems in our environment by having the upload path be a shared folder in an Azure File Share. Each system needing access to the files mounts the file share, and so automatically sees the files as they are uploaded. On my file server, the file share is mounted as the Z: drive.

I have several external users, each of whom is assigned a local user-id in Cerberus FTP. Each user is configured with the Simple Virtual Directory property, and the home directory is mapped to a specific sub-folder within the file share. This way, every external user gets their own individual upload space within the share.

This all worked until recently (I don't exactly know when it stopped working, but it was sometime in the last week or so). Now, when I attempt to connect (from FileZilla) as one of these users - one with Z:\Test mapped as its root directory, Cerberus FTP Server reports "Unable to access local directory Z:\Test", then "Unable to open directory handle to '/'" and aborts the connection.

I can navigate the folder structure and see the files on the share just fine from Explorer.

I don't know right now who to point the finger at. I am guessing that Azure is at fault, and I will be asking Microsoft for help. But I would like to know if any of this rings a bell with anyone in this community and, in particular, whether there's any way I can diagnose it in more detail from within Cerberus FTP Server.

Thanks for any help.

Pete Hornby

phornby
New User
Posts: 3
Joined: Wed Feb 03, 2016 2:42 am

Re: Using an folder in an Azure file share as a virtual directory

Post by phornby » Wed Feb 03, 2016 4:25 am

I should add that I can expose local folders as root directories just fine. I have not yet tried a regular SMB share.

Pete

phornby
New User
Posts: 3
Joined: Wed Feb 03, 2016 2:42 am

Re: Using an folder in an Azure file share as a virtual directory

Post by phornby » Tue Feb 09, 2016 1:16 pm

Turned out to be an Azure issue, probably associated with the outage they had recently. Cerberus is entirely able to use a folder in a mounted Azure file share as a root directory.

Pete

glowe
Posts: 1
Joined: Tue Sep 26, 2017 7:53 pm

Re: Using an folder in an Azure file share as a virtual directory

Post by glowe » Tue Sep 26, 2017 7:59 pm

Hi There,
I run into the same problem with Azure File Shares. My setup is that I've mapped an Azure File Share as the local user account that the CerberusFTP service runs as. My test CerberusFTP user has been created with a ftproot on the mapped drive, but I always get the following error in the Cerberus log when I try to transfer (upload) anything:
"The system cannot find the path specified"

Curious to learn more about the Azure issue that you ran into?

Thanks

benjaminchodroff
New User
Posts: 3
Joined: Tue Sep 26, 2017 9:46 pm

Re: Using an folder in an Azure file share as a virtual directory

Post by benjaminchodroff » Tue Sep 26, 2017 9:53 pm

I am also hitting the same problem with Azure File Shares - specifically, running in Azure China on Windows Server 2016. I have also mapped an Azure file share:
net use z: \\example.file.core.chinacloudapi.cn\example /u:AZURE\example xxxMyPrivatePasswordxxx

I was able to successfully create, read, update, delete files and directories using Windows Explorer in Z: -- everything looks good.
When I go into Cerberus (which I downloaded today as a trial) I go into my user, and add a share by navigating to a folder I created z:\ftproot

I am able to successfully ftp into Cerberus, but then I see:
sftp> dir
remote readdir("/"): No such file or directory
sftp> mkdir example
Couldn't create directory: Failure

If I remove z:\ftproot and replace it with any other local filesystem directory, everything works fine. Help?

Update: I reproduced this issue with a brand new file service instance in azure, on a brand new Windows Server 2008R2 image in azure china. No clue - looks like a bug in Cerberus.

pacman
Senior User
Posts: 187
Joined: Thu Apr 28, 2016 1:54 pm

Re: Using an folder in an Azure file share as a virtual directory

Post by pacman » Wed Sep 27, 2017 1:55 pm

Hi,

Have you tried using the UNC share path?

benjaminchodroff
New User
Posts: 3
Joined: Tue Sep 26, 2017 9:46 pm

Re: Using an folder in an Azure file share as a virtual directory

Post by benjaminchodroff » Wed Sep 27, 2017 5:45 pm

Sorry, that appears to be not possible (or at least, supported) because there is no way to include the required username and password in a UNC path within Windows:
https://superuser.com/questions/344775/ ... a-unc-path

Unfortunately, the username and password is required by Azure and I can't think of any way to work around this.
Please let me know if you have other ideas or suggestions? Thanks!

pacman
Senior User
Posts: 187
Joined: Thu Apr 28, 2016 1:54 pm

Re: Using an folder in an Azure file share as a virtual directory

Post by pacman » Thu Sep 28, 2017 11:42 am

I mean to go into Cerberus select your User and use the UNC path instead of the mapped drive?

I don't know the details of Azure shares, but it should be accessible as a UNC share that doesn't require authentication and isn't mapped to a specific logged in account.

benjaminchodroff
New User
Posts: 3
Joined: Tue Sep 26, 2017 9:46 pm

Re: Using an folder in an Azure file share as a virtual directory

Post by benjaminchodroff » Thu Sep 28, 2017 6:35 pm

I figured it out. The problem appears to be that the mount point needs to be done by the "nt authority\system" user. You can achieve this by running cmd.exe as Administrator, using Sysinternals Suite to "psexec -i -s cmd.exe", and then mounting your file system using a net use command. See the following similar documentation and link to download sysinternals suite:
https://support.asperasoft.com/hc/en-us ... ermanently

Once I did this, I was able to set z:\ftproot (the location where my file service was mounted was z:, with a folder called ftproot that I created) and everything works! Perhaps Cerberus could check to see if it has permission to read/write to the location selected as the service account the server daemon is running as? I still see this as a Cerberus bug even though it is a permissions issue.

Post Reply