Samba Mount: Accessing Files not possible
Expected behaviour
Allow access to files on external SMB mount.
Actual behaviour
When adding an external mountpoint through SMB, we can see the folder, however sync client gives "Unknown Error" and whenever I try accessing the folder, I get reset to the home view. Unfortunately, I do not have access to the server offering the SMB share, but I'm told it's a Mac OS X, version 10.8 and people are accessing this server directly (through Windows/Mac Networking) all the time.
Note that with the previous version we used to be able to see the share, access the folder and list files, but upon trying to access any of them, we received an error (can't remember exactly the message, something along the lines of "Resource not Available" or similar; this was through the web interface).
External mount is configured and icon is green.
Steps to reproduce
- add the external mount through admin interface
- associate it to user/group
- log in as that user/group and click on the folder in web interface
Server configuration
Operating system:Ubuntu 12.04
Web server: Apache2 - 2.2.22-1ubuntu1.4
Database: PostgreSQL 9.1 - 9.1.9-0ubuntu12.04
PHP version: 5.3.10-1ubuntu3.8
ownCloud version: 5.0.12 Enterprise
Client configuration
Browser: ANY
Operating system: ANY
Note
Please note that this is a bug about a production system. We cannot arbitrarily change database/webserver backends however I am able to setup a test instance for more invasive debugging if needed.
ownCloud version: 5.0.12 Enterprise
you might want to get in touch with the support team - thx
I did, they asked me to open this ticket. On Nov 4, 2013 4:44 PM, "Thomas Müller" [email protected] wrote:
ownCloud version: 5.0.12 Enterprise
you might want to get in touch with the support team - thx
— Reply to this email directly or view it on GitHubhttps://github.com/owncloud/core/issues/5595#issuecomment-27725600 .
@PVince81
@sfabel can you have a try with the latest stable5 ? There have been quite a few fixes related to SMB ext storage. You could set up a test instance and try and mount the SMB dir in question using the same steps. If the issue occurs there, please post the logs (owncloud.log and Apache log), with debug enabled. Thanks.
@PVince81 I created a test instance and installed owncloud enterprise 5.0.13 on it. The debug messages were
Warning PHP NT_STATUS_OBJECT_NAME_INVALID opening remote file params(-d 0 '//smb.abc.com/document' -c 'get "" "/tmp/smb.down.r1DRtg"') at /var/www/3rdparty/smb4php/smb.php#189 2013-11-26T01:15:59+00:00 Warning PHP stream_open(): error in URL at /var/www/3rdparty/smb4php/smb.php#427
On that instance, I tried smbclient -d 0 '//smb.abc.com/document' -c 'get "" "/tmp/smb.down.16C0TY"' -U smbuser Enter smbuser's password: Domain=[smb] OS=[xxxx] Server=[@(#)PROGRAM:smbd PROJECT:smbx-136.20.1] NT_STATUS_OBJECT_NAME_INVALID opening remote file \
And, Apache error.log said: [Tue Nov 26 01:41:28 2013] [error] [client 172.16.1.205] client denied by server configuration: /var/www/data/htaccesstest.txt
My apache virtualhost file set: <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all
Please don't hesitate to ask me if you need more information. Thanks!
Just tried 5.0.13 and was able to mount an SMB storage and download a file succesfully.
@jswlinux strange, from the smbclient command it looks like it's downloading a file with an empty name:
get "" "/tmp/thetempfile"
The first argument is supposed to be the file you're downloading.
When is this error triggered, when you're navigating into the SMB mount in the UI or when you're trying to download a file ? Can you set the log level to "Debug" ? Can you try disabling all non-core apps ? (pictures, etc)
@PVince81 I was not able to even navigate it, because the mount directory was indicated as a text file. The error messages above were set to "Debug", and I installed the latest owncloud version (5.0.13) on the test instance and, enabled "External Storage Support" only. I reloaded the owncloud's main page a couple of times, and messages were same as above.
Please let me know if you have any other ideas. Thanks for help!
@jswlinux hmmm. Do you mind posting the mount settings you used ? Did you try and mount the SMB to the root ? (which isn't supported)

@PVince81 Please see attached screenshot files. FYI, smbclient command works fine.
Thank you!
Could you do a dir with smbclient on the share and see what the output is ?
smbclient //172.16.1.210/Photos -U smbclient -c 'dir'
Is there any file/dir in the list that has a "N" letter in the second column ? (I found such issue before, could be related)
@PVince81 It said " Test_file.txt DA 23 Wed Nov 27 00:08:27 2013"
Thanks for help!
Okay that's weird. "D" is supposed to be a directory. Maybe it's somehow confusing ownCloud, letting it believe it's a regular file ? Are you able to try with a different Samba share ?
Do you have access to that Samba share using a Windows client or using smb:// on Mac or Linux ?
I have the feeling that you might have mistakenly created a directory called "Test_file.txt" and that it's confusing ownCloud for some reason. I'll have a try with such case later.
@PVince81 I apologize the delay.
I added mount.json file into owncloud-enterprise/data directory and the error log shown is,
{PHP} tree connect failed: NT_STATUS_BAD_NETWORK_PATH params(-d 0 '//172.16.1.210/Photos' -c 'dir "12_07_18-jswlinux Photoshoot"') at /var/www/owncloud-enterprise/3rdparty/smb4php/smb.php#189
I was able to access this Samba server using smbclient command on my webserver, owncloud running on. The result was,
12_07_18-jswlinux Photoshoot DA 0 Tue Jul 24 01:31:47 2013 44700 blocks of size 134217726. 25472 blocks available
By the way, is the above PHP command supposed to have -U parameter?
Thank you so much for your help!
I think all smbclient commands are supposed to have the user name and password in it. If it doesn't, then it might be your issue.
Or are you connecting without username/password ? (as guest) If guest, you can try and set the username to "anonymous" or "guest".
I think the issue is actually with the SMB server - it's a Mac OS X server (don't know which version) - and they have some serious SMB variances going on. We can reproduce this from the command line by simply repeating a smbclient dir command (arrow up, enter, arrow up, enter, etc.) - the third time always fails.
If the SMB server is randomly failing I think there isn't much that can be done on ownCloud's side as it relies on smbclient.
Closing.