New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Call to a member function instanceOfStorage() on null #10316
Comments
GitMate.io thinks possibly related issues are #8047 (Call to a member function instanceOfStorage() on null in nextcloud/apps/files_sharing/lib/Cache.php:80), #6803 (Nextcloud 12 throwing fatal error: cron - “Call to a member function getFileInfo() on null”), #3110 (PROPFIND causes Error: Call to a member function getCache() on null), #9953 (Error message "Call to a member function getUID() on null" in cron), and #6706 (Call to a member function getUID() on null). |
I had same error after migrating from OC to NC for a single user a month ago. As workaround I've removed |
I've found a log entry in my backups:
|
Could we ask you to apply following patch to properly trace the issue: diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php
index 352001ecbd..0b3df28a7a 100644
--- a/apps/files_sharing/lib/Cache.php
+++ b/apps/files_sharing/lib/Cache.php
@@ -78,6 +78,9 @@ class Cache extends CacheJail {
// in the case where a folder is shared from a Jail we need to ensure that the share Jail
// has it's root set relative to the source Jail
$currentStorage = $this->storage->getSourceStorage();
+ if ($currentStorage === null) {
+ \OC::$server->getLogger()->logException(new \Exception('currentStorage should not be null but it is'));
+ }
if ($currentStorage->instanceOfStorage(Jail::class)) {
/** @var Jail $currentStorage */
$absoluteRoot = $currentStorage->getJailedPath($absoluteRoot); |
I've applied this additional logging to our production environment. I'll monitor it for a week and provide a feedback. |
@rullzer @icewind1991 Was this the ticket you were discussing in IRC about? |
The stack trace looks like this:
|
I think this is fixed #11862 But this still doesn't solve the issue. As a shared mount can thus be invalid and show up weird. |
In my case the bug occurs in 14.0.3, steps to reproduce :
|
Fixed via #11862 on stable12, 13 and 14. |
Steps to reproduce
sudo -u www-data php occ files:scan --all
Expected behaviour
No exception.
Actual behaviour
An unhandled exception has been thrown:
Error: Call to a member function instanceOfStorage() on null in /var/www/html/apps/files_sharing/lib/Cache.php:81
Server configuration
Official docker image: nextcloud:13.0.4-apache
Related PR: Fix Error: Call to a member function instanceOfStorage() on null #10315
The text was updated successfully, but these errors were encountered: