NextCloud Docker - Cannot update NC - Exception: Database error when running migration latest for app core

Nextcloud version: 22.1.0
Operating system and version: Linux 5.10.28
Operating System: DOCKER
Webserver: Nginx
PHP version 8.0.18

The issue you are facing:
Cannot update NC
attempted NC documentation steps without success

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

Steps to replicate it:

N/A

NC LOG

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
Exception: Database error when running migration latest for app core
Update failed
Maintenance mode is kept active
Resetting log level
#
occ upgrade -vv

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
2022-10-28T10:01:47+00:00 Setting log level to debug
2022-10-28T10:01:47+00:00 Repair step: Repair MySQL collation
2022-10-28T10:01:48+00:00 Repair info: All tables already have the correct collation -> nothing to do
2022-10-28T10:01:48+00:00 Repair step: Repair SQLite autoincrement
2022-10-28T10:01:48+00:00 Repair step: Copy data from accounts table when migrating from ownCloud
2022-10-28T10:01:48+00:00 Repair step: Drop account terms table when migrating from ownCloud
2022-10-28T10:01:48+00:00 Updating database schema
2022-10-28T10:01:49+00:00 Exception: Database error when running migration latest for app core
2022-10-28T10:01:49+00:00 Update failed
2022-10-28T10:01:49+00:00 Maintenance mode is kept active
2022-10-28T10:01:49+00:00 Resetting log level
#

db log

2022-10-28  6:01:49 1303 [ERROR] InnoDB: Operating system error number 17 in a file operation.
2022-10-28  6:01:49 1303 [ERROR] InnoDB: Error number 17 means 'File exists'
2022-10-28  6:01:49 1303 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2022-10-28  6:01:49 1303 [Note] InnoDB: The file './nextcloud/oc_ratelimit_entries.ibd' already exists though the corresponding table did not exist in the InnoDB data dictionary. You can resolve the problem by removing the file.
2022-10-28  6:01:49 1303 [ERROR] InnoDB: Cannot create file './nextcloud/oc_ratelimit_entries.ibd'

Been fighting this concern for days and it sounds like something to do with mariadb
Any insight would be apprecaited.

Thank you,

Docker is updated by pulling the more recent image. You should not use the built-in nextcloud updater.

Try pulling the image for 23.

Hello,

You’re correct in some respect to say that, but not with this repository. The docker does not pull the latest build of NC, and it still required to update NC with the updater.

hub.docker.com does state in the documentation, to use the web GUI updater.

Anyone else run into this concern in the past?

Thanks,

I’m sorry you must have missed something. original readme of the docker image (unfortunately cut on hub.docker.com):

Note: the description for this image is longer than the Hub length limit of 25000, so has been trimmed. The full description can be found at https://github.com/docker-library/docs/tree/master/nextcloud/README.md. See docker/hub-beta-feedback#238 for more information.

states exactly what you have been told, pull new image to upgrade:

Hello,

Appreciate this. I am on the latest docker container, and NC still states that I am out of date when logging in and to update. Since attempting this process the update cannot complete (logs above). I had to revert back to a working instance and will have to find another solution to update NC.

As per docker readme:

For upgrading the Nextcloud version there are 3 options.

1.  Update via the webui when the upgrade shows as available.
2.  Update from the terminal when the upgrade shows as available with:
docker exec -it nextcloud updater.phar
3.  Manual upgrade using occ.

I’ve seen this error before. In all cases was the database the culprit.

You can fix this by restoring the database from a database dump and try to update again.

Hello,

Yes it seems to be the db for sure. I think I am going to move off this db docker apparently there is concerns with how it runs with NC and future NC builds (COMRESSED AND DYNAMIC tables).

I will have to migrate a new instance of NC over to a new db and scrap the old one with all the concerns it has with NC