nextcloud / nextcloud/user_usage_report

Inconsistent results for user quota when using `default_quota`

Open
#200 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
45
Forks
12
Avg merge
13h 25m
Merged PRs (30d)
19

Description

Steps to reproduce
  1. Give a value to default_quota in the server, ex "1 GB"
  2. Have user user1 assigned the value of default_quota. Verify it too by checking user1 settings page.
  3. Run:

Case 1:

# occ usage-report:generate --output=json user1 | jq .quota`
0

Case 2:

# occ usage-report:generate --output=json | grep user1 | jq .quota`
"1 GB"
Expected behaviour

The field quota should be always an integer number and consistent.

Actual behaviour

The field quota is wrong (case 1) and a string (case 2). Manually assigning the user the same value as default_quota fixes the issue.

Server configuration

Nextcloud version: 27.1.5

user_usage_report: 1.11.1

Where did you install Nextcloud from: normal installer

List of activated apps:

Nextcloud configuration:

Client configuration
Logs
Nextcloud log (data/nextcloud.log)
Browser log

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 with the occ usage-report:generate --output=json entry point and trace how quota is calculated for a named user versus the bulk report, especially when default_quota is inherited. Reproduce both commands with a user assigned the server default, then verify that quota is consistently emitted as an integer in both outputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.