Skip to content

Groupfolders App crashs nextcloud when the root_id entry of a group folder is missing in oc_filecache #4127

@stefan817

Description

@stefan817

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. I expect, the first step was an inconsistence of the oc_filecache because the server with the nextcloud-data-folder went suddenly away.
  2. As a result, in oc_filecache the row was missing with the fileid that is used in oc_group_folders as root_id
  3. Groupfolders App crashes and has to be deactivated. Otherwise Nextcloud will not run.

Expected behaviour

  • The groupfolders app should validate whether the root_id exists in oc_filecache and handle the absence gracefully.
  • Provide a clear error or warning message to alert admins about missing cache entries.
  • Possibly offer an automated repair or recovery mechanism for such broken references.

Actual behaviour

The groupfolders app crashes when accessing a group folder whose root_id entry from the oc_group_folders table does not exist in the oc_filecache table.
The root_id field in oc_group_folders references a fileid in oc_filecache that represents the root folder in the file cache. If this cache entry is missing completely, the Groupfolders app code fails with a TypeError because it tries to operate on invalid or null data.

Symptoms:

  • Nextcloud becomes unusable when Groupfolders is enabled.
  • Accessing the group folder triggers fatal errors in Cache.php during cache entry creation.
  • Standard commands such as occ files:scan --all or occ maintenance:repair do not detect or fix this inconsistency.

Workaround:

  1. Manually delete the inconsistent entry from oc_group_folders.
  2. Recreate the group folder via the Nextcloud UI.
  3. Move the files from the original folder to the newly created one at the filesystem level.

Diagnostic SQL: To find affected entries, run:

SELECT folder_id, mount_point, root_id
FROM oc_group_folders
WHERE root_id NOT IN (SELECT fileid FROM oc_filecache);

Server configuration

Operating system: Debian 12.12 (64-bit) / Linux 6.1.0-34-amd64 x86_64

Web server: Apache 2.4.65

Database: MariaDB 10.11.14

PHP version: 8.2.29

Nextcloud version: 32.0.1.2

Team folders version: 20.1.3

Updated from an older Nextcloud/ownCloud or fresh install: older Nextcloud

Where did you install Nextcloud from: ZIP

Are you using external storage, if yes which one: local (and that is connected by OS via cifs)

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Brave 1.84.132 / Chromium 142.0.7444.60

Operating system: Windows 11 Pro 25H2 26200.7019

Logs

Nextcloud log (data/nextcloud.log)

OCP\Util::numericToNumber(): Argument #1 ($number) must be of type string|int|float, null given, called in /home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Files/Cache/Cache.php on line 162 in file '/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/public/Util.php' line 323

Details
nextcloud.log:{"reqId":"***","level":3,"time":"2025-11-04T13:20:36+00:00","remoteAddr":"***","user":"***","app":"index","method":"POST","url":"/login","message":"OCP\\Util::numericToNumber(): Argument #1 ($number) must be of type string|int|float, null given, called in /home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Files/Cache/Cache.php on line 162 in file '/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/public/Util.php' line 323","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36","version":"32.0.0.13","exception":{"Exception":"Exception","Message":"OCP\\Util::numericToNumber(): Argument #1 ($number) must be of type string|int|float, null given, called in /home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Files/Cache/Cache.php on line 162 in file '/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/public/Util.php' line 323","Code":0,"Trace":[{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/base.php","line":1061,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/index.php","line":25,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":150,"Previous":{"Exception":"TypeError","Message":"OCP\\Util::numericToNumber(): Argument #1 ($number) must be of type string|int|float, null given, called in /home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Files/Cache/Cache.php on line 162","Code":0,"Trace":[{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Files/Cache/Cache.php","line":162,"function":"numericToNumber","class":"OCP\\Util","type":"::"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/apps2/groupfolders/lib/Folder/FolderManager.php","line":618,"function":"cacheEntryFromData","class":"OC\\Files\\Cache\\Cache","type":"::"},{"function":"OCA\\GroupFolders\\Folder\\{closure}","class":"OCA\\GroupFolders\\Folder\\FolderManager","type":"->","args":["--- sensitive parameters replaced ---"]},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/apps2/groupfolders/lib/Folder/FolderManager.php","line":614,"function":"array_map"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/apps2/groupfolders/lib/Folder/FolderManager.php","line":912,"function":"getFoldersForGroups","class":"OCA\\GroupFolders\\Folder\\FolderManager","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/apps2/groupfolders/lib/Mount/MountProvider.php","line":51,"function":"getFoldersForUser","class":"OCA\\GroupFolders\\Folder\\FolderManager","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/apps2/groupfolders/lib/Mount/MountProvider.php","line":55,"function":"getFoldersForUser","class":"OCA\\GroupFolders\\Mount\\MountProvider","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Files/Config/MountProviderCollection.php","line":56,"function":"getMountsForUser","class":"OCA\\GroupFolders\\Mount\\MountProvider","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Files/Config/MountProviderCollection.php","line":113,"function":"getMountsFromProvider","class":"OC\\Files\\Config\\MountProviderCollection","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Files/SetupManager.php","line":209,"function":"addMountForUser","class":"OC\\Files\\Config\\MountProviderCollection","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Files/SetupManager.php","line":316,"function":"OC\\Files\\{closure}","class":"OC\\Files\\SetupManager","type":"->","args":["--- sensitive parameters replaced ---"]},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Files/SetupManager.php","line":210,"function":"setupForUserWith","class":"OC\\Files\\SetupManager","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Files/Filesystem.php","line":334,"function":"setupForUser","class":"OC\\Files\\SetupManager","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Cache/File.php","line":37,"function":"initMountPoints","class":"OC\\Files\\Filesystem","type":"::"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Cache/File.php","line":158,"function":"getStorage","class":"OC\\Cache\\File","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/base.php","line":889,"function":"gc","class":"OC\\Cache\\File","type":"->"},{"function":"{closure}","class":"OC","type":"::","args":["--- sensitive parameters replaced ---"]},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Hooks/EmitterTrait.php","line":89,"function":"call_user_func_array"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Hooks/PublicEmitter.php","line":23,"function":"emit","class":"OC\\Hooks\\BasicEmitter","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/User/Session.php","line":355,"function":"emit","class":"OC\\Hooks\\PublicEmitter","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Authentication/Login/CompleteLoginCommand.php","line":26,"function":"completeLogin","class":"OC\\User\\Session","type":"->","args":["--- sensitive parameters replaced ---"]},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":22,"function":"process","class":"OC\\Authentication\\Login\\CompleteLoginCommand","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Authentication/Login/LoggedInCheckCommand.php","line":41,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":22,"function":"process","class":"OC\\Authentication\\Login\\LoggedInCheckCommand","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Authentication/Login/UidLoginCommand.php","line":36,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":22,"function":"process","class":"OC\\Authentication\\Login\\UidLoginCommand","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Authentication/Login/UserDisabledCheckCommand.php","line":39,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":22,"function":"process","class":"OC\\Authentication\\Login\\UserDisabledCheckCommand","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Authentication/Login/PreLoginHookCommand.php","line":34,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Authentication/Login/Chain.php","line":43,"function":"process","class":"OC\\Authentication\\Login\\PreLoginHookCommand","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/core/Controller/LoginController.php","line":346,"function":"process","class":"OC\\Authentication\\Login\\Chain","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":204,"function":"tryLogin","class":"OC\\Core\\Controller\\LoginController","type":"->","args":["--- sensitive parameters replaced ---"]},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":118,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/base.php","line":1061,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/index.php","line":25,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/public/Util.php","Line":323},"message":"OCP\\Util::numericToNumber(): Argument #1 ($number) must be of type string|int|float, null given, called in /home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Files/Cache/Cache.php on line 162 in file '/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/public/Util.php' line 323","exception":{},"CustomMessage":"OCP\\Util::numericToNumber(): Argument #1 ($number) must be of type string|int|float, null given, called in /home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/private/Files/Cache/Cache.php on line 162 in file '/home/users/--- sensitive parameters replaced ---/www/nextcloud/lib/public/Util.php' line 323"}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions