NC 25: Files quota from LDAP config not used

Nextcloud version: 25.0.0
Operating system and version: Linux 5.10.103-v8+ aarch64 (Raspbian)
Apache version: 2.4.38
PHP version: 8.1.11

The issue you are facing:

I use an openLDAP server as user backend for my Nextcloud instance since NC 20 or 21. For non-admin/service users, the user’s file quota is configured as a profile parameter of the LDAP user (usually 50 GB). The parameter is set in NC’s LDAP config with a fallback value of 50 MB.

Since I configured the LDAP connection, this worked like a charm. Since the NC 25 upgrade, all NC users whose quota is configured via LDAP are shown with a quota of 0 B in the user overview and also get “insufficient storage” errors etc.

On OS level there’s more than enough free space available on the related mount. It seems like NC doesn’t process the configured LDAP attribute properly any longer. When looking at table oc_preferences on DB level for the affected users, the correlating user parameter has the weitd value “?”. I tried changing the value on DB level, but with no effect.

What is weird: The graphical display of the storage usage (the little “progress bar”) for the users seems to be pretty accurate concerning their configured quotas. The general LDAP connection test is successful.

I couldn’t find any suspicious log entries that seem to point to a specific cause. However, there a some reoccurring errors concerning LDAP user password excession checks (I don’t know whether they’re related to the problem or not, though):

2022-10-24T19:12:24+0200

Error: array_key_exists() expects parameter 2 to be array, null given at /var/www/nextcloud/apps/user_ldap/lib/User/User.php#662

2022-10-24T19:12:24+0200

Error: array_key_exists() expects parameter 2 to be array, null given at /var/www/nextcloud/apps/user_ldap/lib/User/User.php#661

2022-10-24T19:12:24+0200

Error: array_key_exists() expects parameter 2 to be array, null given at /var/www/nextcloud/apps/user_ldap/lib/User/User.php#660

Is this the first time you’ve seen this error?: Y

Steps to replicate it:

  1. Configure user’s storage quota via LDAP attribute
  2. Set the according attribute in NC’s LDAP config
  3. Check the user’s files quota

The output of your config.php:

$CONFIG = array (
‘passwordsalt’ => ****,
‘secret’ => ****,
‘trusted_domains’ =>
array (
90 => ****,
),
‘datadirectory’ => ‘/var/www/nextcloud/data’,
‘tempdirectory’ => ‘/tmp’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘25.0.0.18’,
‘overwrite.cli.url’ => ****,
‘dbname’ => ****,
‘dbhost’ => ****,
‘dbport’ => ‘’,
‘dbtableprefix’ => ‘oc_’,
‘mysql.utf8mb4’ => true,
‘dbuser’ => ****,
‘dbpassword’ => ****,
‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,
‘redis’ =>
array (
‘host’ => ‘/var/run/redis/redis.sock’,
‘port’ => 0,
‘timeout’ => 0.0,
‘password’ => ****,
),
‘instanceid’ => ‘ocb87bb5npoe’,
‘installed’ => true,
‘maintenance’ => false,
‘theme’ => ‘’,
‘loglevel’ => 2,
‘logfile’ => ‘/var/log/nextcloud/nextcloud.log’,
‘log_type’ => ‘file’,
‘logtimezone’ => ‘Europe/Berlin’,
‘mail_smtpmode’ => ‘smtp’,
‘mail_sendmailmode’ => ‘smtp’,
‘mail_from_address’ => ****,
‘mail_domain’ => ****,
‘mail_smtpauthtype’ => ‘PLAIN’,
‘mail_smtpauth’ => 1,
‘mail_smtphost’ => ****,
‘mail_smtpport’ => ****,
‘mail_smtpname’ => ****,
‘mail_smtppassword’ => ****,
‘mail_smtpsecure’ => ‘ssl’,
‘mail_smtpstreamoptions’ =>
array (
‘ssl’ =>
array (
‘allow_self_signed’ => true,
‘verify_peer’ => false,
),
),
‘updater.release.channel’ => ‘stable’,
‘twofactor_enforced’ => ‘true’,
‘twofactor_enforced_groups’ =>
array (
0 => ‘admin’,
1 => ‘Service’,
),
‘twofactor_enforced_excluded_groups’ =>
array (
),
‘appstoreenabled’ => true,
‘appstoreurl’ => ‘https://apps.nextcloud.com/api/v1’,
‘ldapIgnoreNamingRules’ => false,
‘ldapProviderFactory’ => ‘OCA\User_LDAP\LDAPProviderFactory’,
‘app.mail.verify-tls-peer’ => false,
‘htaccess.RewriteBase’ => ‘/’,
‘app_install_overwrite’ =>
array (
0 => ‘auto_mail_accounts’,
1 => ‘bruteforcesettings’,
2 => ‘twofactor_admin’,
3 => ‘announcementcenter’,
4 => ‘breezedark’,
5 => ‘data_request’,
6 => ‘deck’,
7 => ‘external’,
8 => ‘files_automatedtagging’,
9 => ‘files_accesscontrol’,
10 => ‘groupfolders’,
11 => ‘ldap_contacts_backend’,
12 => ‘flow_notifications’,
13 => ‘files_retention’,
14 => ‘talk_simple_poll’,
15 => ‘spreed’,
16 => ‘drop_account’,
17 => ‘user_usage_report’,
18 => ‘workflow_script’,
19 => ‘ldap_write_support’,
20 => ‘group_everyone’,
21 => ‘apporder’,
22 => ‘files_antivirus’,
23 => ‘checksum’,
24 => ‘cookbook’,
25 => ‘keeweb’,
26 => ‘music’,
27 => ‘twofactor_u2f’,
),
‘default_phone_region’ => ‘DE’,
‘trusted_proxies’ =>
array (
0 => ****,
1 => ****,
2 => ****,
),
‘default_language’ => ‘de’,
);

Addition: Manually setting a quota for a user in the user overview doesn’t work either. It will always be set back to 0 B and I don’t know where this setting comes from.

In consequence, my users can’t work with NC right now as they neither can create/unpload nor change files.

Addition 2: Updated PHP to 8.1.12, just in case. As excepted, nothing changed.

However, I could find out that the errors in thre protocol mentioned in the original post don’t have anything to do with the issue, as it seems. It seems to be more likely related to this issue: [Bug]: LDAP user and group backend causing frequent errors as of NC 24 · Issue #33622 · nextcloud/server · GitHub

Unfortunately, I still don’t know what’s the cause of this issue. I tried removing the quota attribute from the LDAP config and raising the default quota, with no success. There are absolutely no log entries that indicate a specific problem here.

I tried setting the quota for the affected users to unlimited in the user management.

Can someone please look at this issue, please? It seems like NC 25 isn’t calculating quotas properly anymore or doesn’t even use the actual quota configured for the user in oc_preferences. This is an absolute blocking issue for all my users.

Addition 3: So far, I could find out that the reading of the LDAP attributes for the users basically seems to work. Function processAttributes of class OCA\User_LDAP\USER is called with a properly filled parameter $ldapEntry which contains the correct files quota for the users. Also, function updateQuota of the same class is called with the correct quota from the user’s ldap entry.

However, as it seems, function computerFileSize of Class OC_Helper (/lib/private/legacy/OC_Helper.php) returns false for the given parameter value von ‘50 GB’ as it returns an integer conversion von $bytes. Before, it seems to have returned $bytes unconverted. The int conversion which s implemented now only works with 64 bit systems.

However, my system is 32 bit at the moment and can not easily converted or set up anew. Is 32 bit support officially abandoned now?

Addition to the addition: Okay, just learned that NC 25 marks the end of Nextcloud’s 32Bit support. Seems like I have to move the cloud to my second RasPI, which runs on Ubuntu 64, then. Luckily the database is already accessible from the second server. I’ll configure the existing data directory as a share and mount it as an according folder on server 2 then and move the application to server 2, which should save me from a (rather annoying) re-setup of server 1.