New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webdav: Could not rename part file to final file due to Quota limit #29103
Comments
By default the quota should never be applied to external storages. This is likely another bug / regression 😦 |
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 ? |
@PVince81 Here is my config.php
|
I could not reproduce this issue:
The 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. 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 ? |
do you have the smbclient PHP module installed and enabled ? (aka php5-libsmbclient) |
@PVince81 Yes, I use the smbclient PHP module
I use the Windows 10 integrated Webdav Client 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. |
@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 Still strange that rename works for regular files but not part files. |
I just installed php-smbclient from Debian Sources via apt.
phpinfo:
I also Installed smbclient from github libsmbclient-php 0.90 installed successfully. There is no change in WebDav. Same rename File error as before. |
@jvillafanez does this ring any bells ? Part file cannot be renamed to final file on SMB storage but regular renames work there. |
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. |
I added the line for debugging. Here is the result.
|
Ok, so the problem is in the I'll need to know the implementation of the storage that is being used there. Add the following line around line 209:
We'll keep on debugging after knowing that info. As far as I know, there is no common implementation for that function (don't ask me why). I've checked that EE might use a wrapper in the workflow app which completely overwrite the method coming from the common storage, so right now I'm blinded. Regarding the quota problem, I don't think that it's causing any problem. I've verified that OC 10.0.3 uploads file to the external storage without checking the quota, which is the expected behaviour, plus your logs doesn't have an "InsufficientQouta exception" or similar. Did you check that there is enough space in the external storage for the file? |
On the remote storage about 200GB of free space is available. Here are your requested debugging lines.
|
Ok, the next debugging stop is https://github.com/owncloud/core/blob/v10.0.3/lib/private/Files/Storage/Wrapper/Wrapper.php#L565 Similar as above, I'm interested in the storage wrapped by the ChecksumWrapper:
That should reveal enough info to know the actual method call that is failing. |
Should it look like this? Or do you want the debuging line in the Query? public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) { \OCP\Util::writeLog('webdav', 'wrapper class: "' . get_class($this) . '" -- wrapped class: "' . get_class($this->getWrapperStorage()) . '" -- source: "' . get_class($sourceStorage) . '"', \OCP\Util::ERROR); if ($sourceStorage === $this) { |
Like you've written. |
Here you are.
Seams like the Wrapper Encryption causing this Problem. But in my Owncloud Instance the Encryption Module is not enabled.
|
Let's try another approach: add the following option in your config.php and set the log level to debug (the place doesn't matter)
Note that the log output will be very verbose so either remove the option or set it as false afterwards. I expect some entries with something like:
Hopefully we can get a stacktrace of the error that's happening in the SMB code (if the execution really go through it). It should be more or less clear what is happening inside the rename. |
Icewind\SMB\Exception\NotFoundException - code: 2 message: Invalid request for smb
|
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. |
I have some news. The Uploads through the web UI all work like a charm.
For Windows I also tested CarotDAV. This Client doesn't integrate in Windows, instead navigating the WebDAV file System in the Application. |
@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. 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). |
@jvillafanez Nope, no change. Same results with the old and new endpoint. |
I'm out of ideas at the moment 😞 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. |
@htwsaaraub could you test with OC 10.0.4RC1? We've merged something that might solve your issue. |
@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. I found a Micorosoft Support Document for Windows 7, which is sill valid under Windows 10. |
Glad to hear! Case closed then ? |
Case closed. |
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. |
Steps to reproduce
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
ownCloud log (data/owncloud.log)
The text was updated successfully, but these errors were encountered: