Repository navigation
Description
Steps to reproduce
- Connect to Owncloud WebDav with Windows Explorer Map Network Drive
- Use https://owncloud.local/remote.php/dav/files/USERNAME/
- Try to Copy a File to a Owncloud Directory witch is a External SMB Share
Expected behaviour
The User Quota is set to 1MB. The File to Copy is bigger than the Quota. With Files smaler than the Quota it Works as Expected, but not for bigger Files
There should be a Option for Owncloud Configuration to not Apply Quota to External SMB Shares.
For SMB Shares the Quota of the Windows Server should be the only reasonable Quota.
Actual behaviour
Windows Trys to Upload the File, but the Message appears: Could not read from Sorce or Destination
Server configuration
Operating system: Debian 4.9.30-2+deb9u3 (2017-08-06) x86_64
Web server: Apache/2.4.25 (Debian)
Database: Ver 15.1 Distrib 10.1.23-MariaDB
PHP version: PHP Version 5.6.30-0+deb8u1
ownCloud version: 10.0.3 (stable)
Updated from an older ownCloud or fresh install: Upgrade from 10.0.2
Where did you install ownCloud from: Debian Packages
Are you using external storage, if yes which one: smb...
Are you using encryption: no
Are you using an external user-backend, if yes which one: LDAP Webdav..
Client configuration
Browser: Google Chrome Version 60.0.3112.113
Operating system: Windows 10 Version 1703 (Build 15063.632)
Logs
Web server error log
134.96.211.82 - - [27/Sep/2017:09:36:11 +0200] "HEAD /remote.php/dav/files/Sven.Schneider/Tausch/UPDATE_INFO.PDF HTTP/1.1" 401 745 "-" "Microsoft-WebDAV-MiniRedir/10.0.15063"
134.96.211.82 - Sven.Schneider [27/Sep/2017:09:36:11 +0200] "HEAD /remote.php/dav/files/Sven.Schneider/Tausch/UPDATE_INFO.PDF HTTP/1.1" 200 953 "-" "Microsoft-WebDAV-MiniRedir/10.0.15063"
134.96.211.82 - Sven.Schneider [27/Sep/2017:09:36:12 +0200] "PUT /remote.php/dav/files/Sven.Schneider/Tausch/UPDATE_INFO.PDF HTTP/1.1" 500 910 "-" "Microsoft-WebDAV-MiniRedir/10.0.15063"
134.96.211.82 - Sven.Schneider [27/Sep/2017:09:36:13 +0200] "DELETE /remote.php/dav/files/Sven.Schneider/Tausch/UPDATE_INFO.PDF HTTP/1.1" 204 685 "-" "Microsoft-WebDAV-MiniRedir/10.0.15063"
ownCloud log (data/owncloud.log)
{"reqId":"1mZJzSwHluxXhiTx1DnV","level":3,"time":"2017-09-27T07:28:06+00:00","remoteAddr":"134.96.211.82","user":"Sven.Schneider","app":"webdav","method":"PUT","url":"\/remote.php\/dav\/files\/Sven.Schneider\/Tausch\/Scan\/UPDATE_INFO.PDF","message":"renaming part file to final file failed"}
{"reqId":"1mZJzSwHluxXhiTx1DnV","level":4,"time":"2017-09-27T07:28:06+00:00","remoteAddr":"134.96.211.82","user":"Sven.Schneider","app":"webdav","method":"PUT","url":"\/remote.php\/dav\/files\/Sven.Schneider\/Tausch\/Scan\/UPDATE_INFO.PDF","message":"Exception: {\"Message\":\"HTTP\\\/1.1 500 Could not rename part file to final file\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1129): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File->put(Resource id #66)\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(513): Sabre\\\\DAV\\\\Server->updateFile('files\\\/Sven.Schn...', Resource id #66, NULL)\\n#2 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpPut(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:PUT', Array)\\n#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#6 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Server.php(234): Sabre\\\\DAV\\\\Server->exec()\\n#7 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#8 \\\/var\\\/www\\\/owncloud\\\/remote.php(165): require_once('\\\/var\\\/www\\\/ownclo...')\\n#9 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/File.php\",\"Line\":212,\"User\":\"Sven.Schneider\"}"}
Activity
PVince81 commentedon Oct 9, 2017
By default the quota should never be applied to external storages. This is likely another bug / regression 😦
PVince81 commentedon Oct 10, 2017
I wrote an automated test here #29193 but it seems to work fine with quota and external storage.
Will need further investigation and manual reproduction.
@htwsaaraub mind posting your config.php in an anonymized form ?
htwsaaraub commentedon Oct 11, 2017
@PVince81 Here is my config.php
PVince81 commentedon Oct 12, 2017
I could not reproduce this issue:
PUTa file bigger than 1 MB to this locationThe file is uploaded properly.
And now I also tested with the ownCloud desktop client and uploading a 100 MB file (chunking) to "/smb" works fine.
And with the web UI the big file works fine too.
I don't think this is related to quota but maybe a problem with renaming files on an SMB external storage. Can you try directly renaming a file through Webdav (that Windows mount) to a different name ?
PVince81 commentedon Oct 12, 2017
do you have the smbclient PHP module installed and enabled ? (aka php5-libsmbclient)
htwsaaraub commentedon Oct 12, 2017
@PVince81 Yes, I use the smbclient PHP module
libsmbclient:amd64 2:4.5.12+dfsg-2 amd64 shared library for communication with SMB/CIFS serversI use the Windows 10 integrated Webdav Client
Connect to https://xxx.xxx.xxx/remote.php/dav/files/$username
Quota for the User is set to 1 MB
Copy a File bigger than the Quota in the User Root Folder immediately throws the Quota exeeded message. (as expected)
Copy a File bigga than the Quota to ROOT\SMB the Webdav Client tries to upload the File. The Copy Process shows the progress and bevor it'ts completed it throws the Quota exeeded message.
In the owncloud.log File the following message is logged.
Apache Owncloud.log
So, the Problem is not Quota, it's renaming files when Uploading with intregrated Windows Webdav Client.
Renaming existing Files in WebDav works as expected.
PVince81 commentedon Oct 13, 2017
@htwsaaraub please check that you have the PHP module for libsmbclient. The package you pointed at is the actual C/C++ library but not the PHP wrapper for it. The module can be installed with
sudo pecl install smbclient, you might also be able to find a package called php5-libsmbclient or something similar, depending on your sources.Still strange that rename works for regular files but not part files.
htwsaaraub commentedon Oct 13, 2017
I just installed php-smbclient from Debian Sources via apt.
phpinfo:
I also Installed smbclient from github
https://github.com/eduardok/libsmbclient-php
libsmbclient-php 0.90 installed successfully.
This smbclient module doesn't show up in php.ini, although extension=smbclient.so is set.
There is no change in WebDav. Same rename File error as before.
PVince81 commentedon Oct 13, 2017
@jvillafanez does this ring any bells ? Part file cannot be renamed to final file on SMB storage but regular renames work there.
jvillafanez commentedon Oct 16, 2017
The exception is thrown in https://github.com/owncloud/core/blob/v10.0.3/apps/dav/lib/Connector/Sabre/File.php#L212
I suggest to add in the line above the following log for debugging:
I expect a log message like:
with some additional "undefined variable: $renameOk" and "undefined variable: $fileExists"
If this is the case some pre hook might be causing the failure. You might want to disable non-default apps to track which one is causing problems.
10 remaining items
jvillafanez commentedon Oct 24, 2017
That's kind of expected because we need to check if the file exists in the SMB server or not, so that exception is under control. The problem is the other one happening during the rename.
This is quite bad news because I don't know how to reproduce the error nor what could be the cause of it.
I'm not sure if you've checked already:
Maybe a wireshark trace could show some additional information.
htwsaaraub commentedon Oct 26, 2017
I have some news.
The Uploads through the web UI all work like a charm.
As you suggested I tested some other webdav clients.
I had the same results (renaming part file to final file failed) with
For Windows I also tested CarotDAV. This Client doesn't integrate in Windows, instead navigating the WebDAV file System in the Application.
CarotDAV uploads any File correct. There are no errors in the owncloud log.
Perhaps this client just ignores the Quota limit, because all other clients have the Same results.
jvillafanez commentedon Oct 26, 2017
@htwsaaraub could you try with the old webdav endpoint? It should be something like https://owncloud.local/remote.php/webdav/ At least this will shrink the scope.
If it works then there is definitely a problem with the new webdav endpoint that we'll need to fix.
Quota limits are handled in the server, so I doubt the CarotDAV has something to do with that. It might be that CarotDAV uploads the whole file at once, but the rest tries to upload the file by chunks (or maybe it's the other way around).
Web uploads are still using the old webdav endpoint.
htwsaaraub commentedon Oct 26, 2017
@jvillafanez Nope, no change. Same results with the old and new endpoint.
NetDrive3 displays the correct user Quota for both of the Endpoints, but the Quota is always used for External SMB Shares.
jvillafanez commentedon Oct 26, 2017
I'm out of ideas at the moment 😞
I'll try to setup something similar in order to properly debug this, but I don't expect to have the environment ready until next week, so if there is no activity ping me in 2 weeks for status.
If you have any other ideas or more information, feel free to drop by this ticket.
Meanwhile, you might want to try the ownCloud's desktop client, which I expect to work properly and should provide similar features.
jvillafanez commentedon Nov 15, 2017
@htwsaaraub could you test with OC 10.0.4RC1? We've merged something that might solve your issue.
htwsaaraub commentedon Dec 15, 2017
@jvillafanez Today I tested the OC 10.0.4 final release.
I can confirm, webdav is now working as expected. Files on external shares are no longer limited by the quota size.
For Connections with Windows integrated WebDav client you first have to start the WebClient Service, which isn't set to start Automatic with windows.
Also I had to set the Connect using different credentials checkbox to connect successful.
I found a Micorosoft Support Document for Windows 7, which is sill valid under Windows 10.
https://support.microsoft.com/en-us/help/2560598/-the-folder-you-entered-does-not-appear-to-be-valid--please-choose-ano
PVince81 commentedon Dec 15, 2017
Glad to hear!
Case closed then ?
htwsaaraub commentedon Dec 15, 2017
Case closed.
Thanks for your support. 👍
lock commentedon Jul 30, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.