[Bug]: quota double count on shared folder
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
When a folder is shared with an other user, that other users quota is also "burdened" by the amount of data in that shared folder.
Steps to reproduce
- create/have two users
- let user one share a folder with user two
- the quota used by user two is increased by the amount of data in the shared folder
Expected behavior
I have checked the MySql table 'oc_filecache' and the database entries do not "double". Also when I "right click" the image I see that the URL (especially the fileId) is the same (like [URL]/core/preview?fileId=964&x=1920&y=1080&a=true). So the Nextcloud server knows it's the same file that is beiing viewed/used.
I expected that the owner (in my example "user one") would be "burdened" for the used data, NOT the person that gets the share ("in my example "user two"). Technically all is working perfectly (at first I feared that the data would be copied also.. this is not the case).
The only thing missing is the detection (and calculation) that internally shared folders must not "double count" in the used quota of the user that "gets the share" (simply because that quota is correctly only used once by the Nextcloud server!)
Installation method
Community Web installer on a VPS or web space
AD: I use AWS-S3 as my primary storage
Nextcloud Server version
25
Operating system
RHEL/CentOS
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
No response
List of activated Apps
No response
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the report with two database-backed users, an internally shared folder, and AWS-S3 storage, then inspect the quota calculation alongside the oc_filecache entries and shared fileId described here. Done means the shared folder's data is counted against the owner without increasing the recipient's used quota; the issue names no source file or test to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, mariadb, php
- Domain
- backend, cloud, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100