[Solved] Corrupted oc_filecache

I think my oc_filecache is corrupted.
I started out with a migration from owncloud 9 to nextcloud 13. That went more or less ok. with some errors.

Just now - two weeks later - I found that my desktop client isn’t syncing anymore and I have trouble with Umlaute (ÄÜÖ).

In the web gui shows two folder “Pr?sentationen” and “Präsentationen”. “Pr?sentationen” doesn’t exist on the file system. The desktop client reports that the folder is deleted on the server. (The folder doesn’t existon the client as well. Because of the “?” in the name.

occ file:scan --all doesn’t solve the problem.

Checking the logs I found

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ' SELECTfileid, storage, path, parent, name, mimetype, storage_mtime, mimepart, size, mtime, encrypted, etag, permissions, checksumFROMoc_filecacheWHEREstorage= ? ANDname COLLATE utf8mb4_general_ci LIKE ?' with params [1, "Oberjoch 2016.d1523202197\/\/Oberjoch 2016-2-_...gro\u00df wie die Berge..._.png.v%"]: SQLSTATE[42000]: Syntax error or access violation: 1253 COLLATION 'utf8mb4_general_ci' is not valid for CHARACTER SET 'utf8'

So I though converting the database to utf8mb4_general_ci would solve the problem. (occ db:convert-mysql-charset)

But that gives the following error message.

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE oc_filecache CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;': SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes

When I truncate oc_filecache the folder “Pr?sentationen” is gone in the web gui. But also all my shared links.

Any idea how to fix that problem?

ok. the oc_filecache is no longer corrupted and sync is working again. I delete the corrupted columns from the table oc_filecache.

nevertheles I have still the following error message:

# su -s /bin/bash www-data -c "php /var/www/nextcloud/occ db:convert-mysql-charset"
Change row format for oc_filecache ...
Change collation for oc_filecache ...


  [Doctrine\DBAL\Exception\DriverException]
  An exception occurred while executing 'ALTER TABLE `oc_filecache` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;':
  SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes



  [Doctrine\DBAL\Driver\PDOException]
  SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes



  [PDOException]
  SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes


db:convert-mysql-charset

do I have to worry about this?

Hi Reiner,

did you follow all steps in the documentation?
I’ve had a similar problem described in this thread.
My problem was that not all tables where using the InnoDB storage engine.

Thanks,

converting everything to the InnoDB engine solved the problem.

1 Like