Failed update to version 29.0.10.1

I tried update as i did many times before, but this time it failed and i have no idea what exactly error message means.

sudo -u apache php ./occ status
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
  - installed: true
  - version: 29.0.10.1
  - versionstring: 29.0.10
  - edition:
  - maintenance: true
  - needsDbUpgrade: true
  - productname: Nextcloud
  - extendedSupport: false
sudo -u apache php ./occ upgrade
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Setting log level to debug
Updating database schema
Updated database
**InvalidArgumentException: Index name "appconfig_appid_key" for table "oc_oc_appconfig_61024400eba05" collides with the constraint on table "oc_oc_appconfig_1e0d872bf74de".**
Update failed
Maintenance mode is kept active
Resetting log level

In my database i found two tables named oc_oc_appconfig_61024400eba05 and oc_oc_appconfig_1e0d872bf74de but i don’t know what constraint is colliding and how i should continue.

Can you hint me please? Should i delete one of the tables? Or i will make problem worse? (i did backup MySQL database, once automatically at 3 AM, and second time immediatelly after upgrade failed, so i have possibility to return somewhere.

I still want understand what happened.

You appear to have multiple overlapping tables.

Nextcloud itself doesn’t really do this so this would usually be something you did at some point.

Perhaps you manually modified a table or backed up a table at some point?

To clean it up, you need to confirm which database and prefix is in use by your Nextcloud installation. Check your config (i.e. occ config:list system and/or occ config:list system --private).

Database table prefix is oc_ which is probably remains from times when it was OwnCloud upgraded to the NextCloud many years ago.

This it consistent. All tables in database have this prefix.

But for some reason there are these tables:

oc_appconfig
oc_oc_appconfig_1e0d872bf74de
oc_oc_appconfig_6uikl0sywqd17 (empty)
oc_oc_appconfig_61024400eba05

Is it possible - that three tables with random code in table name was created as backup when something was changed?

Can i just delete them? What purpose they have? Why they are even used?

So i did try drop all three tables and left only oc_appconfig… and then i tried ./occ upgrade which was finished successfully. After that it was only simple ./occ maintenance:mode --off and it is done, Nextcloud is working again.

Still have no idea why there tables with random names was created and why updater could not solve it itself or at least hint little better what to do.

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