Update to 29.0.3 failed - The column "lazy" on table "oc_appconfig" already exists

Hello,
I’m facing issues upgrading to 29.0.3 and not able to exit maintenance mode.

Aggiorna a 29.0.3

Exception: Database error when running migration 29000Date20240124132202 for app core The column “lazy” on table “oc_appconfig” already exists.

Log dettagliati

Preparazione dell’aggiornamento

Imposta il livello del log per il debug

Modalità di manutenzione attivata

Fase di riparazione: Repair MySQL collation

Informazioni di riparazione: All tables already have the correct collation → nothing to do

Fase di riparazione: Copy data from accounts table when migrating from ownCloud

Fase di riparazione: Drop account terms table when migrating from ownCloud

Aggiornamento schema database

Exception: Database error when running migration 29000Date20240124132202 for app core The column “lazy” on table “oc_appconfig” already exists.

L’aggiornamento non è riuscito. Segnala il problema alla comunità di Nextcloud .

Best regards

That is too little information.

  • From which version are you updating?
  • What updates have you done before?
  • Using the web updater or the command line updater?
  • Could you post the output from this database query:
SHOW COLUMNS FROM oc_appconfig;

It looks like this migration step has already been done before.


Much and good luck,
ernolf

Hello,
I was trying to rebuild with a different docker-compose and I’m not really sure which version …
it should be : 28.0.2.5
I tried with both , let me past here the logs using the cli :

www-data@a0dc3a8037e5:~/html$ ./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
Turned on maintenance mode
Updating database schema
Exception: Database error when running migration 29000Date20240124132202 for app core
The column “lazy” on table “oc_appconfig” already exists.
Update failed
Maintenance mode is kept active
Resetting log level
www-data@a0dc3a8037e5:~/html$

for the last part,
how can I run the command “show columns” inside the db ?
I can’t find the mysql binary
I have a docker installation

Thanks

And why don’t you mention that right away? I’m doing this because I enjoy it, but I’m investing my free time and I’m obviously being led around by the nose.
So please don’t withhold such important information.
That is a completely other issue, I’m out. Docker is not my strength!


Much and good luck,
ernolf

Hello,
wait , maybe there is a misunderstanding.
I’m using a customer nextcloud-app in order to add some commands to it :

FROM nextcloud:latest
RUN apt-get update
RUN apt-get install -y ffmpeg imagemagick ghostscript

so I need manually to update recreating the custom image from nextcloud:latest so it could be that I upgrade later.

Said this I have mariadb running in a docker container like nextcloud or nginx-proxy.
You asked me to run this query : SHOW COLUMNS FROM oc_appconfig;

Do you know how run it ?

Best regards

This is how to call the database from within a docker container:

  1. Find out the container name with:
docker ps --format "{{.Names}}"
  1. Get dbuser and dbpassword from your config/config.php.

  2. Execute the following command to access the database within the container. Make sure to replace $container_name, $dbuser, and $dbpassword with the actual values:

sudo docker exec -it $container_name bash -c 'mysql --user=$dbuser --password=$dbpassword --no-auto-rehash --default-character-set=utf8mb4 -D nextcloud'

Much and good luck,
ernolf

Hello,
I already tried to access the mariadb container and run mysql but it seems there is no mysql package.
I installed it manually with apt-get and now it works.

@ernolf You asked me to provide the db structure and yes it seems that the lazy columns already exists.
What should I do to go ahead ?
I can’t run the upgrade because it fails (GUI and command line) :

www-data@fe111226dedd:~/html$ ./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
Turned on maintenance mode
Updating database schema
Exception: Database error when running migration 29000Date20240124132202 for app core
The column "lazy" on table "oc_appconfig" already exists.
Update failed
Maintenance mode is kept active
Resetting log level
www-data@fe111226dedd:~/html$

Nextcloud doesn’t work at all. It just display the page and ask to upgrade to 29.0.3

Please help me with any suggestion

PS I’m using last nextcloud image

Best regards

Hello,
it seems that I just fixed it removing the lazy column.

mysql> SHOW COLUMNS FROM oc_appconfig;
+-------------+----------------------+------+-----+---------+-------+
| Field       | Type                 | Null | Key | Default | Extra |
+-------------+----------------------+------+-----+---------+-------+
| appid       | varchar(32)          | NO   | PRI |         |       |
| configkey   | varchar(64)          | NO   | PRI |         |       |
| configvalue | longtext             | YES  |     | NULL    |       |
| type        | int(10) unsigned     | NO   |     | 2       |       |
| lazy        | smallint(5) unsigned | NO   |     | 0       |       |
+-------------+----------------------+------+-----+---------+-------+
5 rows in set (0.06 sec)

mysql> alter table oc_appconfig drop column lazy;
Query OK, 0 rows affected (3.29 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> commit
    ->
    -> ;
Query OK, 0 rows affected (0.00 sec)

mysql> exit

Now the upgrade run without any issue

Best regards

 $ docker exec -it  -u 33 nextcloud-app bash
www-data@23d10c716bcd:~/html$ ./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
Turned on maintenance mode
Updating database schema
Updated database
Disabled incompatible app: previewgenerator
Updating <federation> ...
Updated <federation> to 1.19.0
Updating <lookup_server_connector> ...
Updated <lookup_server_connector> to 1.17.0
Updating <oauth2> ...
Updated <oauth2> to 1.17.0
Updating <password_policy> ...
Updated <password_policy> to 1.19.0
Updating <photos> ...
Updated <photos> to 2.5.0
Updating <files> ...
Updated <files> to 2.1.0
Updating <activity> ...
Updated <activity> to 2.21.1
Updating <circles> ...
Updated <circles> to 29.0.0-dev
Updating <cloud_federation_api> ...
Updated <cloud_federation_api> to 1.12.0
Updating <dav> ...
Fix broken values of calendar objects

 Done
    0/0 [->--------------------------]   0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
 Done
    0/0 [----->----------------------]   0%
Updated <dav> to 1.30.1
Updating <files_sharing> ...
Fix broken values of calendar objects
 Done
    0/0 [--------->------------------]   0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
 Done
    0/0 [------------->--------------]   0%
Updated <files_sharing> to 1.21.0
Updating <files_trashbin> ...
Updated <files_trashbin> to 1.19.0
Updating <files_versions> ...
Updated <files_versions> to 1.22.0
Updating <sharebymail> ...
Updated <sharebymail> to 1.19.0
Updating <workflowengine> ...
Fix broken values of calendar objects
 Done
    0/0 [---------------->-----------]   0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
 Done
    0/0 [-------------------->-------]   0%
Updated <workflowengine> to 2.11.0
Updating <comments> ...
Updated <comments> to 1.19.0
Updating <firstrunwizard> ...
Updated <firstrunwizard> to 2.18.0
Updating <logreader> ...
Updated <logreader> to 2.14.0
Updating <nextcloud_announcements> ...
Updated <nextcloud_announcements> to 1.18.0
Updating <notifications> ...
Updated <notifications> to 2.17.0
Updating <systemtags> ...
Updated <systemtags> to 1.19.0
Updating <theming> ...
Fix broken values of calendar objects
 Done
    0/0 [------------------------>---]   0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
 Done
    0/0 [>---------------------------]   0%
Updated <theming> to 2.4.0
Updating <bruteforcesettings> ...
Updated <bruteforcesettings> to 2.9.0
Updating <contactsinteraction> ...
Updated <contactsinteraction> to 1.10.0
Updating <dashboard> ...
Updated <dashboard> to 7.9.0
Updating <federatedfilesharing> ...
Updated <federatedfilesharing> to 1.19.0
Updating <files_pdfviewer> ...
Updated <files_pdfviewer> to 2.10.0
Updating <files_reminders> ...
Updated <files_reminders> to 1.2.0
Updating <privacy> ...
Updated <privacy> to 1.13.0
Updating <provisioning_api> ...
Updated <provisioning_api> to 1.19.0
Updating <recommendations> ...
Updated <recommendations> to 2.1.0
Updating <related_resources> ...
Updated <related_resources> to 1.4.0
Updating <serverinfo> ...
Updated <serverinfo> to 1.19.0
Updating <settings> ...
Updated <settings> to 1.12.0
Updating <support> ...
Fix broken values of calendar objects
 Done
    0/0 [--->------------------------]   0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
 Done
    0/0 [------->--------------------]   0%
Updated <support> to 1.12.0
Updating <survey_client> ...
Fix broken values of calendar objects
 Done
    0/0 [----------->----------------]   0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
 Done
    0/0 [-------------->-------------]   0%
Updated <survey_client> to 1.17.0
Updating <text> ...
Fix broken values of calendar objects
 Done
    0/0 [------------------>---------]   0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
 Done
    0/0 [---------------------->-----]   0%
Updated <text> to 3.10.1
Updating <twofactor_backupcodes> ...
Fix broken values of calendar objects
 Done
    0/0 [-------------------------->-]   0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
 Done
    0/0 [->--------------------------]   0%
Updated <twofactor_backupcodes> to 1.18.0
Updating <updatenotification> ...
Updated <updatenotification> to 1.19.1
Updating <user_status> ...
Updated <user_status> to 1.9.0
Updating <viewer> ...
Updated <viewer> to 2.3.0
Updating <weather_status> ...
Updated <weather_status> to 1.9.0

Update app previewgenerator from App Store
Starting code integrity check...
Finished code integrity check
Update successful
Turned off maintenance mode
Resetting log level
www-data@23d10c716bcd:~/html$