InvalidArgumentException with occ share:list

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 35 (Docker)
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • nginx
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • not sure
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

When executing occ share:list I get an InvalidArgumentException like this:

% docker exec --user www-data nextcloud php occ share:list

In Share.php line 513:

  [InvalidArgumentException]


share:list [--output [OUTPUT]] [--owner OWNER] [--recipient RECIPIENT] [--by BY] [--file FILE] [--parent PARENT] [--recursive] [--type TYPE] [--status STATUS]

Steps to replicate it (hint: details matter!):

  1. login to Docker host

  2. call docker exec --user www-data nextcloud php occ share:list

  3. output says exception

Log entries

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.

{"reqId":"OK5B4uNORWT7vYuCuI6r","level":3,"time":"2026-10-30T13:08:41+00:00","remoteAddr":"fd5b:86e0:557e:0:4ee1:7cc8:8941:f605","user":"dahl","app":"webdav","method":"PROPFIND","url":"/remote.php/dav/files/dahl/","scriptName":"/remote.php","message":"Exception thrown: InvalidArgumentException","userAgent":"Mozilla/5.0 (Windows) mirall/35.0.1 (build 20261029) (Nextcloud, windows-10.0.26200 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"35.0.2.2","clientReqId":"974090ea-93fb-4206-b946-10ffa787f848","exception":{"Exception":"InvalidArgumentException","Message":"","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Share20/DefaultShareProvider.php","line":1143,"function":"setPasswordHash","class":"OC\\Share20\\Share","type":"->","args":["$2a$08$eLpbUjIFFxmw2UQOPTjABexNg4Qvp3wxrZtG5L9lPCTLejRqJlVjy"]},{"file":"/var/www/html/lib/private/Share20/DefaultShareProvider.php","line":715,"function":"createShare","class":"OC\\Share20\\DefaultShareProvider","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/Share20/DefaultShareProvider.php","line":648,"function":"getSharesInFolderInternal","class":"OC\\Share20\\DefaultShareProvider","type":"->","args":["dahl",{"__class__":"OC\\Files\\Node\\Folder"},true]},{"file":"/var/www/html/lib/private/Share20/Manager.php","line":1148,"function":"getSharesInFolder","class":"OC\\Share20\\DefaultShareProvider","type":"->","args":["dahl",{"__class__":"OC\\Files\\Node\\Folder"},true]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/SharesPlugin.php","line":157,"function":"getSharesInFolder","class":"OC\\Share20\\Manager","type":"->","args":["dahl",{"__class__":"OC\\Files\\Node\\Folder"},true]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/SharesPlugin.php","line":211,"function":"getSharesFolder","class":"OCA\\DAV\\Connector\\Sabre\\SharesPlugin","type":"->","args":[{"__class__":"OC\\Files\\Node\\Folder"}]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"preloadCollection","class":"OCA\\DAV\\Connector\\Sabre\\SharesPlugin","type":"->","args":[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\DAV\\Files\\FilesHome"}]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/PropFindPreloadNotifyPlugin.php","line":46,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["preloadCollection",[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\DAV\\Files\\FilesHome"}]]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"collectionPreloadNotifier","class":"OCA\\DAV\\Connector\\Sabre\\PropFindPreloadNotifyPlugin","type":"->","args":[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\DAV\\Files\\FilesHome"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":1052,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["propFind",[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\DAV\\Files\\FilesHome"}]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":984,"function":"getPropertiesByNode","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\DAV\\Files\\FilesHome"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":1664,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->","args":["files/dahl",["{DAV:}resourcetype","{DAV:}getlastmodified","{DAV:}getcontentlength","{DAV:}getetag","{DAV:}quota-available-bytes","{DAV:}quota-used-bytes","{http://owncloud.org/ns}size","{http://owncloud.org/ns}id","{http://owncloud.org/ns}fileid","{http://owncloud.org/ns}downloadURL","{http://owncloud.org/ns}dDC","{http://owncloud.org/ns}permissions","{http://owncloud.org/ns}checksums","{http://nextcloud.org/ns}is-encrypted","{http://nextcloud.org/ns}metadata-files-live-photo","{http://nextcloud.org/ns}share-attributes","{http://owncloud.org/ns}data-fingerprint","{http://owncloud.org/ns}share-types","{http://nextcloud.org/ns}lock","{http://nextcloud.org/ns}lock-owner-displayname","{http://nextcloud.org/ns}lock-owner","{http://nextcloud.org/ns}lock-owner-type","{http://nextcloud.org/ns}lock-owner-editor","{http://nextcloud.org/ns}lock-time","{http://nextcloud.org/ns}lock-timeout","{http://nextcloud.org/ns}lock-token","{http://nextcloud.org/ns}is-mount-root"],1]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":1649,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\Xml\\Writer","elementMap":[],"contextUri":"/remote.php/dav/","namespaceMap":{"DAV:":"d","http://sabredav.org/ns":"s","http://owncloud.org/ns":"oc","http://nextcloud.org/ns":"nc"},"classMap":[]},{"__class__":"Generator"},false]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":346,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Generator"},false]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:PROPFIND",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Server.php","line":216,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/apps/dav/lib/Server.php","line":435,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":25,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/remote.php","line":158,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require"},{"file":"/var/www/html/lib/OC.php","line":1403,"function":"{closure:/var/www/html/remote.php:102}","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/remote.php","line":102,"function":"handleRequests","class":"OC","type":"::","args":[{"__class__":"Closure"}]}],"File":"/var/www/html/lib/private/Share20/Share.php","Line":513,"message":"","CustomMessage":"Exception thrown: InvalidArgumentException"},"id":"6ae4975a8e03c"}

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!):

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "serverid": 1,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "35.0.2.2",
        "appstoreenabled": true,
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "forcessl": true,
        "maintenance": false,
        "secret": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 0,
        "trashbin_retention_obligation": "auto",
        "appstore.experimental.enabled": false,
        "theme": "",
        "updater.release.channel": "stable",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "sendmail",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mysql.utf8mb4": true,
        "mail_sendmailmode": "smtp",
        "default_phone_region": "de",
        "htaccess.RewriteBase": "\/",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "filelocking.enabled": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "dbindex": 1
        },
        "maintenance_window_start": 1
    }
}

Apps

The output of occ app:list (if possible).

Enabled:
  - activity: 8.0.0
  - admin_audit: 2.0.0
  - app_api: 35.0.0
  - appstore: 2.0.0
  - bookmarks: 17.0.1
  - bruteforcesettings: 8.0.0
  - calendar: 6.6.4
  - circles: 35.0.0
  - cloud_federation_api: 2.0.0
  - comments: 2.0.0
  - contacts: 8.9.3
  - contactsinteraction: 2.0.0
  - cookbook: 0.11.12
  - dashboard: 8.0.0
  - dav: 2.0.0
  - dav_push: 1.0.3
  - deck: 1.19.1
  - federatedfilesharing: 2.0.0
  - federation: 2.0.0
  - files: 3.0.0
  - files_accesscontrol: 6.0.1
  - files_downloadlimit: 5.3.0
  - files_external: 2.0.0
  - files_lock: 35.0.1
  - files_pdfviewer: 8.0.0
  - files_reminders: 2.0.0
  - files_sharing: 2.0.0
  - files_trashbin: 2.0.0
  - files_versions: 2.0.0
  - firstrunwizard: 8.0.0
  - forms: 5.4.1
  - groupfolders: 23.0.1
  - logreader: 8.0.0
  - lookup_server_connector: 2.0.0
  - maps: 1.8.0
  - nextcloud_announcements: 7.0.0
  - notes: 6.1.0
  - notifications: 8.0.1
  - oauth2: 2.0.0
  - office: 1.1.0
  - password_policy: 7.0.0
  - photos: 8.0.0
  - privacy: 7.0.0
  - profile: 2.0.0
  - provisioning_api: 2.0.0
  - qownnotesapi: 26.8.1
  - quota_warning: 1.25.0
  - recommendations: 8.0.0
  - related_resources: 6.0.0
  - serverinfo: 7.0.0
  - settings: 2.0.0
  - sharebymail: 2.0.0
  - sharing: 1.0.4
  - spreed: 25.0.6
  - support: 7.0.0
  - survey_client: 7.0.0
  - suspicious_login: 13.0.0
  - systemtags: 2.0.0
  - tables: 2.4.0
  - tasks: 0.18.1
  - text: 9.0.1
  - theming: 3.0.0
  - twofactor_backupcodes: 2.0.0
  - twofactor_totp: 17.1.0
  - updatenotification: 2.0.0
  - user_status: 2.0.0
  - viewer: 8.0.0
  - weather_status: 2.0.0
  - webhook_listeners: 2.0.0
  - workflowengine: 3.0.0
Disabled:
  - audioplayer: 3.9.1 (installed 3.9.1)
  - encryption: 3.0.1
  - files_rightclick: 0.15.1 (installed 1.6.0)
  - keeweb: 0.6.29 (installed 0.6.29)
  - ransomware_protection: 1.14.0 (installed 1.14.0)
  - twofactor_nextcloud_notification: 9.0.0
  - user_ldap: 2.0.0


The installation has a long history. It started on 32-bit Debian with the distributed owncloud package, was migrated into a standalone nextcloud until version 25, and later migrated into the 64-bit manual docker variant.

There is a problematic user which had not logged in in a very long time, probably last when the installation was still standalone nextcloud version twenty something.

Now the exception when calling occ share:list is not the only problem. The user gets no files shown in the web interface at all and the log gets filled with messages like above, all leading to the same uncaught exception in Share.php line 513.

However for other users which were logged in frequently through all the transitions the instance works fine.

I tried removing shares of working users with the problematic user, but that did not help.

I tried using all kinds of occ cleanup commands from the administration manual, but that did not help.

Is there something I can do to fix this? Is this a bug for which I should create an Issue?