Occ group:delete crashes server

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):
    • nextcloud 31.0.4snap1 47611 latest/stable
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 22.04.5 LTS
  • Web server and version (e.g, Apache 2.4.25):
    • nextcloud 31.0.4snap1 47611 latest/stable
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • n/a
  • PHP version (e.g, 8.3):
    • nextcloud 31.0.4snap1 47611 latest/stable
  • Is this the first time you’ve seen this error? (Yes / No):
    • replace me
  • When did this problem seem to first start?
    • When I did occ group:delete Ops
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • snap
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

If I delete the empty group gid Ops my NC instance dies with “Internal Server Error”

Same outcome if done via occ or webui

occ group:info Ops

    groupID: Ops
    displayName: DO-NOT-DELETE
    backends:
        Database
occ group:delete Ops
Group "Ops" was removed

Log entries

nextcloud.log when I try and log in afterwards

{"reqId":"M5tp3aKiPkmxljo0DLcp","level":3,"time":"2025-04-28T18:01:46+00:00","remoteAddr":"1.2.3.4","user":"user.name","app":"index","method":"POST","url":"/index.php/login","message":"array_diff(): Argument #2 must be of type array, stdClass given in file '/snap/nextcloud/47611/htdocs/lib/private/Share20/ShareDisableChecker.php' line 59","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:137.0) Gecko/20100101 Firefox/137.0","version":"31.0.4.1","exception":{"Exception":"Exception","Message":"array_diff(): Argument #2 must be of type array, stdClass given in file '/snap/nextcloud/47611/htdocs/lib/private/Share20/ShareDisableChecker.php' line 59","Code":0,"Trace":[{"file":"/snap/nextcloud/47611/htdocs/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Route/Router.php","line":307,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file":"/snap/nextcloud/47611/htdocs/lib/base.php","line":1025,"function":"match","class":"OC\Route\Router","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/snap/nextcloud/47611/htdocs/lib/private/AppFramework/Http/Dispatcher.php","Line":146,"Previous":{"Exception":"TypeError","Message":"array_diff(): Argument #2 must be of type array, stdClass given","Code":0,"Trace":[{"file":"/snap/nextcloud/47611/htdocs/lib/private/Share20/ShareDisableChecker.php","line":59,"function":"array_diff"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Files/SetupManager.php","line":120,"function":"sharingDisabledForUser","class":"OC\Share20\ShareDisableChecker","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Files/SetupManager.php","line":332,"function":"setupBuiltinWrappers","class":"OC\Files\SetupManager","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Files/SetupManager.php","line":223,"function":"setupRoot","class":"OC\Files\SetupManager","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Files/SetupManager.php","line":308,"function":"oneTimeUserSetup","class":"OC\Files\SetupManager","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Files/SetupManager.php","line":203,"function":"setupForUserWith","class":"OC\Files\SetupManager","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Files/Filesystem.php","line":332,"function":"setupForUser","class":"OC\Files\SetupManager","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Cache/File.php","line":37,"function":"initMountPoints","class":"OC\Files\Filesystem","type":"::"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Cache/File.php","line":158,"function":"getStorage","class":"OC\Cache\File","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/base.php","line":860,"function":"gc","class":"OC\Cache\File","type":"->"},{"function":"{closure}","class":"OC","type":"::","args":["*** sensitive parameters replaced "]},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Hooks/EmitterTrait.php","line":88,"function":"call_user_func_array"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Hooks/PublicEmitter.php","line":22,"function":"emit","class":"OC\Hooks\BasicEmitter","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/User/Session.php","line":350,"function":"emit","class":"OC\Hooks\PublicEmitter","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Authentication/Login/CompleteLoginCommand.php","line":22,"function":"completeLogin","class":"OC\User\Session","type":"->","args":[" sensitive parameters replaced "]},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Authentication/Login/ALoginCommand.php","line":22,"function":"process","class":"OC\Authentication\Login\CompleteLoginCommand","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Authentication/Login/LoggedInCheckCommand.php","line":41,"function":"processNextOrFinishSuccessfully","class":"OC\Authentication\Login\ALoginCommand","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Authentication/Login/ALoginCommand.php","line":22,"function":"process","class":"OC\Authentication\Login\LoggedInCheckCommand","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Authentication/Login/EmailLoginCommand.php","line":51,"function":"processNextOrFinishSuccessfully","class":"OC\Authentication\Login\ALoginCommand","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Authentication/Login/ALoginCommand.php","line":22,"function":"process","class":"OC\Authentication\Login\EmailLoginCommand","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Authentication/Login/UidLoginCommand.php","line":36,"function":"processNextOrFinishSuccessfully","class":"OC\Authentication\Login\ALoginCommand","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Authentication/Login/ALoginCommand.php","line":22,"function":"process","class":"OC\Authentication\Login\UidLoginCommand","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Authentication/Login/UserDisabledCheckCommand.php","line":39,"function":"processNextOrFinishSuccessfully","class":"OC\Authentication\Login\ALoginCommand","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Authentication/Login/ALoginCommand.php","line":22,"function":"process","class":"OC\Authentication\Login\UserDisabledCheckCommand","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Authentication/Login/PreLoginHookCommand.php","line":34,"function":"processNextOrFinishSuccessfully","class":"OC\Authentication\Login\ALoginCommand","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Authentication/Login/Chain.php","line":45,"function":"process","class":"OC\Authentication\Login\PreLoginHookCommand","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/core/Controller/LoginController.php","line":344,"function":"process","class":"OC\Authentication\Login\Chain","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/AppFramework/Http/Dispatcher.php","line":200,"function":"tryLogin","class":"OC\Core\Controller\LoginController","type":"->","args":[" sensitive parameters replaced ***"]},{"file":"/snap/nextcloud/47611/htdocs/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/lib/private/Route/Router.php","line":307,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file":"/snap/nextcloud/47611/htdocs/lib/base.php","line":1025,"function":"match","class":"OC\Route\Router","type":"->"},{"file":"/snap/nextcloud/47611/htdocs/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/snap/nextcloud/47611/htdocs/lib/private/Share20/ShareDisableChecker.php","Line":59},"message":"array_diff(): Argument #2 must be of type array, stdClass given in file '/snap/nextcloud/47611/htdocs/lib/private/Share20/ShareDisableChecker.php' line 59","exception":{},"CustomMessage":"array_diff(): Argument #2 must be of type array, stdClass given in file '/snap/nextcloud/47611/htdocs/lib/private/Share20/ShareDisableChecker.php' line 59"}}

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

occ config:list system
{
    "system": {
        "apps_paths": [
            {
                "path": "\/snap\/nextcloud\/current\/htdocs\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/snap\/nextcloud\/current\/nextcloud\/extra-apps",
                "url": "\/extra-apps",
                "writable": true
            }
        ],
        "supportedDatabases": [
            "mysql"
        ],
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0
        },
        "log_type": "file",
        "logfile": "\/var\/snap\/nextcloud\/current\/logs\/nextcloud.log",
        "logfilemode": 420,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "cloud.homelesshealthlink.com",
            "34.240.186.204"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "31.0.4.1",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "IE",
        "installed": true,
        "maintenance": false,
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "loglevel": 1,
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "skeletondirectory": "",
        "auth.webauthn.enabled": false,
        "defaultapp": "files",
        "theme": "",
        "maintenance_window_start": 1,
        "simpleSignUpLink.shown": false,
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        }
    }
}

Apps

occ app:list
Enabled:
  - activity: 4.0.0
  - admin_audit: 1.21.0
  - announcementcenter: 7.1.0
  - app_api: 5.0.2
  - bruteforcesettings: 4.0.0
  - circles: 31.0.0
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - contactsinteraction: 1.12.0
  - dashboard: 7.11.0
  - dav: 1.33.0
  - encryption: 2.19.0
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_antivirus: 6.0.0
  - files_downloadlimit: 4.0.0
  - files_external: 1.23.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_retention: 2.0.1
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - group_everyone: 0.1.17
  - groupfolders: 19.0.4
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - nextcloud_announcements: 3.0.0
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - photos: 4.0.0-dev.1
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - registration: 2.7.0
  - related_resources: 2.0.0
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - support: 3.0.0
  - systemtags: 1.21.1
  - tasks: 0.16.1
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - twofactor_totp: 13.0.0-dev.0
  - user_status: 1.11.0
  - user_usage_report: 2.0.0
  - viewer: 4.0.0
  - webhook_listeners: 1.2.0
  - workflowengine: 2.13.0
Disabled:
  - files_downloadactivity: 1.18.1 (installed 1.18.1)
  - files_rightclick: 0.15.1 (installed 1.6.0)
  - firstrunwizard: 4.0.0 (installed 2.16.0)
  - survey_client: 3.0.0 (installed 1.14.0)
  - suspicious_login: 9.0.1 (installed 5.0.0)
  - twofactor_email: 2.8.0 (installed 2.8.0)
  - twofactor_nextcloud_notification: 5.0.0 (installed 3.10.0)
  - user_ldap: 1.22.0
  - weather_status: 1.11.0 (installed 1.6.0)

Unable to post here because too many characters but the nextcloud-snap Debugging Scripts output contained as .log in this github issue

Is that group currently listed under Admin settings->Sharing somewhere like “Limit sharing based on groups”?

1 Like

It is listed under

Admin settings->Sharing > Limit sharing based on groups > Exclude some groups from sharing

Obviously this is before it gets to the state described above where I’m unable to access the webui at all

occ config:list |grep share

Before the delete

"shareapi_exclude_groups_list": "[\"OUR Campus\",\"ABCD\",\"OUR\",\"Ops\",\"Ops Management\",\"EFG management team\",\"EFG staff\",\"Town\"]",  

After the delete

"shareapi_exclude_groups_list": "{\"0\":\"OUR Campus\",\"1\":\"ABCD\",\"2\":\"OUR\",\"4\":\"Ops Management\",\"5\":\"EFG management team\",\"6\":\"EFG staff\",\"7\":\"Town\"}",

Where have all the numbers come from?