server icon indicating copy to clipboard operation
server copied to clipboard

[Bug]: Can't reach "Disabled person" page

Open miharuchkasan opened this issue 2 years ago • 3 comments

⚠️ This issue respects the following points: ⚠️

Bug description

I’m currently facing an issue where I am unable to access the list of disabled accounts in Nextcloud. When attempting to do so, I receive the error message: “An error occurred during the request. It is not possible to continue. Nextcloud.” Additionally, checking the logs reveals the message “Total user count was negative (users: 21, disabled: 31).”

Another problem I’ve encountered is that after disabling an account, I’m unable to re-disable it because I can’t access the page. When using the occ command, it only shows 21 enabled users. I suspect this issue may have arisen when I initially configured LDAP without proper filters. At that time, numerous users from my AD server were imported, and I manually disabled them. Later, I implemented correct filters, but due to the manual disabling, the page appears to be bugged.

In the occ command, I only see accounts that currently exist, but in the database (oc_accounts table), I can observe a list of all accounts that were not filtered.

I’m unsure about the appropriate steps to resolve this issue. I’m even struggling to find a way to remove all accounts from Nextcloud and the Nextcloud database, except for the admin account.

Steps to reproduce

Steps to replicate it:

Go to the disabled accounts menu.
Encounter the error message: “An error occurred during the request. It is not possible to continue. Nextcloud.”

Expected behavior

Attempt to view the list of disabled accounts.

Installation method

None

Nextcloud Server version

28

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

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?

None

What user-backends are you using?

  • [ ] Default user-backend (database)
  • [X] LDAP/ Active Directory
  • [ ] SSO - SAML
  • [ ] Other

Configuration report

root@cloud:/var/www/nextcloud# sudo -u www-data php occ config:list system
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "RU",
        "force_language": "ru_RU",
        "force_locale": "ru_RU",
        "default_timezone": "Europe\/Moscow",
        "debug": true,
        "trusted_domains": [
            "",
            "",
            ""
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "overwritehos": "",
        "overwritecondaddr": "",
        "forwarded-for-headers": [
            "X-Forwarded-For",
            "HTTP_X_FORWARDED_FOR"
        ],
        "memcache.local": "\\OC\\Memcache\\Memcached",
        "memcache.distributed": "\\OC\\Memcache\\Memcached",
        "memcached_servers": [
            [
                "127.0.0.1",
                11211
            ]
        ],
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": null,
            "socket": "\/var\/run\/redis\/redis-server.sock",
            "port": 6379
        },
        "overwrite.cli.url": "https:\/\/",
        "htaccess.RewriteBase": "\/",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "enable_previews": "false",
        "version": "28.0.1.0",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "theme": "",
        "profile.enabled": false,
        "loglevel": 2,
        "app_install_overwrite": [
            "backup",
            "files_rightclick"
        ],
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "stable",
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "skeletondirectory": ""
    }
}

List of activated Apps

Enabled:
  - admin_audit: 1.18.0
  - bruteforcesettings: 2.8.0
  - cloud_federation_api: 1.11.0
  - comments: 1.18.0
  - dav: 1.29.1
  - federatedfilesharing: 1.18.0
  - federation: 1.18.0
  - files: 2.0.0
  - files_accesscontrol: 1.18.0
  - files_mindmap: 0.0.30
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - firstrunwizard: 2.17.0
  - groupfolders: 16.0.1
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - nextcloud_announcements: 1.17.0
  - notifications: 2.16.0
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - quota_warning: 1.18.0
  - recommendations: 2.0.0
  - related_resources: 1.3.0
  - richdocuments: 8.3.0
  - richdocumentscode: 23.5.602
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - support: 1.11.0
  - survey_client: 1.16.0
  - suspicious_login: 6.0.0
  - text: 3.9.1
  - theming: 2.3.0
  - twofactor_backupcodes: 1.17.0
  - updatenotification: 1.18.0
  - user_ldap: 1.19.0
  - viewer: 2.2.0
  - workflowengine: 2.10.0
Disabled:
  - activity: 2.20.0 (installed 2.19.0)
  - circles: 28.0.0-dev (installed 27.0.1)
  - contactsinteraction: 1.9.0 (installed 1.8.0)
  - dashboard: 7.8.0 (installed 7.7.0)
  - encryption: 2.16.0 (installed 2.14.0)
  - files_external: 1.20.0
  - files_pdfviewer: 2.9.0 (installed 2.8.0)
  - photos: 2.4.0 (installed 2.3.0)
  - systemtags: 1.18.0 (installed 1.17.0)
  - twofactor_totp: 10.0.0-beta.2
  - user_status: 1.8.1 (installed 1.7.0)
  - weather_status: 1.8.0 (installed 1.7.0)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"TVnCYMUBbUUnmpNKGdbL","level":2,"time":"2023-12-21T06:25:02+00:00","remoteAddr":"","user":"--","app":"support","method":"","url":"--","message":"Total user count was negative (users: 21, disabled: 31)","userAgent":"--","version":"28.0.1.0","data":{"app":"support"}}

Additional info

No response

miharuchkasan avatar Dec 21 '23 06:12 miharuchkasan

At that time, numerous users from my AD server were imported, and I manually disabled them. Later, I implemented correct filters, but due to the manual disabling, the page appears to be bugged.

In the occ command, I only see accounts that currently exist, but in the database (oc_accounts table), I can observe a list of all accounts that were not filtered.

There's a newer command that may help you, but I can't promise anything:

occ user:sync-account-data[1]

Also might be informative to delete one with occ user:delete <x> (with an account you don't care about including it's data!)[2].

[1] https://github.com/nextcloud/server/pull/38298 [2] https://docs.nextcloud.com/server/latest/admin_manual/configuration_user/user_auth_ldap_cleanup.html

joshtrichards avatar Dec 31 '23 23:12 joshtrichards

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

nextcloud-command avatar Feb 15 '24 00:02 nextcloud-command

Dear joshtrichards, Thank you for your message and apologies for the delayed response. I appreciate your suggestion regarding the occ user:sync-account-data and occ user:delete commands. I had indeed tried utilizing these functions previously, but unfortunately, they didn't resolve the issue I encountered.

Despite that, I manually cleaned up outdated users from the Nextcloud database. While the bug regarding the unavailability of the page with disabled users still persists intermittently, I'm glad to report that the influx of spam error logs, such as "Total user count was negative (users: 21, disabled: 31)", has significantly reduced.

Once again, thank you for your assistance and understanding.

P.S wanted to share with you a script I've developed for efficient management of deleted accounts in our cloud environment. You can access the script https://help.nextcloud.com/t/can-i-completely-remove-all-users-except-admin-user/177261/3?u=gillezdeleuze

miharuchkasan avatar Feb 15 '24 11:02 miharuchkasan