TRUNCATE oc_filecache

Can TRUNCATE oc_filecache; in the nextcloud 11.0.0

The references in that table point to files that no longer exist.

That happened after the upgrade from 10.0.2 to 11.0.0

Please use the occ-command and run a files:scan. It updates the filecache-table.

The occ-command show a problem “Home storage for user usuario.uno not writable” and the permissions are ok. 755 for the folder and 644 for the files.

occ files:scan -v --path="/usuario.uno"

Starting scan for user 1 out of 1 (usuario.uno)
Home storage for user usuario.uno not writable
Make sure you’re running the scan command only as the user the web server runs as

±--------±------±-------------+
| Folders | Files | Elapsed time |
±--------±------±-------------+
| 0 | 0 | 00:00:00 |
±--------±------±-------------+

You have to use the webserver user to run the occ-comman (sudo -u webserveruser …). This user must also be the owner of the files and must be able to look into the folder.

I am using the user with the necessary permissions and still giving the same error

sudo -u apache php /var/www/html/nextcloud/occ files:scan -v --path="/usuario.uno"

Starting scan for user 1 out of 1 (usuario.uno)
Home storage for user usuario.uno not writable
Make sure you’re running the scan command only as the user the web server runs as

±--------±------±-------------+
| Folders | Files | Elapsed time |
±--------±------±-------------+
| 0 | 0 | 00:00:00 |
±--------±------±-------------+

When I want to synchronize with the desktop client the following error appears

/nextcloud/data/nextcloud.log:

{“reqId”:“sbLieaRYi1tMzAGdFaV9”,“remoteAddr”:"",“app”:“files”,“message”:“Exception: {“Exception”:“Doctrine\\DBAL\\Exception\\DriverException”,“Message”:“An exception occurred while executing ‘SELECT id, numeric_id, available, last_checked FROM oc_storages WHERE id IN (?)’ with params [\“local::\\\/var\\\/www\\\/html\\\/nextcloud\\\/data\\\/usuario.uno\\\/\”]:\n\nSQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“Code”:0,“Trace”:”#0 \/var\/www\/html\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php(128): Doctrine\\DBAL\\Driver\\AbstractMySQLDriver->convertException(‘An exception oc…’, Object(Doctrine\\DBAL\\Driver\\PDOException))\n#1 \/var\/www\/html\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(836): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), ‘SELECT id, n...', Array)\\n#2 \\\/var\\\/www\\\/html\\\/nextcloud\\\/lib\\\/private\\\/DB\\\/Connection.php(194): Doctrine\\\\DBAL\\\\Connection->executeQuery('SELECTid,n…’, Array, Array, NULL)\n#3 \/var\/www\/html\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Query\/QueryBuilder.php(206): OC\\DB\\Connection->executeQuery(‘SELECT id, `n…’, Array, Array)\n#4 \/var\/www\/html\/nextcloud\/lib\/private\/DB\/QueryBuilder\/QueryBuilder.php(177): Doctrine\\DBAL\\Query\\QueryBuilder->execute()\n#5 \/var\/www\/html\/nextcloud\/lib\/private\/Files\/Cache\/StorageGlobal.php(58): OC\\DB\\QueryBuilder\\QueryBuilder->execute()\n#6 \/var\/www\/html\/nextcloud\/lib\/private\/Files\/Cache\/StorageGlobal.php(70): OC\\Files\\Cache\\StorageGlobal->loadForStorageIds(Array)\n#7 \/var\/www\/html\/nextcloud\/lib\/private\/Files\/Cache\/Storage.php(93): OC\\Files\\Cache\\StorageGlobal->getStorageInfo(‘local::\/var\/www…’)\n#8 \/var\/www\/html\/nextcloud\/lib\/private\/Files\/Cache\/Storage.php(144): OC\\Files\\Cache\\Storage::getStorageById(‘local::\/var\/www…’)\n#9 \/var\/www\/html\/nextcloud\/lib\/private\/Files\/Cache\/Storage.php(181): OC\\Files\\Cache\\Storage::getNumericStorageId(‘local::\/var\/www…’)\n#10 \/var\/www\/html\/nextcloud\/lib\/private\/Files\/Mount\/LocalHomeMountProvider.php(42): OC\\Files\\Cache\\Storage::exists(‘local::\/var\/www…’)\n#11 \/var\/www\/html\/nextcloud\/lib\/private\/Files\/Config\/MountProviderCollection.php(98): OC\\Files\\Mount\\LocalHomeMountProvider->getHomeMountForUser(Object(OC\\User\\User), Object(OC\\Files\\Storage\\StorageFactory))\n#12 \/var\/www\/html\/nextcloud\/lib\/private\/Files\/Filesystem.php(438): OC\\Files\\Config\\MountProviderCollection->getHomeMountForUser(Object(OC\\User\\User))\n#13 \/var\/www\/html\/nextcloud\/lib\/private\/Files\/Filesystem.php(375): OC\\Files\\Filesystem::initMountPoints(‘usuario.u…’)\n#14 \/var\/www\/html\/nextcloud\/lib\/private\/legacy\/util.php(235): OC\\Files\\Filesystem::init(‘usuario.u…’, ‘\/usuario.u…’)\n#15 \/var\/www\/html\/nextcloud\/lib\/private\/Files\/Utils\/Scanner.php(83): OC_Util::setupFS(‘usuario.u…’)\n#16 \/var\/www\/html\/nextcloud\/lib\/private\/Files\/Utils\/Scanner.php(119): OC\\Files\\Utils\\Scanner->getMounts(’’)\n#17 \/var\/www\/html\/nextcloud\/apps\/files\/lib\/BackgroundJob\/ScanFiles.php(88): OC\\Files\\Utils\\Scanner->backgroundScan(’’)\n#18 \/var\/www\/html\/nextcloud\/apps\/files\/lib\/BackgroundJob\/ScanFiles.php(112): OCA\\Files\\BackgroundJob\\ScanFiles->runScanner(Object(OC\\User\\User))\n#19 \/var\/www\/html\/nextcloud\/lib\/private\/BackgroundJob\/Job.php(53): OCA\\Files\\BackgroundJob\\ScanFiles->run(NULL)\n#20 \/var\/www\/html\/nextcloud\/lib\/private\/BackgroundJob\/TimedJob.php(54): OC\\BackgroundJob\\Job->execute(Object(OC\\BackgroundJob\\JobList), Object(OC\\Log))\n#21 \/var\/www\/html\/nextcloud\/cron.php(121): OC\\BackgroundJob\\TimedJob->execute(Object(OC\\BackgroundJob\\JobList), Object(OC\\Log))\n#22 {main}",“File”:"\/var\/www\/html\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/AbstractMySQLDriver.php",“Line”:116}",“level”:3,“time”:“2017-01-13T10:36:32-05:00”,“method”:"–",“url”:"–",“user”:"–",“version”:“11.0.0.10”}

I made an upgrade to nextcloud 11.0.1RC1 and the error went away.

And it solved the problem that you could not view the folders and files as well.

Tanks.