nextcloud / nextcloud/server

[Bug]: quota double count on shared folder

Open
#40,225 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 25-feedback bug feature: object storage feature: sharing needs review
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
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
  1. create/have two users
  2. let user one share a folder with user two
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.