Updating app groupfolders to V 20.1.0 results in json_decode(): Argument #1 ($json) must be of type string, null given

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

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:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 32.0.0
  • Operating system and version (e.g., Ubuntu 24.04):
    • Nextcloud docker official image

Summary of the issue you are facing:

After upgrading to V32.0.0 the app Team folders V19 did not run and could not be updated to V20.1.0 with the UI.

So I deleted the folder custom_apps/groupfolders and tried to install it with the CLI. The app is now installed but enabling it with UI or CLI results in the error

“json_decode(): Argument #1 ($json) must be of type string, null given”

Steps to replicate it (hint: details matter!)

Installing Team folders in a new Nectcloud instance works fine.

Log entries

[settings] Fehler: could not enable apps
POST /settings/apps/enable
von fdea:1d79:7d81:0:8d56:a085:1eb1:6dd4 von nc_admin um 30.09.2025, 16:32:02

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

[settings] Fehler: could not enable apps
	POST /settings/apps/enable
	von fdea:1d79:7d81:0:8d56:a085:1eb1:6dd4 von nc_admin um 30.09.2025, 16:32:02
{"reqId":"fkltwk4lWBrw0nzMDqBn","level":3,"time":"2025-09-30T16:32:02+02:00","remoteAddr":"fdea:1d79:7d81:0:8d56:a085:1eb1:6dd4","user":"nc_admin","app":"settings","method":"POST","url":"/settings/apps/enable","message":"could not enable apps","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36","version":"32.0.0.13","exception":{"Exception":"TypeError","Message":"json_decode(): Argument #1 ($json) must be of type string, null given","Code":0,"Trace":[{"file":"/var/www/html/custom_apps/groupfolders/lib/Folder/FolderManager.php","line":553,"function":"json_decode","args":[null,true]},{"file":"/var/www/html/custom_apps/groupfolders/lib/Folder/FolderManager.php","line":87,"function":"rowToFolder","class":"OCA\\GroupFolders\\Folder\\FolderManager","type":"->","args":[{"0":"And 2 more entries, set log level to debug to see all entries","folder_id":1,"mount_point":"Titiwu","quota":-4,"acl":1,"storage_id":2}]},{"file":"/var/www/html/custom_apps/groupfolders/lib/Migration/WrongDefaultQuotaRepairStep.php","line":32,"function":"getAllFolders","class":"OCA\\GroupFolders\\Folder\\FolderManager","type":"->","args":[]},{"file":"/var/www/html/lib/private/Repair.php","line":107,"function":"run","class":"OCA\\GroupFolders\\Migration\\WrongDefaultQuotaRepairStep","type":"->","args":[{"__class__":"OC\\Repair"}]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":574,"function":"run","class":"OC\\Repair","type":"->","args":[]},{"file":"/var/www/html/lib/private/Installer.php","line":548,"function":"executeRepairSteps","class":"OC_App","type":"::","args":["groupfolders",{"step":"OCA\\GroupFolders\\Migration\\WrongDefaultQuotaRepairStep"}]},{"file":"/var/www/html/lib/private/Installer.php","line":93,"function":"installAppLastSteps","class":"OC\\Installer","type":"->","args":["/var/www/html/custom_apps/groupfolders",{"0":"And 22 more entries, set log level to debug to see all entries","id":"groupfolders","name":"Team folders","summary":"Admin configured folders shared with everyone in a team","description":"Admin configured folders shared with everyone in a team.\n\nFolders can be configured from *Team folders* in the admin settings.\n\nAfter a folder is created, the admin can give access to the folder to one or more teams, control their write/sharing permissions and assign a quota for the folder.\nAs of Hub 10/Nextcloud 31, the admin needs to be a part of the team to be able to assign it a Teamfolder.\n","version":"20.1.0"},null,"no"]},{"file":"/var/www/html/apps/settings/lib/Controller/AppSettingsController.php","line":574,"function":"installApp","class":"OC\\Installer","type":"->","args":["groupfolders"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":204,"function":"enableApps","class":"OCA\\Settings\\Controller\\AppSettingsController","type":"->","args":[["groupfolders"],[]]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":118,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\AppSettingsController"},"enableApps"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\AppSettingsController"},"enableApps"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\AppSettingsController","enableApps",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"settings.appsettings.enableapps"}]},{"file":"/var/www/html/lib/base.php","line":1061,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/apps/enable"]},{"file":"/var/www/html/index.php","line":25,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/custom_apps/groupfolders/lib/Folder/FolderManager.php","Line":553,"message":"could not enable apps","exception":[],"CustomMessage":"could not enable apps"},"id":"68dbeabc1ccd6"}

Please see [stable32] fix: ensure options is always an array by backportbot[bot] · Pull Request #4038 · nextcloud/groupfolders · GitHub

1 Like

I suggest this workaround (adjust path and webserver username accordingly):

cd /path/to/nextcloud/apps/groupfolders
curl -sSf 'https://patch-diff.githubusercontent.com/raw/nextcloud/groupfolders/pull/4038.patch' | sudo -u www-data patch -p1

This applies the patch from the pull request linked above, which has been merged into the branch for the app’s next release already.
As always in case of manual code changes, if you re-trigger an integrity check, the patched script will fail it. But you help testing the official fix, and no manual database changes are needed.

2 Likes

The patch solved the problem :+1:

1 Like

v20.1.1 of the app solves it. There is another bug (probably more at the server side, less in the app) which causes an error when updating to any v20.1.y for the first time. But it happens once only due to mismatching app classes in memory. So an occ upgrade to finish the app update and disable maintenance mode solves it.

So now no need anymore to patch anything.