Repository navigation
[Bug]: Recipient can't download/upload in shared folder if their own usage exceeds the owner's quota #65767
Copy link
Copy link
Open
Labels
0. Needs triagePending check for reproducibility or if it fits our roadmapPending check for reproducibility or if it fits our roadmap36-feedbackbug
Description
⚠️ This issue respects the following points: ⚠️
- This is not a troubleshooting question, general support matter, or webserver/proxy problem, but likely a bug (if unsure, ask the Community Help Forum).
- This issue is not already reported on Github OR solved at the Community Help Forum (I've searched!).
- I'm using a maintained major version of Nextcloud Server and tested against the latest patch level. (Supported major versions and current patch levels).
- I agree to follow Nextcloud's Code of Conduct.
- I've tried my best to provide clear reproduction steps that someone unfamiliar with this bug could use to reproduce it.
Bug description
When quota_include_external_storage is set to true, recipient can't download or upload in shared folder if their own quota usage exceeds the owner's quota.
Steps to reproduce
- start fresh Nexcloud environment (used https://github.com/nextcloud/nextcloud-docker-dev for this)
- set
quota_include_external_storageto true:
occ config:system:set quota_include_external_storage --type=boolean --value=true- set quota of 50 MB for
alice
occ user:setting alice files quota "50 MB"- keep quota unlimited for
bob - as
alice, createtest_folderand place a small PDF file inside - as
bob, upload a file greater thenalices quota (50 MB +) to it's own files.
I've downloaded Nextcloud Files Linux Appimage for this (~60 MB):
https://github.com/nextcloud-releases/desktop/releases/download/v35.0.0/Nextcloud-35.0.0-x86_64.AppImage - as
alice, sharetest_folderwithbob - check both users quota and space:
$ occ user:info alice
- user_id: alice
- display_name: alice
- email:
- cloud_id: alice@nextcloud.local
- enabled: true
- groups:
- quota: 50 MB
- storage:
- free: 23031284
- used: 29397516
- quota: 52428800
- total: 52428800
- relative: 0.56071311950684
- first_seen: 2026-10-22T11:43:20+00:00
- last_seen: 2026-10-22T11:44:24+00:00
- user_directory: /var/www/html/data/alice
- backend: Database
$ occ user:info bob
- user_id: bob
- display_name: bob
- email:
- cloud_id: bob@nextcloud.local
- enabled: true
- groups:
- quota: none
- storage:
- free: 494527238144
- used: 92572676
- quota: -3
- total: 494619810820
- relative: 0.00018715925641258
- first_seen: 2026-10-22T11:43:49+00:00
- last_seen: 2026-10-22T11:43:49+00:00
- user_directory: /var/www/html/data/bob
- backend: Databaseas can be seen, alice has free space of ~23 MB, bob has way more
With scenario above, recipient (bob) quota usage is greater than owner (alice) quota:
- recipient (
bob) quota usage: ~92 MB - owner (
alice) quota: ~52 MB
This is a important part to be able to reproduce the issue.
- as
bobnavigate insidetest_folder(shared folder) - try to download the PDF file
- when attempting to download:
- following exception is thrown:
{
"reqId": "qLbqIjJrPifUK6WuwxM9",
"level": 3,
"time": "2026-10-21T19:34:16+00:00",
"remoteAddr": "192.168.21.4",
"user": "bob",
"app": "webdav",
"method": "GET",
"url": "/remote.php/dav/files/bob/test_folder/Nextcloud_Server_Administration_Manual%20(1).pdf",
"scriptName": "/remote.php",
"message": "Could not open file: test_folder/Nextcloud_Server_Administration_Manual (1).pdf (118), file does seem to exist",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/156.0.0.0 Safari/537.36",
"version": "36.0.0.0",
"exception": {
"Exception": "Sabre\\DAV\\Exception\\ServiceUnavailable",
"Message": "Could not open file: test_folder/Nextcloud_Server_Administration_Manual (1).pdf (118), file does seem to exist",
"Code": 0,
"Trace": [
{
"file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
"line": 85,
"function": "get",
"class": "OCA\\DAV\\Connector\\Sabre\\File",
"type": "->",
"args": []
},
{
"file": "/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
"line": 89,
"function": "httpGet",
"class": "Sabre\\DAV\\CorePlugin",
"type": "->",
"args": [
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
},
{
"file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 472,
"function": "emit",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": [
"method:GET",
[
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
]
},
{
"file": "/var/www/html/apps/dav/lib/Connector/Sabre/Server.php",
"line": 216,
"function": "invokeMethod",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": [
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
},
{
"file": "/var/www/html/apps/dav/lib/Server.php",
"line": 435,
"function": "start",
"class": "OCA\\DAV\\Connector\\Sabre\\Server",
"type": "->",
"args": []
},
{
"file": "/var/www/html/apps/dav/appinfo/v2/remote.php",
"line": 25,
"function": "exec",
"class": "OCA\\DAV\\Server",
"type": "->",
"args": []
},
{
"file": "/var/www/html/remote.php",
"line": 158,
"args": [
"/var/www/html/apps/dav/appinfo/v2/remote.php"
],
"function": "require"
},
{
"file": "/var/www/html/lib/OC.php",
"line": 1384,
"function": "{closure:/var/www/html/remote.php:102}",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/remote.php",
"line": 102,
"function": "handleRequests",
"class": "OC",
"type": "::",
"args": [
{
"__class__": "Closure"
}
]
}
],
"File": "/var/www/html/apps/dav/lib/Connector/Sabre/File.php",
"Line": 502,
"message": "Could not open file: test_folder/Nextcloud_Server_Administration_Manual (1).pdf (118), file does seem to exist",
"CustomMessage": "Could not open file: test_folder/Nextcloud_Server_Administration_Manual (1).pdf (118), file does seem to exist"
}
}- try to upload a small file (in this case, I've used a file called
mock.json, ~3 B):
- when attempting to upload file "Your have used your space quota and cannot upload files anymore" appears:
Expected behavior
- when attempting to download a file, storage free space/quota should not be considered, since file is going to be downloaded to the local machine anyway
- when attempting to upload a file, if users have enough free space in quota, uploading the file should work as expected
Actual behaviour
- download is not possible and exception is thrown
- message indicating that there's no space left in quota, even with both users involved having plenty free space
Nextcloud Server version
36 (master)
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.5
Web server
None
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
0. Needs triagePending check for reproducibility or if it fits our roadmapPending check for reproducibility or if it fits our roadmap36-feedbackbug
Type
Projects
- StatusShow more project fieldsTriaged
Activity
cristianscheid commentedon Oct 22, 2026
I took some time to investigate the code path when running into the download issue:
$used = $this->getSize($this->sizeRoot);line is reached, it calls the following method:$rootInfo = Filesystem::getFileInfo('', 'ext');line executes, using xdebug I was able to see thatbob's storage is considered, meaning the returned value is quota usage frombobfree_space():$quotaFree = max($this->getQuota() - $used, 0);$this->getQuota()isalicequota: ~52 MB$usedisbobusage: >52MBbobusage withalicequotaTo fix the part about not being able to download a file, I think a simple solution would be to skip quota/free space check on
Quota::fopen()when opening files for reading, since reads don't consume any space:This should handle the download part, and it looks good in my tests. However, when uploading a file, neither
Quota::fopen()norQuota::free_space()is executed, so this PR doesn't solve the upload part of the issue.