Repository navigation
[Bug]: setting 'quota_include_external_storage' => true breaks directory share links with Argument #2 ($user) must be of type OCP\\IUser, null given #55659
Copy link
Copy link
Labels
0. Needs triagePending check for reproducibility or if it fits our roadmapPending check for reproducibility or if it fits our roadmap32-feedbackbug
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
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:
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
- Set
'quota_include_external_storage' => true - Add external storage (here: local file)
- Create a directory
- Create share link to that directory
- Open share link
- Notice the error
- Set
'quota_include_external_storage' => false - Refresh share link
- 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 relevantNextcloud 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
0. Needs triagePending check for reproducibility or if it fits our roadmapPending check for reproducibility or if it fits our roadmap32-feedbackbug
Type
Projects
- StatusShow more project fieldsDone

Activity
rgroothuijsen commentedon Dec 13, 2025
getGlobalStorageInfo expects a logged-in user, even if there is none because it's a public share link. Adding a null check to
$userappears to solve the issue.WAPEETY commentedon Jan 18, 2026
I have the same problem, and setting
'quota_include_external_storage' => falsesolves indeed the problem but since this has been opened in october, why is still in triage?passibe15 commentedon Jan 18, 2026
Not sure. Maybe because the OC_Helper stuff is deprecated (see e143921)?
Although not sure if the replacement library (?) would actually fix this.
@susnux maybe this will be addressed in version 33?
passibe15 commentedon Apr 30, 2026
Hi, I believe this has been fixed somehow. At least I cannot reproduce it anymore with 32.0.8.
matejdro commentedon May 13, 2026
Can we reopen this?
I can still reproduce in the
Nextcloud Hub 26 Winter (33.0.3).susnux commentedon May 13, 2026
code wise not fixed
fix(OC_Helper): properly calculate quota of shared storages
fix(OC_Helper): properly calculate quota of shared storages
fix(OC_Helper): properly calculate quota of shared storages
fix(OC_Helper): properly calculate quota of shared storages
fix(OC_Helper): properly calculate quota of shared storages