core icon indicating copy to clipboard operation
core copied to clipboard

OC5 - External SMB Storage

Open yaerox opened this issue 13 years ago • 33 comments

Hey guys,

I'm actual having a problem with the user rights on the External (SMB) Storage. It took a while until it was running but now dont even the OC Admin is able to create a file or delete folder in this folder. He's able to edit, delete and upload files/directorys, but like I said, dont even the Admin can create files (New -> textfile) or delete a folder. Maybe first some information about my Enviroment: (http://susestudio.com/a/TadMax/owncloud-in-a-box) VM - openSUSE 12.2 in a box (with updated Repository)

  • MySQL
  • Owncloud 5
  • External SMB Storage on a Win7 Prof Computer

If I try to create a file I get: Error when creating the file.

Owncloud.log says: Warning PHP stat(): stat failed for smb://USERNAME:[email protected]/Use ... e/TESTFILE at /srv/www/htdocs/owncloud/apps/files_external/lib/smb.php#65 Warning PHP filetype(): Lstat failed for smb://USERNAME:[email protected]/Use ... e/TESTFILE at /srv/www/htdocs/owncloud/apps/files_external/lib/streamwrapper.php#51 Warning PHP stat(): stat failed for smb://USERNAME:[email protected]/Use ... e/TESTFILE at /srv/www/htdocs/owncloud/apps/files_external/lib/smb.php#65 Warning PHP filetype(): Lstat failed for smb://USERNAME:[email protected]/Use ... e/TESTFILE at /srv/www/htdocs/owncloud/apps/files_external/lib/streamwrapper.php#51 Warning PHP stat(): stat failed for smb://USERNAME:[email protected]/Use ... e/TESTFILE at /srv/www/htdocs/owncloud/apps/files_external/lib/smb.php#65 Warning PHP filetype(): Lstat failed for smb://USERNAME:[email protected]/Use ... e/TESTFILE at /srv/www/htdocs/owncloud/apps/files_external/lib/streamwrapper.php#51 Warning PHP filetype(): Lstat failed for smb://USERNAME:[email protected]/Use ... e/TESTFILE at /srv/www/htdocs/owncloud/apps/files_external/lib/streamwrapper.php#51 Warning PHP stat(): stat failed for smb://USERNAME:[email protected]/Use ... e/TESTFILE at /srv/www/htdocs/owncloud/apps/files_external/lib/smb.php#65 Warning PHP filetype(): Lstat failed for smb://USERNAME:[email protected]/Use ... e/TESTFILE at /srv/www/htdocs/owncloud/apps/files_external/lib/streamwrapper.php#51 Warning PHP stat(): stat failed for smb://USERNAME:[email protected]/Use ... e/TESTFILE at /srv/www/htdocs/owncloud/apps/files_external/lib/smb.php#65 Warning PHP NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file params(-d 0 '//192.3.1.XXX/Users' -c 'get "USERNAME\ExternalStorage\My_Folder_To_Share\TESTFILE" "/tmp/smb.down.AKmEMs"') at /srv/www/htdocs/owncloud/3rdparty/smb4php/smb.php#187 Warning PHP filetype(): Lstat failed for smb://USERNAME:[email protected]/Use ... e/TESTFILE at /srv/www/htdocs/owncloud/apps/files_external/lib/streamwrapper.php#51

My smb.conf is equal the default one: [global] map to guest = Bad User printcap name = cups logon path = %L\profiles.msprofile logon drive = P: logon home = %L\Users%U\ExternalStorage
usershare allow guests = Yes idmap config * : backend = tdb cups options = raw [homes] comment = Home Directories valid users = %S, %D%w%S read only = No inherit acls = Yes browseable = No [groups] comment = All groups path = /home/groups read only = No inherit acls = Yes [users] comment = All users path = /home read only = No inherit acls = Yes veto files = /aquota.user/groups/shares/ [profiles] comment = Network Profiles Service path = %H read only = No create mask = 0600 directory mask = 0700 store dos attributes = Yes [printers] comment = All Printers path = /var/tmp create mask = 0600 printable = Yes print ok = Yes browseable = No [print$] comment = Printer Drivers path = /var/lib/samba/drivers write list = @ntadmin, root force group = ntadmin create mask = 0664 directory mask = 0775

mount.json looks fine.

On my windows computer the owner of the directory is the same user who is used by the External SMB Storage. He got full rights on the folder at my Win7 and on directory Properties -> File Sharing too.

Anyone who know how to fix/SetUp External (SMB) Storage and configurate the user rights? I really looked up the forums, google and github but i couldn't find someone who could help me or any kind of 'Tutorial'.

By the way, if I try to delete a file, the browser isnt refreshign the list, so nothings changes but on my Win7 computer the file is already deleted.if I try to rename a file/folder I get the error message that he couldn't rename it but he did.

Regards.

yaerox avatar Mar 18 '13 11:03 yaerox

@blizzz

BernhardPosselt avatar Mar 18 '13 13:03 BernhardPosselt

I thought about, maybe I have to get SMB running on all my systems at command line first. Actual looks like everything works fine except creating files on my windows computer if using the smbclient on my linux machine.

Error: smb: > echo test > file.txt echo failed: NT_STATUS_IO_TIMEOUT smb: >

Just wanted you to know that I'm trying to get this working to see if its a real OC problem or not...

yaerox avatar Mar 18 '13 15:03 yaerox

Is smbclient installed?

@icewind1991

blizzz avatar Mar 18 '13 19:03 blizzz

Yeah, smbclient is installed and this NT_STATUS_IO_TIMEOUT just appears if I try to create a file on the commandline smb: >.

I did some tests like: Sharing a folder on my openSUSE and tried to get this folder on my Win7-Machine. Works. Iam able to do everything (create, delete, rename, move, copy files and directorys). Then I tried this the other way round. Sharing a folder on my Win7-Machine and tried to get this folder on my openSUSE. There is this problem too. It seems like I cannot create any files. I can rename, edit, delete and copy directorys, but I cannot create any files.

In OC I'm only able to delete files, rename folder and files (here comes an error up to but the file/folder got already renamed). If I click delete file the interface doesn't change until I did a reload but the file is already deleted. I ask on the forum for help too - looks like noone else can help ^^ - but anyway here the link, some other people got the same and maybe it could help: http://forum.owncloud.org/viewtopic.php?f=23&t=9211&p=22636#p22636

While researching, I found this: https://bugzilla.samba.org/show_bug.cgi?id=8498 ...

yaerox avatar Mar 20 '13 07:03 yaerox

I got SMB running on Terminal now. I didnt knew that files can only get 'put' via samba.

I guess in OC this works like creating a file local and then putting them on the Samba share and delete this local file. Maybe there could be a problem?

yaerox avatar Mar 25 '13 07:03 yaerox

I have exactly the same problem. Is there any progress on this topic? Would much appreciate help.

@yaerox: have you been able to solve your issue? If so could you please post your solution. Thx!

mjaggi avatar Apr 08 '13 11:04 mjaggi

Unfotunately not :/

I'm waiting too if someone will be able to fix this ... like I said in my last posts, I got SMB running on terminal and I could imagine maybe something on the OC Scripts which maybe work like I "ask" (I guess in OC this works like creating a file local and then putting them on the Samba share and delete this local file) could be the problem.

Wanna use OC since v 4.0.7 but actual never got this running, but this is the feature which make me sticking on OC ^^

Edit: I keep this Tab and the IRC Chat always opened to see if anything happens ;)

yaerox avatar Apr 08 '13 12:04 yaerox

Hello, i have a similar problem, but in my setup, it's the creation of directory that didn't work with the windows client sync. Same log message. Any files directly at the root of my local sync dir are correctly copy on the external storage. But if i add a sub dir, the sync stop, and nothing is copy on the external storage, and on the OC webui, a file with the name of my subdir appear and cannot be deleted.

Iskadar avatar Apr 12 '13 12:04 Iskadar

Does someone know if this is maybe fixed in 5.0.4 ? Couldn't find anything similiar in the changelogs.

yaerox avatar Apr 17 '13 06:04 yaerox

we did the upgrade to 5.0.4 but still the same issue. :-( It's a shame since OwnCloud is not usable for our needs as long as this malfunction is not fixed...

mjaggi avatar Apr 17 '13 11:04 mjaggi

Same here, we were already in OC 5.0.4 when i post my last comment.

Iskadar avatar Apr 17 '13 13:04 Iskadar

For me this looks like, if no user will try to understand the smb.php and all depending files and get a look on the functions and how they work, nothing will change here :/

Unfortunately don't have that much time and knowledge in php (only a beginner :/).

yaerox avatar Apr 18 '13 14:04 yaerox

/push

yaerox avatar May 17 '13 12:05 yaerox

SMB-Mount

Expected behaviour

Be able to create files/folders and even be able to delete them.

Actual behaviour

  • Can't create files
  • After deleting a file the view don't get refreshed (but the file got deleted)
  • Can't delete folders

Steps to reproduce

  1. Login to your cloud
  2. Administration
  3. External Storage -> SMB -> Fill the inputs
  4. Create/Delete files/folders

Server configuration

Operating system: openSUSE 12.1 Web server: Apache2 Database: SQLite PHP version: 5.X ownCloud version: 5.0.6 (but like a few times said now, got this since 4.0.7)

Client configuration

Browser: Firefox / Chrome Operating system: Windows 7 Professional (x86)

Logs

Web server error log

Warning PHP stat(): stat failed for smb://USERNAME:PASSWORD@COMPUTERNAME/SMB/Testfile at /srv/www/htdocs/owncloud/apps/files_external/lib/smb.php#65

Warning PHP filetype(): Lstat failed for smb://USERNAME:PASSWORD@COMPUTERNAME/SMB/Testfile at /srv/www/htdocs/owncloud/apps/files_external/lib/streamwrapper.php#33

ownCloud log (data/owncloud.log)

{"app":"PHP","message":"stat(): stat failed for smb://USERNAME:PASSWORD@COMPUTERNAME/SMB/Testfile at /srv/www/htdocs/owncloud/apps/files_external/lib/smb.php#65","level":2,"time":1369302383} {"app":"PHP","message":"stat(): stat failed for smb://USERNAME:PASSWORD@COMPUTERNAME/SMB/Testfile at /srv/www/htdocs/owncloud/apps/files_external/lib/smb.php#65","level":2,"time":1369302383} {"app":"PHP","message":"filetype(): Lstat failed for smb://USERNAME:PASSWORD@COMPUTERNAME/SMB/Testfile at /srv/www/htdocs/owncloud/apps/files_external/lib/streamwrapper.php#33","level":2,"time":1369302383} {"app":"PHP","message":"stat(): stat failed for smb://USERNAME:PASSWORD@COMPUTERNAME/SMB/Testfile at /srv/www/htdocs/owncloud/apps/files_external/lib/smb.php#65","level":2,"time":1369314588} {"app":"PHP","message":"filetype(): Lstat failed for smb://USERNAME:PASSWORD@COMPUTERNAME/SMB/Testfile at /srv/www/htdocs/owncloud/apps/files_external/lib/streamwrapper.php#33","level":2,"time":1369314588} {"app":"PHP","message":"stat(): stat failed for smb://USERNAME:PASSWORD@COMPUTERNAME/SMB/Testfile at /srv/www/htdocs/owncloud/apps/files_external/lib/smb.php#65","level":2,"time":1369314588}

Sharing of Local and SMB mounted folders/files:

Folders which should get shared get corrupt foldernames on the shared Accounts. It looks like the folder name are like whitespace and caused by this if two folders getting shared u got like whitespace (2) No write rights on shared folders doesn't matter if I checked just everything (full rights) or not. Doesn't show any files

yaerox avatar May 23 '13 13:05 yaerox

I’m closing this issue because it has been inactive for a few months. This probably means that the issue is not reproducible or it has been fixed in a newer version.

Please reopen if you still encounter this issue with the latest stable version (currently ownCloud 5.0.9) and then please use the issue template. You an also contribute directly by providing a patch – see the developer manual. :)

Thank you!

jancborchardt avatar Aug 08 '13 15:08 jancborchardt

Yes, I encounter all above mentioned issues with OC 5.0.17.

oleua avatar Aug 29 '13 12:08 oleua

@ostasevych I guess 5.0.17 is the latest beta release?

yaerox avatar Aug 29 '13 13:08 yaerox

@icewind1991 can you please have a look at this? Looks like users have this issue for a quite long time. THX

DeepDiver1975 avatar Aug 30 '13 07:08 DeepDiver1975

I got some free time and tried OC 5.0.10. Like ostasevych said, all above mentioned issues still there in OC 5.0.10.

yaerox avatar Sep 02 '13 11:09 yaerox

I'm also experiencing the same issue.

I use an SMB mount via the External Storage plug-in and all of my desktop clients are OSX clients. When I first installed ownCloud, everything transferred fine to the clients (50 GB of data)... The issue popped up when one of the clients moved a folder containing some small files and sub-directories from his desktop to the ownCloud folder. The logs on the server started to fill up with lstat, stat, and filename errors. I created the top level directory on the ownCloud server and as soon as I did that, the files started to copy in to it but NOT the sub-directories. I went through and created those by hand as well and when I did files started to copy over until everything was there. Once all the issues were fixed with this directory it then synced the files to the other OSX clients.

Edit:

I'm connecting to a Linux Samba server and not a real Windows server (just an FYI)

dirving2013 avatar Sep 03 '13 15:09 dirving2013