nextcloud / nextcloud/groupfolders

NC 32: Logs flooded with "Error while decoding the folder options"

Open
#4,055 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
PHP
Stars
343
Forks
106
Avg merge
2d 3h
Merged PRs (30d)
34

Description

It appears to be a result of #4038, which introduces the error Error while decoding the folder options
We currently receive about 10 of these log messages per second.

Steps to reproduce
  1. Setup Nextcloud
  2. Use Groupfolders
  3. Upgrade to NC 32
Expected behaviour

No errors in logs

Actual behaviour

Our logs are full of these exceptions:

  "File": "/var/www/owncloud/apps/groupfolders/lib/Folder/FolderManager.php",
  "Line": 558,
  "message": "Error while decoding the folder options",
  "exception": {},
  "folder_id": 29,
  "CustomMessage": "Error while decoding the folder options"

Full log line see below

Server configuration

Operating system: Debian 12 bookworm

Web server: Apache 2.4.65

Database: MySQL

PHP version: 8.4

Nextcloud version: 32.0.0

Team folders version: 20.1.1

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

Where did you install Nextcloud from:

Are you using external storage, if yes which one: local

Are you using encryption: no

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

Client configuration

Browser: any

Operating system: any

Logs
Full log line
{
  "Exception": "JsonException",
  "Message": "Syntax error",
  "Code": 4,
  "Trace": [
    {
      "file": "/var/www/owncloud/apps/groupfolders/lib/Folder/FolderManager.php",
      "line": 558,
      "function": "json_decode"
    },
    {
      "file": "/var/www/owncloud/apps/groupfolders/lib/Folder/FolderManager.php",
      "line": 579,
      "function": "getFolderOptions",
      "class": "OCA\\GroupFolders\\Folder\\FolderManager",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/apps/groupfolders/lib/Folder/FolderManager.php",
      "line": 615,
      "function": "rowToFolder",
      "class": "OCA\\GroupFolders\\Folder\\FolderManager",
      "type": "->"
    },
    {
      "function": "{closure:OCA\\GroupFolders\\Folder\\FolderManager::getFoldersForGroups():614}",
      "class": "OCA\\GroupFolders\\Folder\\FolderManager",
      "type": "->",
      "args": [
        "*** sensitive parameters replaced ***"
      ]
    },
    {
      "file": "/var/www/owncloud/apps/groupfolders/lib/Folder/FolderManager.php",
      "line": 614,
      "function": "array_map"
    },
    {
      "file": "/var/www/owncloud/apps/groupfolders/lib/Folder/FolderManager.php",
      "line": 912,
      "function": "getFoldersForGroups",
      "class": "OCA\\GroupFolders\\Folder\\FolderManager",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/apps/groupfolders/lib/Mount/MountProvider.php",
      "line": 51,
      "function": "getFoldersForUser",
      "class": "OCA\\GroupFolders\\Folder\\FolderManager",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/apps/groupfolders/lib/Mount/MountProvider.php",
      "line": 55,
      "function": "getFoldersForUser",
      "class": "OCA\\GroupFolders\\Mount\\MountProvider",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/lib/private/Files/Config/MountProviderCollection.php",
      "line": 56,
      "function": "getMountsForUser",
      "class": "OCA\\GroupFolders\\Mount\\MountProvider",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/lib/private/Files/Config/MountProviderCollection.php",
      "line": 113,
      "function": "getMountsFromProvider",
      "class": "OC\\Files\\Config\\MountProviderCollection",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/lib/private/Files/SetupManager.php",
      "line": 205,
      "function": "addMountForUser",
      "class": "OC\\Files\\Config\\MountProviderCollection",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/lib/private/Files/SetupManager.php",
      "line": 316,
      "function": "{closure:OC\\Files\\SetupManager::setupForUser():204}",
      "class": "OC\\Files\\SetupManager",
      "type": "->",
      "args": [
        "*** sensitive parameters replaced ***"
      ]
    },
    {
      "file": "/var/www/owncloud/lib/private/Files/SetupManager.php",
      "line": 204,
      "function": "setupForUserWith",
      "class": "OC\\Files\\SetupManager",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/lib/private/Files/SetupManager.php",
      "line": 396,
      "function": "setupForUser",
      "class": "OC\\Files\\SetupManager",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/lib/private/Files/Mount/Manager.php",
      "line": 117,
      "function": "setupForPath",
      "class": "OC\\Files\\SetupManager",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/lib/private/Files/View.php",
      "line": 1469,
      "function": "findIn",
      "class": "OC\\Files\\Mount\\Manager",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/lib/private/Files/Node/Node.php",
      "line": 94,
      "function": "addSubMounts",
      "class": "OC\\Files\\View",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/lib/private/Files/Node/Node.php",
      "line": 221,
      "function": "getFileInfo",
      "class": "OC\\Files\\Node\\Node",
      "type": "->"
    },
    {
      "function": "getEtag",
      "class": "OC\\Files\\Node\\Node",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/lib/private/Files/Node/LazyFolder.php",
      "line": 64,
      "function": "call_user_func_array"
    },
    {
      "file": "/var/www/owncloud/lib/private/Files/Node/LazyFolder.php",
      "line": 237,
      "function": "__call",
      "class": "OC\\Files\\Node\\LazyFolder",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/apps/dav/lib/Connector/Sabre/Node.php",
      "line": 183,
      "function": "getEtag",
      "class": "OC\\Files\\Node\\LazyFolder",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/apps/dav/lib/Connector/Sabre/FilesPlugin.php",
      "line": 352,
      "function": "getETag",
      "class": "OCA\\DAV\\Connector\\Sabre\\Node",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/3rdparty/sabre/dav/lib/DAV/PropFind.php",
      "line": 95,
      "function": "{closure:OCA\\DAV\\Connector\\Sabre\\FilesPlugin::handleGetProperties():351}",
      "class": "OCA\\DAV\\Connector\\Sabre\\FilesPlugin",
      "type": "->",
      "args": [
        "*** sensitive parameters replaced ***"
      ]
    },
    {
      "file": "/var/www/owncloud/apps/dav/lib/Connector/Sabre/FilesPlugin.php",
      "line": 351,
      "function": "handle",
      "class": "Sabre\\DAV\\PropFind",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
      "line": 89,
      "function": "handleGetProperties",
      "class": "OCA\\DAV\\Connector\\Sabre\\FilesPlugin",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php",
      "line": 1052,
      "function": "emit",
      "class": "Sabre\\DAV\\Server",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php",
      "line": 984,
      "function": "getPropertiesByNode",
      "class": "Sabre\\DAV\\Server",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php",
      "line": 1664,
      "function": "getPropertiesIteratorForPath",
      "class": "Sabre\\DAV\\Server",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php",
      "line": 1649,
      "function": "writeMultiStatus",
      "class": "Sabre\\DAV\\Server",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
      "line": 346,
      "function": "generateMultiStatus",
      "class": "Sabre\\DAV\\Server",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
      "line": 89,
      "function": "httpPropFind",
      "class": "Sabre\\DAV\\CorePlugin",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php",
      "line": 472,
      "function": "emit",
      "class": "Sabre\\DAV\\Server",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/apps/dav/lib/Connector/Sabre/Server.php",
      "line": 211,
      "function": "invokeMethod",
      "class": "Sabre\\DAV\\Server",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/apps/dav/lib/Server.php",
      "line": 424,
      "function": "start",
      "class": "OCA\\DAV\\Connector\\Sabre\\Server",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/apps/dav/appinfo/v2/remote.php",
      "line": 22,
      "function": "exec",
      "class": "OCA\\DAV\\Server",
      "type": "->"
    },
    {
      "file": "/var/www/owncloud/remote.php",
      "line": 151,
      "args": [
        "/var/www/owncloud/apps/dav/appinfo/v2/remote.php"
      ],
      "function": "require_once"
    }
  ],
  "File": "/var/www/owncloud/apps/groupfolders/lib/Folder/FolderManager.php",
  "Line": 558,
  "message": "Error while decoding the folder options",
  "exception": {},
  "folder_id": 29,
  "CustomMessage": "Error while decoding the folder options"
}
Web server error log

None

Nextcloud log (data/nextcloud.log)

See above

Browser log

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 in apps/groupfolders/lib/Folder/FolderManager.php around lines 558-615, especially getFolderOptions(), rowToFolder(), and getFoldersForGroups(). Reproduce the upgrade from an older installation with Groupfolders and inspect the folder-options decoding path for the malformed data reported in the trace. Done means the upgrade scenario no longer floods the Nextcloud log with decoding exceptions and folder access continues to work.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.