Skip to content

[Bug]: setting 'quota_include_external_storage' => true breaks directory share links with Argument #2 ($user) must be of type OCP\\IUser, null given #55659

@passibe15

Description

@passibe15

⚠️ This issue respects the following points: ⚠️

Bug description

After upgrading to NC version 32, if 'quota_include_external_storage' => true was set, share links that share a directory located on an external storage can no longer be accessed.

The user-facing error message reads "This folder is unavailable, please try again later or contact the administration"), see the screenshot:

Image

Debug log is attached below and reports:
OC_Helper::getGlobalStorageInfo(): Argument #2 ($user) must be of type OCP\\IUser, null given, called in /opt/www/nextcloud/lib/private/legacy/OC_Helper.php on line 278

Steps to reproduce

  1. Set 'quota_include_external_storage' => true
  2. Add external storage (here: local file)
  3. Create a directory
  4. Create share link to that directory
  5. Open share link
  6. Notice the error
  7. Set 'quota_include_external_storage' => false
  8. Refresh share link
  9. Directory can be accessed

Expected behavior

Setting 'quota_include_external_storage' => true does not break directory share links

Nextcloud Server version

32

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.4

Web server

Nginx

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Upgraded to a MAJOR version (ex. 31 to 32)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "maintenance": false,
        "trusted_domains": [
            "cloud.example.org",
            "cloud.foo.com"
        ],
        "overwrite.cli.url": "https:\/\/cloud.example.org\/",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "trashbin_retention_obligation": "30, 60",
        "log_type": "file",
        "loglevel": 2,
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "logtimezone": "Europe\/Berlin",
        "dbtype": "mysql",
        "version": "32.0.0.13",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": "true",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0
        },
        "twofactor_enforced": "false",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "simpleSignUpLink.shown": false,
        "lost_password_link": "disabled",
        "maintenance_window_start": 3,
        "theme": "",
        "default_language": "de",
        "default_locale": "de_DE",
        "default_phone_region": "DE",
        "default_timezone": "Europe\/Berlin",
        "knowledgebaseenabled": false,
        "defaultapp": "files",
        "quota_include_external_storage": true,
        "enable_previews": true,
        "preview_max_x": 1024,
        "preview_max_y": 1024,
        "jpeg_quality": 60,
        "preview_max_scale_factor": 1,
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "stable",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "files.chunked_upload.max_size": 94371840,
        "enabledPreviewProviders": [
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\Imaginary"
        ],
        "preview_imaginary_url": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated Apps

not relevant

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{
	"reqId": "7mpTIWXkNAukfWGLxQSs",
	"level": 3,
	"time": "2025-10-09T18:31:24+02:00",
	"remoteAddr": "REDACTED",
	"user": "--",
	"app": "webdav",
	"method": "PROPFIND",
	"url": "/public.php/dav/files/REDACTED/",
	"message": "OC_Helper::getGlobalStorageInfo(): Argument #2 ($user) must be of type OCP\\IUser, null given, called in /opt/www/nextcloud/lib/private/legacy/OC_Helper.php on line 278",
	"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1",
	"version": "32.0.0.13",
	"exception": {
		"Exception": "TypeError",
		"Message": "OC_Helper::getGlobalStorageInfo(): Argument #2 ($user) must be of type OCP\\IUser, null given, called in /opt/www/nextcloud/lib/private/legacy/OC_Helper.php on line 278",
		"Code": 0,
		"Trace": [
			{
				"file": "/opt/www/nextcloud/lib/private/legacy/OC_Helper.php",
				"line": 278,
				"function": "getGlobalStorageInfo",
				"class": "OC_Helper",
				"type": "::",
				"args": [
					-2,
					null,
					{
						"__class__": "OCA\\Files_External\\Config\\SystemMountPoint"
					}
				]
			},
			{
				"file": "/opt/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php",
				"line": 329,
				"function": "getStorageInfo",
				"class": "OC_Helper",
				"type": "::",
				"args": [
					"/",
					{
						"__class__": "OC\\Files\\FileInfo"
					},
					false
				]
			},
			{
				"file": "/opt/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
				"line": 770,
				"function": "getQuotaInfo",
				"class": "OCA\\DAV\\Connector\\Sabre\\Directory",
				"type": "->",
				"args": []
			},
			{
				"file": "/opt/www/nextcloud/3rdparty/sabre/dav/lib/DAV/PropFind.php",
				"line": 95,
				"function": "{closure:Sabre\\DAV\\CorePlugin::propFind():768}",
				"class": "Sabre\\DAV\\CorePlugin",
				"type": "->",
				"args": [
					"*** sensitive parameters replaced ***"
				]
			},
			{
				"file": "/opt/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
				"line": 768,
				"function": "handle",
				"class": "Sabre\\DAV\\PropFind",
				"type": "->",
				"args": [
					"{DAV:}quota-available-bytes",
					{
						"__class__": "Closure"
					}
				]
			},
			{
				"file": "/opt/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
				"line": 89,
				"function": "propFind",
				"class": "Sabre\\DAV\\CorePlugin",
				"type": "->",
				"args": [
					{
						"__class__": "Sabre\\DAV\\PropFind"
					},
					{
						"__class__": "OCA\\DAV\\Connector\\Sabre\\Directory"
					}
				]
			},
			{
				"file": "/opt/www/nextcloud/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\\Connector\\Sabre\\Directory"
						}
					]
				]
			},
			{
				"file": "/opt/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
				"line": 984,
				"function": "getPropertiesByNode",
				"class": "Sabre\\DAV\\Server",
				"type": "->",
				"args": [
					{
						"__class__": "Sabre\\DAV\\PropFind"
					},
					{
						"__class__": "OCA\\DAV\\Connector\\Sabre\\Directory"
					}
				]
			},
			{
				"file": "/opt/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
				"line": 1664,
				"function": "getPropertiesIteratorForPath",
				"class": "Sabre\\DAV\\Server",
				"type": "->",
				"args": [
					"files/REDACTED",
					[
						"{DAV:}getcontentlength",
						"{DAV:}getcontenttype",
						"{DAV:}getetag",
						"{DAV:}getlastmodified",
						"{DAV:}creationdate",
						"And 25 more entries, set log level to debug to see all entries"
					],
					1
				]
			},
			{
				"file": "/opt/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
				"line": 1649,
				"function": "writeMultiStatus",
				"class": "Sabre\\DAV\\Server",
				"type": "->",
				"args": [
					{
						"__class__": "Sabre\\Xml\\Writer",
						"elementMap": [],
						"contextUri": "/public.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": "/opt/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
				"line": 346,
				"function": "generateMultiStatus",
				"class": "Sabre\\DAV\\Server",
				"type": "->",
				"args": [
					{
						"__class__": "Generator"
					},
					false
				]
			},
			{
				"file": "/opt/www/nextcloud/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": "/opt/www/nextcloud/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": "/opt/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php",
				"line": 211,
				"function": "invokeMethod",
				"class": "Sabre\\DAV\\Server",
				"type": "->",
				"args": [
					{
						"__class__": "Sabre\\HTTP\\Request"
					},
					{
						"__class__": "Sabre\\HTTP\\Response"
					}
				]
			},
			{
				"file": "/opt/www/nextcloud/apps/dav/appinfo/v2/publicremote.php",
				"line": 152,
				"function": "start",
				"class": "OCA\\DAV\\Connector\\Sabre\\Server",
				"type": "->",
				"args": []
			},
			{
				"file": "/opt/www/nextcloud/public.php",
				"line": 90,
				"args": [
					"/opt/www/nextcloud/apps/dav/appinfo/v2/publicremote.php"
				],
				"function": "require_once"
			}
		],
		"File": "/opt/www/nextcloud/lib/private/legacy/OC_Helper.php",
		"Line": 365,
		"message": "OC_Helper::getGlobalStorageInfo(): Argument #2 ($user) must be of type OCP\\IUser, null given, called in /opt/www/nextcloud/lib/private/legacy/OC_Helper.php on line 278",
		"exception": {},
		"CustomMessage": "OC_Helper::getGlobalStorageInfo(): Argument #2 ($user) must be of type OCP\\IUser, null given, called in /opt/www/nextcloud/lib/private/legacy/OC_Helper.php on line 278"
	}
}

Additional info

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmap32-feedbackbug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions