Error: Call to a member function getCache() on null

Nextcloud 12.0.0
Ubuntu 16.04.2 LTS
Apache: 2.4.18 (Ubuntu)
PHP 7.0.18-0ubuntu0.16.04.1

Hi,

last week i got an strange issue.
3 out of 7 users are getting on error after they log in into nextcloud. I have translated it in english.

“This directory is not available, please check the log files or contact the administrator”

German: (“Dieses Verzeichnis ist nicht verfügbar, bitte überprüfen Sie die Logdateien oder kontaktieren Sie den Administrator”)

This is the log:

Error: Call to a member function getCache() on null
/var/www/nextcloud-fpt/lib/private/Files/Cache/Wrapper/CacheJail.php - line 298: OCA\Files_Sharing\Cache->getCache()
/var/www/nextcloud-fpt/lib/private/Files/View.php - line 1697: OC\Files\Cache\Wrapper\CacheJail->getPathById(27056)
/var/www/nextcloud-fpt/apps/files_sharing/lib/SharedStorage.php - line 118: OC\Files\View->getPath(27056)
/var/www/nextcloud-fpt/apps/files_sharing/lib/SharedStorage.php - line 470: OCA\Files_Sharing\SharedStorage->init()
[internal function] OCA\Files_Sharing\SharedStorage->getSourceStorage()
/var/www/nextcloud-fpt/lib/private/Files/Storage/Wrapper/Wrapper.php - line 501: call_user_func_array(Array, Array)
/var/www/nextcloud-fpt/apps/files_sharing/lib/Cache.php - line 71: OC\Files\Storage\Wrapper\Wrapper->__call(‘getSourceStorag…’, Array)
/var/www/nextcloud-fpt/lib/private/Files/Cache/Wrapper/CacheJail.php - line 298: OCA\Files_Sharing\Cache->getCache()
/var/www/nextcloud-fpt/lib/private/Files/View.php - line 1697: OC\Files\Cache\Wrapper\CacheJail->getPathById(17524)
/var/www/nextcloud-fpt/apps/files_sharing/lib/SharedStorage.php - line 118: OC\Files\View->getPath(17524)
/var/www/nextcloud-fpt/apps/files_sharing/lib/SharedStorage.php - line 475: OCA\Files_Sharing\SharedStorage->init()
/var/www/nextcloud-fpt/lib/private/Files/Storage/Wrapper/Wrapper.php - line 490: OCA\Files_Sharing\SharedStorage->getWrapperStorage()
/var/www/nextcloud-fpt/apps/files_sharing/lib/SharedStorage.php - line 156: OC\Files\Storage\Wrapper\Wrapper->instanceOfStorage(’\OCP\Files\IHom…’)
/var/www/nextcloud-fpt/lib/private/Files/Storage/Wrapper/Wrapper.php - line 490: OCA\Files_Sharing\SharedStorage->instanceOfStorage(’\OCP\Files\IHom…’)
/var/www/nextcloud-fpt/lib/private/Files/FileInfo.php - line 310: OC\Files\Storage\Wrapper\Wrapper->instanceOfStorage(’\OCP\Files\IHom…’)
/var/www/nextcloud-fpt/apps/dav/lib/Connector/Sabre/Node.php - line 299: OC\Files\FileInfo->isMounted()
/var/www/nextcloud-fpt/apps/dav/lib/Connector/Sabre/FilesPlugin.php - line 305: OCA\DAV\Connector\Sabre\Node->getDavPermissions()
/var/www/nextcloud-fpt/3rdparty/sabre/dav/lib/DAV/PropFind.php - line 98: OCA\DAV\Connector\Sabre\FilesPlugin->OCA\DAV\Connector\Sabre{closure}()
/var/www/nextcloud-fpt/apps/dav/lib/Connector/Sabre/FilesPlugin.php - line 311: Sabre\DAV\PropFind->handle(’{http //ownclou…’, Object(Closure))
[internal function] OCA\DAV\Connector\Sabre\FilesPlugin->handleGetProperties(Object(Sabre\DAV\PropFind), Object(OCA\DAV\Connector\Sabre\Directory))
/var/www/nextcloud-fpt/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/nextcloud-fpt/3rdparty/sabre/dav/lib/DAV/Server.php - line 1058: Sabre\Event\EventEmitter->emit(‘propFind’, Array)
/var/www/nextcloud-fpt/3rdparty/sabre/dav/lib/DAV/Server.php - line 980: Sabre\DAV\Server->getPropertiesByNode(Object(Sabre\DAV\PropFind), Object(OCA\DAV\Connector\Sabre\Directory))
/var/www/nextcloud-fpt/3rdparty/sabre/dav/lib/DAV/Server.php - line 1665: Sabre\DAV\Server->getPropertiesIteratorForPath(’’, Array, 1)
/var/www/nextcloud-fpt/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 355: Sabre\DAV\Server->generateMultiStatus(Object(Generator), false)
[internal function] Sabre\DAV\CorePlugin->httpPropFind(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud-fpt/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/nextcloud-fpt/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit(‘method PROPFIND’, Array)
/var/www/nextcloud-fpt/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud-fpt/apps/dav/appinfo/v1/webdav.php - line 71: Sabre\DAV\Server->exec()
/var/www/nextcloud-fpt/remote.php - line 162: require_once(’/var/www/nextcl…’)
{main}

Hope u guys can help me.
Thanks!

Is this an upgraded setup from earlier versions? Did you move the data-folder in the past?

There was a similar error with a few problems in the database, the topic should contain enough information to investigate if you have a similar issue:

There were a few fixes in the code for it, most of it should already be in version 12.0.0, one more will be in NC 12.0.1 (https://github.com/nextcloud/server/pull/5463) which is currently scheduled for next week.

Hi,

no i didnt upgrade from earlier versions. I did a fresh install of nextcloud 12.0.0. I changed the data-folder path in the installation progess.
My nextcloud folder is in /var/www/nextcloud and my data folder path in /var/www/nextcloud-data.

I already tried this one but it didnt work.

Right now im checking out this one https://github.com/nextcloud/server/pull/5463.

Yeah, looks like its working again.
I just editied the cache.php (https://github.com/nextcloud/server/pull/5463/files)

Thanks for your help tflidd!

1 Like