nextcloud / nextcloud/server

[Bug]: Error on accounts page, when manager of accounts has been deleted

Open
#59,265 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 32-feedback bug feature: users and groups
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 opening the accounts page (/settings/users) or specifically the "Disabled accounts" view (/settings/users/disabled), the following error message is shown:

An error occurred during the request. Unable to proceed.

Image

In the network tab of the browser developer tools, the following GET request /ocs/v2.php/cloud/users/example-manager has this response:

{
    "ocs": {
        "meta": {
            "status": "failure",
            "statuscode": 404,
            "message": "User does not exist"
        },
        "data": []
    }
}

The "example-manager" account really does not exist on our Nextcloud instance.
However, it is still referenced as the manager on another account. For this reason the accounts page frontend still tries to load it (/ocs/v2.php/cloud/users/details?offset=0&limit=25&search=):

{
    "ocs": {
        "meta": {
            "status": "ok",
            "statuscode": 200,
            "message": "OK"
        },
        "data": {
            "users": {
                "example-user": {
                    "enabled": true,
                    "storageLocation": "\/var\/www\/html\/data\/example-user",
                    "id": "example-user",
                    "firstLoginTimestamp": 0,
                    "lastLoginTimestamp": 1706374106,
                    "lastLogin": 1706374106000,
                    "backend": "Database",
                    "subadmin": [],
                    "quota": {
                        "free": 524288000,
                        "used": 0,
                        "total": 524288000,
                        "relative": 0,
                        "quota": 524288000
                    },
                    "manager": "example-manager",
                    "email": "example-user",
                    "additional_mail": [],
                    "displayname": "example-user",
                    "display-name": "example-user",
                    "phone": "",
                    "address": "",
                    "website": "",
                    "twitter": "",
                    "bluesky": "",
                    "fediverse": "",
                    "organisation": "",
                    "role": "",
                    "headline": "",
                    "biography": "",
                    "profile_enabled": "1",
                    "pronouns": "",
                    "groups": [
                        "example-group"
                    ],
                    "language": "en",
                    "locale": "",
                    "timezone": "Europe\/Berlin",
                    "notify_email": null,
                    "backendCapabilities": {
                        "setDisplayName": true,
                        "setPassword": true
                    }
                },
            }
        }
    }
}
Steps to reproduce
  1. Assign a manger to an account
  2. Delete the manger account
  3. Open the accounts page
Expected behavior

No error message is shown.
Either by gracefully handling this or by removing the manager from the account on the backend.

Nextcloud Server version

32

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Upgraded to a MAJOR version (ex. 31 to 32)

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

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

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 failure at /settings/users and /settings/users/disabled, then inspect the requests to /ocs/v2.php/cloud/users/details and /ocs/v2.php/cloud/users/example-manager. Trace how an account referencing a deleted manager is handled, and verify that the accounts page loads without an error, either by gracefully handling the missing manager or removing the stale reference.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.