Directories not listed after update: "This directory is unavailable, please check the logs or contact the administrator"

After updating my nextcloud from 10.0.2 to 11.0.0, some users are not able to list their root directories anymore in the files app. The error message given is

This directory is unavailable, please check the logs or contact the administrator

This seems to happen for users that have shares from other users or share with other users. The users that don’t have shares don’t seem to to have a problem.

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

/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheJail.php - line 296: OCA\Files_Sharing\Cache->getCache()
/var/www/nextcloud/lib/private/Files/View.php - line 1687: OC\Files\Cache\Wrapper\CacheJail->getPathById(212215)
/var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 117: OC\Files\View->getPath(212215)
/var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 453: OCA\Files_Sharing\SharedStorage->init()
/var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 449: OCA\Files_Sharing\SharedStorage->getWrapperStorage()
[internal function] OCA\Files_Sharing\SharedStorage->getSourceStorage()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 501: call_user_func_array(Array, Array)
/var/www/nextcloud/apps/files_sharing/lib/Cache.php - line 69: OC\Files\Storage\Wrapper\Wrapper->__call('getSourceStorag...', Array)
/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheJail.php - line 296: OCA\Files_Sharing\Cache->getCache()
/var/www/nextcloud/lib/private/Files/View.php - line 1687: OC\Files\Cache\Wrapper\CacheJail->getPathById(210445)
/var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 117: OC\Files\View->getPath(210445)
/var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 453: OCA\Files_Sharing\SharedStorage->init()
/var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 449: OCA\Files_Sharing\SharedStorage->getWrapperStorage()
[internal function] OCA\Files_Sharing\SharedStorage->getSourceStorage()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 501: call_user_func_array(Array, Array)
/var/www/nextcloud/apps/files_sharing/lib/Cache.php - line 69: OC\Files\Storage\Wrapper\Wrapper->__call('getSourceStorag...', Array)
/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheJail.php - line 296: OCA\Files_Sharing\Cache->getCache()
/var/www/nextcloud/lib/private/Files/View.php - line 1687: OC\Files\Cache\Wrapper\CacheJail->getPathById(206443)
/var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 117: OC\Files\View->getPath(206443)
/var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 453: OCA\Files_Sharing\SharedStorage->init()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 490: OCA\Files_Sharing\SharedStorage->getWrapperStorage()
/var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 143: OC\Files\Storage\Wrapper\Wrapper->instanceOfStorage('\\OCP\\Files\\IHom...')
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 490: OCA\Files_Sharing\SharedStorage->instanceOfStorage('\\OCP\\Files\\IHom...')
/var/www/nextcloud/lib/private/Files/FileInfo.php - line 310: OC\Files\Storage\Wrapper\Wrapper->instanceOfStorage('\\OCP\\Files\\IHom...')
/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Node.php - line 297: OC\Files\FileInfo->isMounted()
/var/www/nextcloud/apps/dav/lib/Connector/Sabre/FilesPlugin.php - line 298: 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}()
/var/www/nextcloud/apps/dav/lib/Connector/Sabre/FilesPlugin.php - line 304: 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/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 1035: Sabre\Event\EventEmitter->emit('propFind', Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 955: Sabre\DAV\Server->getPropertiesByNode(Object(Sabre\DAV\PropFind), Object(OCA\DAV\Connector\Sabre\Directory))
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 336: Sabre\DAV\Server->getPropertiesForPath('', Array, 1)
[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 60: Sabre\DAV\Server->exec()
/var/www/nextcloud/remote.php - line 165: require_once('/var/www/nextcl...')
{main}

I noticed the same error being generated when running the cron job or doing a files:scan operation with occ on the command line.

My guess from an earlier issue is that the problem comes from orphaned shares, but I don’t know how to fix that.

Any ideas would be appreciated.

Sorry, that this was unanswered for a while. But you already found the way to report this bug on github: