Update 28.0.6 -> 29.0.1 failed: InvalidArgumentException: Index name [...] collides with the constraint on table [...]

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 29.0.5): 28.0.6 → 29.0.1
Operating system and version (eg, Ubuntu 29.04): Linux 5.4.0-182-generic #202-Ubuntu SMP
Apache or nginx version (eg, Apache 2.4.25): ??
PHP version (eg, 8.3): 8.3.7

The issue you are facing:
On a shared server I used Nextcloud v25 with PHP 7.4 a long time. Now I wanted to update to the latest versions.
I updated PHP to v8.1 for using the web updater of Nextcloud. The update process workded step by step / version by version – until the update to 29.0.1. I get this message each time I try to “start the update” (also see screenshot below):

Aktualisierung auf 29.0.1
InvalidArgumentException: Index name "lock_key_index" for table "XXX_file_locks_2023-10-06" collides with the constraint on table "XXX_file_locks".

Detaillierte Protokollmeldungen 
Update vorbereiten

Log-Level auf "debug" gesetzt

Wartungsmodus eingeschaltet

Reparaturschritt: Repair MySQL collation

Reparaturinformation: All tables already have the correct collation -> nothing to do

Reparaturschritt: Copy data from accounts table when migrating from ownCloud

Reparaturschritt: Drop account terms table when migrating from ownCloud

Das Datenbankschema wird aktualisiert

Datenbank aktualisiert

InvalidArgumentException: Index name "lock_key_index" for table "XXX_file_locks_2023-10-06" collides with the constraint on table "XXX_file_locks".

Is this the first time you’ve seen this error? (Y/N): Y

Therefore: how can I fix this?

table "XXX_file_locks_2023-10-06" collides with the constraint on table "XXX_file_locks".

Search the forum for the collides with the constraint on table part. You’ll find resources.

The gist is you have a table that doesn’t belong (looks like maybe a manually created backup or copy of your existing database made on 2023-10-06). That table needs to be dropped since it conflicts with the live one.

Make sure you back up your database first (hopefully you were already doing that, but I always like to remind people to do so).

2 Likes

Ah, thanks a lot!

Indeed, I remember: on 2023-10-06 I had synchronisation problems because of locked files and had to clean up the table. So I made a backup of this table – as always with the current date as suffix …

I simply deleted this table und started the update process again. Final result:

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.