NC 13: Sharing app broken

The Sharing app seems to be broken.

In the web browser the files app will not show anything.
Just a spinning wheel.

Access via sync client and WebDAV seem unaffected.

If I disable the sharing app, all files are listed.
Everything is working except sharing.

The log shows this

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

    /var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheJail.php - line 70: OCA\Files_Sharing\Cache->getRoot()
    /var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheJail.php - line 315: OC\Files\Cache\Wrapper\CacheJail->getJailedPath(NULL)
    /var/www/nextcloud/lib/private/Files/View.php - line 1719: OC\Files\Cache\Wrapper\CacheJail->getPathById(1915703)
    /var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 119: OC\Files\View->getPath(1915703)
    /var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 459: OCA\Files_Sharing\SharedStorage->init()
    [internal function] OCA\Files_Sharing\SharedStorage->getSourceStorage()
    /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 505: call_user_func_array(Array, Array)
    /var/www/nextcloud/apps/files_sharing/lib/Cache.php - line 92: OC\Files\Storage\Wrapper\Wrapper->__call('getSourceStorag...', Array)
    /var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheJail.php - line 314: OCA\Files_Sharing\Cache->getCache()
    /var/www/nextcloud/lib/private/Files/View.php - line 1719: OC\Files\Cache\Wrapper\CacheJail->getPathById(1645463)
    /var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 119: OC\Files\View->getPath(1645463)
    /var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 459: OCA\Files_Sharing\SharedStorage->init()
    [internal function] OCA\Files_Sharing\SharedStorage->getSourceStorage()
    /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 505: call_user_func_array(Array, Array)
    /var/www/nextcloud/apps/files_sharing/lib/Cache.php - line 92: OC\Files\Storage\Wrapper\Wrapper->__call('getSourceStorag...', Array)
    /var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheJail.php - line 314: OCA\Files_Sharing\Cache->getCache()
    /var/www/nextcloud/lib/private/Files/View.php - line 1719: OC\Files\Cache\Wrapper\CacheJail->getPathById(1049740)
    /var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 119: OC\Files\View->getPath(1049740)
    /var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 464: OCA\Files_Sharing\SharedStorage->init()
    /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 494: OCA\Files_Sharing\SharedStorage->getWrapperStorage()
    /var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 157: OC\Files\Storage\Wrapper\Wrapper->instanceOfStorage('\\OCP\\Files\\IHom...')
    /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 494: OCA\Files_Sharing\SharedStorage->instanceOfStorage('\\OCP\\Files\\IHom...')
    /var/www/nextcloud/lib/private/Files/FileInfo.php - line 313: OC\Files\Storage\Wrapper\Wrapper->instanceOfStorage('\\OCP\\Files\\IHom...')
    /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Node.php - line 301: OC\Files\FileInfo->isMounted()
    /var/www/nextcloud/apps/dav/lib/Connector/Sabre/FilesPlugin.php - line 307: OCA\DAV\Connector\Sabre\Node->getDavPermissions()
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/PropFind.php - line 98: OCA\DAV\Connector\Sabre\FilesPlugin->OCA\DAV\Connector\Sabre\{closure}(*** sensitive parameters replaced ***)
    /var/www/nextcloud/apps/dav/lib/Connector/Sabre/FilesPlugin.php - line 313: 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\File))
    /var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1059: Sabre\Event\EventEmitter->emit('propFind', Array)
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 981: Sabre\DAV\Server->getPropertiesByNode(Object(Sabre\DAV\PropFind), Object(OCA\DAV\Connector\Sabre\File))
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1666: Sabre\DAV\Server->getPropertiesIteratorForPath('', Array, 1)
    /var/www/nextcloud/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/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method PROPFIND', Array)
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    /var/www/nextcloud/apps/dav/appinfo/v1/webdav.php - line 80: Sabre\DAV\Server->exec()
    /var/www/nextcloud/remote.php - line 164: require_once('/var/www/nextcl...')
    {main}

Possibly this is the same issue you are experiencing?

I upgraded from 12.01 to 13.0. A couple of my users noted this problem as well after the upgrade. I updated the version 12.05? commit https://github.com/nextcloud/server/pull/8196/files/10efe528ed2b5870329c8213bd6f3aa2e04629b5 and after a restart the users were able to access their folders again. The shared files were lost though.

Hello,

i have exactly the same problem on NC13 when i click on the “Shared” folder or run the filescan with occ.
I did rollback again to 11.07 which is the only stable version which works fine with ldap integration. All 12.x Version has also problem with ldap, iam not able to see the files. Atleast on NC13 i can see all the folders but problem with Sharing app!

An unhandled exception has been thrown:
Error: Call to a member function instanceOfStorage() on null in /var/www/nextcloud/lib/private/Files/View.php:1922
Stack trace:
#0 /var/www/nextcloud/lib/private/Files/View.php(2036): OC\Files\View->lockPath(’/Shared’, 1, false)
#1 /var/www/nextcloud/lib/private/Files/View.php(1134): OC\Files\View->lockFile(’/Shared’, 1)
#2 /var/www/nextcloud/lib/private/Files/View.php(267): OC\Files\View->basicOperation(‘mkdir’, ‘/Shared’, Array)
#3 /var/www/nextcloud/apps/files_sharing/lib/Helper.php(259): OC\Files\View->mkdir(’//Shared’)
#4 /var/www/nextcloud/apps/files_sharing/lib/SharedMount.php(93): OCA\Files_Sharing\Helper::getShareFolder(Object(OC\Files\View))
#5 /var/www/nextcloud/apps/files_sharing/lib/SharedMount.php(74): OCA\Files_Sharing\SharedMount->verifyMountPoint(Object(OC\Share20\Share), Array)
#6 /var/www/nextcloud/apps/files_sharing/lib/MountProvider.php(98): OCA\Files_Sharing\SharedMount->__construct(’\OCA\Files_Shar…’, Array, Array, Object(OC\Files\Storage\StorageFactory))
#7 /var/www/nextcloud/lib/private/Files/Config/MountProviderCollection.php(108): OCA\Files_Sharing\MountProvider->getMountsForUser(Object(OC\User\User), Object(OC\Files\Storage\StorageFactory))
#8 /var/www/nextcloud/lib/private/Files/Filesystem.php(445): OC\Files\Config\MountProviderCollection->addMountForUser(Object(OC\User\User), Object(OC\Files\Mount\Manager))
#9 /var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php(118): OC\Files\Filesystem::initMountPoints(‘13127103-1517-4…’)
#10 /var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php(464): OCA\Files_Sharing\SharedStorage->init()
#11 /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(494): OCA\Files_Sharing\SharedStorage->getWrapperStorage()
#12 /var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php(157): OC\Files\Storage\Wrapper\Wrapper->instanceOfStorage(‘OC\Files\Storag…’)
#13 /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(494): OCA\Files_Sharing\SharedStorage->instanceOfStorage(‘OC\Files\Storag…’)
#14 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(199): OC\Files\Storage\Wrapper\Wrapper->instanceOfStorage(‘OC\Files\Storag…’)

Please help us to fix the issue on NC13.

Thanks,
Nitha

I managed to get it to work somehow.

It seems that in my case there were orphaned records in my database.

Interestingly when the sharing app is enabled, the ‘occ files:scan —all’ command will abort with the same errors.

So what did I do:
I deleted every record that was causing this by taking the ‘getPathById’ value and deleted that record from the oc_filecache database.

After that, everything returned back to normal.

Hello,

can you explain me what you have done exactly?
Because we have almost 1 Million entry in the oc_filecache table, its not easy to search and delete something.

Thanks!

Hello Nitha
I would be more than willing to help.
But to me it seems you are experiencing a different problem.

My log contains references to the files affected (getPathById).
Using those IDs I was able to trace down the affected database records.

Your log however does not seem to contain any file references at all….

Is there any solution for that case?
I have this error to at NC Version 13.0.5 and an fresh istalled Elasticsearch Addon:

sudo -u www-data php occ fulltextsearch:index
indexing Files.
USER: 04d3151f-0530-4bc4-81f8-66d56683cadf

  • RAM: 20.73575592041
    An unhandled exception has been thrown:
    Error: Call to a member function instanceOfStorage() on null in /var/www/html/nextcloud/lib/private/Files/View.php:1920
    Stack trace:
    #0 /var/www/html/nextcloud/lib/private/Files/View.php(2034): OC\Files\View->lockPath(‘/0f459925-58b5-…’, 1, false)
    #1 /var/www/html/nextcloud/lib/private/Files/View.php(1134): OC\Files\View->lockFile(‘/0f459925-58b5-…’, 1)
    #2 /var/www/html/nextcloud/lib/private/Files/View.php(267): OC\Files\View->basicOperation(‘mkdir’, ‘/0f459925-58b5-…’, Array)
    #3 /var/www/html/nextcloud/lib/private/Files/Node/Folder.php(160): OC\Files\View->mkdir(‘/0f459925-58b5-…’)
    #4 /var/www/html/nextcloud/lib/private/Files/Node/Root.php(380): OC\Files\Node\Folder->newFolder(‘/0f459925-58b5-…’)
    #5 [internal function]: OC\Files\Node\Root->getUserFolder(‘0f459925-58b5-4…’)
    #6 /var/www/html/nextcloud/lib/private/Files/Node/LazyRoot.php(64): call_user_func_array(Array, Array)
    #7 /var/www/html/nextcloud/lib/private/Files/Node/LazyRoot.php(281): OC\Files\Node\LazyRoot->__call(‘getUserFolder’, Array)
    #8 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(336): OC\Files\Node\LazyRoot->getUserFolder(‘0f459925-58b5-4…’)
    #9 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(580): OCA\Files_FullTextSearch\Service\FilesService->getPathFromViewerId(269731, ‘0f459925-58b5-4…’)
    #10 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(519): OCA\Files_FullTextSearch\Service\FilesService->updateShareNames(Object(OCA\Files_FullTextSearch\Model\FilesDocument)bject(OC\Files\Node\Folder))
    #11 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(495): OCA\Files_FullTextSearch\Service\FilesService->updateDocumentAccess(Object(OCA\Files_FullTextSearch\Model\FilesDocum), Object(OC\Files\Node\Folder))
    #12 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(474): OCA\Files_FullTextSearch\Service\FilesService->updateFilesDocumentFromFile(Object(OCA\Files_FullTextSearch\Model\Filocument), Object(OC\Files\Node\Folder))
    #13 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(367): OCA\Files_FullTextSearch\Service\FilesService->updateFilesDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocume)
    #14 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(239): OCA\Files_FullTextSearch\Service\FilesService->generateDocuments(Array)
    #15 /var/www/html/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(247): OCA\Files_FullTextSearch\Provider\FilesProvider->fillIndexDocuments(Array)
    #16 /var/www/html/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(217): OCA\FullTextSearch\Service\IndexService->indexChunk(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatformObject(OCA\Files_FullTextSearch\Provider\FilesProvider), Array)
    #17 /var/www/html/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(126): OCA\FullTextSearch\Service\IndexService->indexChunks(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatfor Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Array)
    #18 /var/www/html/nextcloud/apps/fulltextsearch/lib/Command/Index.php(148): OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSeaPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), ‘04d3151f-0530-4…’)
    #19 /var/www/html/nextcloud/apps/fulltextsearch/lib/Command/Index.php(119): OCA\FullTextSearch\Command\Index->indexProvider(Object(OCA\Files_FullTextSearch\Provider\FilesProvider))
    #20 /var/www/html/nextcloud/3rdparty/symfony/console/Command/Command.php(264): OCA\FullTextSearch\Command\Index->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\put\ConsoleOutput))
    #21 /var/www/html/nextcloud/core/Command/Base.php(161): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutp)
    #22 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(874): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput
    #23 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(228): Symfony\Component\Console\Application->doRunCommand(Object(OCA\FullTextSearch\Command\Index), Object(Symfony\Component\Console\InpArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #24 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(130): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Out\ConsoleOutput))
    #25 /var/www/html/nextcloud/lib/private/Console/Application.php(173): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ColeOutput))
    #26 /var/www/html/nextcloud/console.php(90): OC\Console\Application->run()
    #27 /var/www/html/nextcloud/occ(11): require_once(‘/var/www/html/n…’)