Failing to upgrade from Nextcloud 28 to Nextcloud 29

Nextcloud version: 29.0.4
Operating system and version: Arch Linux (Docker)
Apache or nginx version: Apache/2.4.61
PHP version: 8.2.22

The issue you are facing:

Is this the first time you’ve seen this error?: Y

Steps to replicate it:

  1. Pull Nextcloud 29 Docker container after running a Docker 28 image.
  2. Wait for update to go through.
  3. See that server did not get out of maintenance mode.
  4. Run php occ upgrade.
  5. See the following:
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 "admindel_groupid_idx" for table "oc_authorized_groups_old" collides with the constraint on table "oc_authorized_groups".**
Update failed
Maintenance mode is kept active
Resetting log level

I won’t supply logs or config here as I’m pretty sure none of that is relevant to a MySQL error and that’s going to be a real hassle. If needed I will provide them.

Hi @Yaro_Kasear1,

You obviously copied (duplicated) the table “oc_authorized_groups” to “oc_authorized_groups_old” at some point.

Such backups are no longer accepted in order to optimize performance.

So drop the backup and start upgrade again.


Much and good luck,
ernolf

1 Like

Odd. I don’t remember doing any such thing with the database, but I’ll try that.

For the record, the entire upgrade process is logged in the Docker log for the app container.

At least if you’re using the micro-services image. You didn’t specify which Docker image you’re using.

Anyhow, I agree with what @ernolf said. You have a manually created table that has conflicts with your presumably active table.

The oc_authorized_groups_old is presumably the one that needs to go away.

Newer Nextcloud versions have become more strict about this to avoid problems.

If you search the forum you’ll find others that encountered similar situations and the resolution path. E.g. Update 28.0.6 -> 29.0.1 failed: InvalidArgumentException: Index name [...] collides with the constraint on table [...] - #2 by jtr

It’s possible the conflicting table(s) were even created years ago.

1 Like

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