Constant warning about Disabled user account ratio while using LDAP

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 29.0.5): replace me
Operating system and version (eg, Ubuntu 24.04): replace me
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version (eg, 8.3): replace me

The issue you are facing:
Get a continual warning that the total user count is negative (users: 1, disabled: 2). I have an LDAP authentication set up. I only have one local user for admin purposes. I have disabled 2 users from the LDAP server. I get this error message constantly. It would be nice if I could suppress it since it is not relevant to my set up.

Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

  1. Have an installation with only one local admin user.
  2. Attach LDAP authentication.
  3. Disable 2 or more accounts that are brought over from the LDAP server.

The output of your Nextcloud log in Admin > Logging:

[support] Warning: Total user count was negative (users: 1, disabled: 2)
	GET /admin/test
	from 84.247.149.159 by -- at Oct 30, 2024, 10:21:37 AM

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

PASTE HERE

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

PASTE HERE
1 Like

Like you I manage users through LDAP and I have had the same warning for some time. Does anyone know of a solution? Thank you!

While investigating the warning, I noticed that the occ user:report command gives the following result:

+------------------+---+
| Account Report   |   |
+------------------+---+
| Database         | 0 |
| LDAP             | 3 |
|                  |   |
| total users      | 3 |
|                  |   |
| user directories | 7 |
| active users     | 7 |
| disabled users   | 6 |
+------------------+---+

while occ user:list says:

- rosario: Rosario Sherratt
- kurt: Kurt Reichling
- tawanna: Tawanna Karamchandani

I have the same issue. Any way to suppress this message in the log?

+------------------+---+
| Account Report   |   |
+------------------+---+
| Database         | 1 |
| LDAP             | 2 |
| user_saml        | 0 |
|                  |   |
| total users      | 3 |
|                  |   |
| user directories | 1 |
| active users     | 4 |
| disabled users   | 6 |
+------------------+---+

Log:
{"reqId":"BstngU3Wuaf825dtKyu8","level":2,"time":"2025-02-11T23:25:01+00:00","remoteAddr":"","user":"--","app":"support","method":"","url":"--","message":"Total user count was negative (users: 3, disabled: 6)","userAgent":"--","version":"30.