[OC 8.0.2] Sabre Quota Plugin Errors - 507 Insufficient Storage
I'm seeing repeated attempts to upload modest sized files where the server is generating 507 Insufficient Storage errors. In each case we're talking about a small .DOCX or PDF file that is perhaps a page or two long. The users all have 50GB of quota (or more) and the organization as a whole has only 25GB of files. They have over 6,000 files, the largest of which is only 2 GB.
The server is a relatively new install of OC 8.0.2 (upgraded from 8.0.0) running on CentOS 7.0 with a MariaDB 5.5 database and Swift ObjectStore. Some of their users are running the 1.8 client, others are still using the 1.7 client. All users are generating similar errors.
The logs show repeated attempts to upload files, with the following result. Apparently no files have successfully synced (upload) for the past two weeks, so this problem predates the recent update from 8.0.0 to 8.0.2.
Apache log entries looks like this.
12.34.56.78 - [email protected] [23/Mar/2015:09:47:29 -0300] "PUT /remote.php/webdav/InspireAA%20Desktop/Referral%20Letters/Person%20Name.pdf HTTP/1.1" 507 192
The corresponding OwnCloud log entries looks like this.
Mar 23 09:47:29 vcloud ownCloud[22695]: {webdav} Exception: {"Message":"","Code":0,"Trace":"#0 [internal function]: OC_Connector_Sabre_QuotaPlugin->checkQuota('InspireAA Deskt...', Object(OC_Connector_Sabre_File), Resource id #420)\n#1 \/var\/www\/html\/owncloud\/3rdparty\/sabre\/dav\/lib\/Sabre\/DAV\/Server.php(433): call_user_func_array(Array, Array)\n#2 \/var\/www\/html\/owncloud\/3rdparty\/sabre\/dav\/lib\/Sabre\/DAV\/Server.php(886): Sabre\\DAV\\Server->broadcastEvent('beforeWriteCont...', Array)\n#3 [internal function]: Sabre\\DAV\\Server->httpPut('InspireAA Deskt...')\n#4 \/var\/www\/html\/owncloud\/3rdparty\/sabre\/dav\/lib\/Sabre\/DAV\/Server.php(474): call_user_func(Array, 'InspireAA Deskt...')\n#5 \/var\/www\/html\/owncloud\/3rdparty\/sabre\/dav\/lib\/Sabre\/DAV\/Server.php(214): Sabre\\DAV\\Server->invokeMethod('PUT', 'InspireAA Deskt...')\n#6 \/var\/www\/html\/owncloud\/apps\/files\/appinfo\/remote.php(61): Sabre\\DAV\\Server->exec()\n#7 \/var\/www\/html\/owncloud\/remote.php(54): require_once('\/var\/www\/html\/o...')\n#8 {main}","File":"\/var\/www\/html\/owncloud\/lib\/private\/connector\/sabre\/quotaplugin.php","Line":79}
can you check if the temp directory is full? or some other partition on the server? or is this uploaded into a shared folder of a user who is out of quota?
The temp directory and the entire OS is on a single 80 GiB partition that is only 3% full. The Swift store has 8 TiB free.
There are 4 users on the system. Three of the users have 50 GiB quotas. The fourth has a 300 GiB quota.
As a total organization they have approximately 7700 files, the largest of which is 2 GiB. Their total used storage is 23 GiB, less than half of the smallest user quota.
So no user is even close to being out of quota and we’re seeing the 507 error even with the user with the 300 GiB quota.
On Mar 26, 2015, at 7:32 AM, Frank Karlitschek [email protected] wrote:
can you check if the temp directory is full? or some other partition on the server? or is this uploaded into a shared folder of a user who is out of quota?
— Reply to this email directly or view it on GitHub https://github.com/owncloud/core/issues/15189#issuecomment-86473845.
can you double check the personal pages of the users who fail to upload? The quota consumption is displayed on the top.
The personal pages are reporting the following for all users.
"You have used 0 B of the available ?"
(Minor edit: All of the users see the above message with one exception. My Admin account on their server is reporting "You have used 1.7 MB of the available 5 GB".)
If available says "?" it might mean that the "disk_free_space" PHP function doesn't work or is disabled for some reason.
Or did you set an explicit quota for every user ? (especially the ones with the "?") ?
All users have a quota.
The disk free space is working for my admin account, but not for the other users who are getting the 507 errors when they try to sync/upload.
On Mar 27, 2015, at 6:46 AM, Vincent Petry [email protected] wrote:
If available says "?" it might mean that the "disk_free_space" PHP function doesn't work or is disabled for some reason.
Or did you set an explicit quota for every user ? (especially the ones with the "?") ?
— Reply to this email directly or view it on GitHub https://github.com/owncloud/core/issues/15189#issuecomment-86899163.
Just to be clear, we are talking about ownCloud quota (configured in the users page) not filesystem-based quota ?
Yes, there are no file system quotas enabled on the server.
On Mar 27, 2015, at 6:54 AM, Vincent Petry [email protected] wrote:
Just to be clear, we are talking about ownCloud quota (configured in the users page) not filesystem-based quota ?
— Reply to this email directly or view it on GitHub https://github.com/owncloud/core/issues/15189#issuecomment-86900103.
I just went through the logs to see if I could determine the exact time/date and events surrounding the failures. I was hoping to find some significant package install or something which triggered this. After all they have successfully uploaded thousands of small files to the server.
This seems to fail on a user by user basis at different times.
It’s worth pointing out again that the smallest quota of any user is 50GB and that the total file system usage for the entire organization is only 23 GB (based on the size of the Swift container). Even if one of the users with the smallest quota were the owner of all of the organizations files, they still would be below 50%. In fact, most of the files are owned by the user with the 300 GB quota.
User1 has 300 GB quota. Last successful upload Feb 27th 507 errors begin Mar 2nd.
User2 has 50 GB quota. Last successful upload Mar 6th. Next upload is Mar 15th when 507 errors begin
User3 has 50 GB quota. Last successful upload March 10th Next upload is Mar 17th when 507 errors begin.
Hmmm... do these users have a lot of shared files ? There's a bug where the quota usage wasn't reported/propagated properly when shared files are updated: https://github.com/owncloud/core/issues/14596
In your case it could be that share recipients have deleted files inside the shared folder but the owner's quota usage wasn't updated, so OC believes it cannot upload further files there.
You could try checking the value of select size from oc_filecache where path = 'files' and storage in (select numeric_id from oc_storages where id like '%userid%') (replace "userid" with the user's id, you might need to look up the correct entry in oc_storages first)
Compare the size you found with the actual size of the user's "data/$user/files" directory.
If the difference is big, it might indeed be the bug I mentionned.
Yes, they do have a large number of shared files.
The owncloud/data/$user/files directories do not exist (other than for my admin account). We are using Swift as our object store.
The sql query returns the following values
User1 -> "-1" User2 -> "-1" User3 -> "153560191" (153 MB) User4 -> "449795" (inactive user) My admin account -> "1807468"
I just confirmed with User1 (user with the 300 GB quota) that the local size of their ownCloud folder is 22 GB. This confirms what I'm seeing from the Swift container, knowing that User1 owns the lions share of the organization's files.
I also confirmed that they have not done mass deletions or re-addition of content to their folders that would come anywhere close to adding up to the user's quotas.
This seems to be very much like what is reported in #13975 and what I reported in https://github.com/owncloud/client/issues/2061 where it was decided this was a client issue.
As a temporary measure I removed the quota from all users. This is allowing new files to synch, however the files which failed earlier are all marked with a nice big red X. The OwnCloud folder itself shows that everything is synched.
How can my clients ensure that ALL of their files are correctly synched?
They have almost 7,000 files across many directories. I can't ask them to check every folder and delete and reload all the failed synchs.
If there is a database manipulation that I could run which would resolve this synch issue to make the files appear freshly added, I would be quite happy. Any solution that's not labour intensive for the busy executives which are using the shared would be acceptable.
So if I understand well the following now works with quota disabled:
- create new file on client side, sync client uploads properly
- modify local file on client side, sync client uploads/overwrites properly
- create a file directly on the server (web UI), sync client downloads properly
And the following fails:
- file that existed previously on the storage cannot be overwritten when modified locally
Is this correct ?
I still do not understand the issue properly so am not sure about the possible workaround. AFAIK using "./occ files:scan --all" wouldn't fix it when using object store (@butonic correct me if I'm wrong)
@PVince81 if config.php has 'objectstore' configured to use as primary storage, then a filescan will not be able to scan anything. Metadata then resides only in OC.
@PVince81 I would agree with the "now works" scenarios but would modify the "fails" scenario to include the case where the files have never synched from when they were initially added client side, not just when they are next modified. All files which failed with 507 errors now appear in the users local OwnCloud directory, but are not synched with the server.
So we have the initial bug which caused users to have quota errors compounded with a bug preventing graceful recovery now that quota has been temporarily turned off. Should I open a new bug report for the latter?
Can you confirm that all the red crosses you see in the clients are all due to 507 errors and not other errors ?
@guruz @ogoffart does the sync client blacklist files from sync when a 507 error is met several times ?
I can't confirm them all as they are scattered across dozens of directories and I'm not in the same time zone as the clients. Nor can I keep asking the client to dig around for more info. These are corporate execs, not IT people.
I can confirm that all of the files in the specific directory which the customer reported to me as not synched were files which had failed initial upload because of the 507 error. In each case there are multiple 507 errors and then that file name never shows up again in the server logs.
I can also confirm that randomish spot checks of files which I see 507 errors in the server logs all follow the pattern above. None of the files appear in the logs again after the 507 errors. I checked a total of about 15 files.
The client will blacklist the files if the error 507 is repeated several times.