nextcloud / all-in-one

📦 The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance.
https://hub.docker.com/r/nextcloud/all-in-one
GNU Affero General Public License v3.0
5.45k stars 630 forks source link

Update failed #5102

Closed themrwylde closed 2 months ago

themrwylde commented 2 months ago

Discussed in https://github.com/nextcloud/all-in-one/discussions/5101

Originally posted by **themrwylde** August 7, 2024 Firstly, sorry. I didn't realise that we needed to update all of these containers (haven't done it in 10 months) and after upgrading to 9.3—the update failed so I rolled back to a backup and everything works until the NExtcloud container restarts. Then it breaks with the following: Initializing nextcloud 29.0.4.1 ... Initializing finished Upgrading nextcloud from 28.0.0.11 to 29.0.4.1... Then it fails... I've tried: Deleting the update.failed file and upgrading but it says it's already the latest Deleting and reloading the Mastercontainer Running Maintenance:repair etc etc Any ideas? Should we just jump on the beta channel? Sorry if this is an obvious fix mate 😔
themrwylde commented 2 months ago

Just tried to swap to the beta but the problem still persists even after updating there.

themrwylde commented 2 months ago

Just tried to load an old mastercontainer and update the rest but that failed too.

themrwylde commented 2 months ago

This is the rest of it

2024-08-06T20:45:45.157463799Z Nextcloud or one of the apps require upgrade - only a limited number of commands are available 2024-08-06T20:45:45.157502241Z You may use your browser or the occ upgrade command to do the upgrade 2024-08-06T20:45:45.181204427Z System config value integrity.check.disabled deleted 2024-08-06T20:45:45.463151106Z Nextcloud or one of the apps require upgrade - only a limited number of commands are available 2024-08-06T20:45:45.463188716Z You may use your browser or the occ upgrade command to do the upgrade 2024-08-06T20:45:45.485773561Z Setting log level to debug 2024-08-06T20:45:45.488481768Z Turned on maintenance mode 2024-08-06T20:45:45.489343584Z 2024-08-06T20:45:45.493422434Z In DbalException.php line 71: 2024-08-06T20:45:45.493448803Z 2024-08-06T20:45:45.493459603Z An exception occurred while executing a query: SQLSTATE[42703]: Undefined c 2024-08-06T20:45:45.493469542Z olumn: 7 ERROR: column "lazy" of relation "oc_appconfig" does not exist 2024-08-06T20:45:45.493480202Z LINE 1: INSERT INTO "oc_appconfig" ("appid", "lazy", "type", "config...

themrwylde commented 2 months ago

Looks like my backup roles back to version 28 but then when it restarts it automatically tried to upgrade to 29 and breaks... but I can't seem to initiate this is a way that will show me the verbose logs...

sol8712 commented 2 months ago

Hi there! This hasnt been tested by me but in theory it should work: Flow steps 1-9 here https://github.com/nextcloud/all-in-one?tab=readme-ov-file#how-to-properly-reset-the-instance When you go to remake the instance with the docker command or in your docker-compose file make sure to change "nextcloud/all-in-one:latest" to "nextcloud/all-in-one:20240321_080708-latest".

That should be the version you were on before.

One option for getting up to date is to open your borg backup, move your important personal files out, remake a brand new up to date nextcloud instance and upload your files back to nextcloud.

Only when your sure you have what you need out of the old borg backup, and after you create a new one contianing your files, then you can delete the old backup

@szaimen may have a better solution.

sol8712 commented 2 months ago

Obligatorily rant: Updates are extremely important for the security of your server. When exploits are discovered they usually become public knowledge shortly after they are fixed, theres been many exploits the last few months in several key peices of software none of witch are a problem for those who keep on the latest updates, both system and AIO updates. As well as issues trying to go several version ahead as you've experienced.

There is a RSS button on the GitHub releases page so you can easily get notifications of new software releases in your news app(or use the AIOs bult in auto weekly update option)

szaimen commented 2 months ago

Hi @sol8712 you should be able to fix this by restoring a backup, then running sudo docker exec --user www-data -it nextcloud-aio-nextcloud php updater/updater.phar --no-interaction --no-backup and then restarting the containers which will first upgrade to 28.0.x and then upgrade to 29.0.x. This is actually a bug in https://github.com/nextcloud/server because this shouldnt be necessary but will still improve the update logic to also cover this with https://github.com/nextcloud/all-in-one/pull/5106

themrwylde commented 2 months ago

Thank you so much for all of the help and responses. Plus, @szaimen—you're an absolute legend! Is there anyway I can support the projcet/you with a beer/coffee/soup?! I took a look in the wiki/docs but couldn't find anything.

And just to respond to the rant @sol8712 —I totally agree and thank you, this was just a mistake on my part by not realising that the master container needed to be updated. I've been doing bi-weekly checks on the underlying server and through the NC web ui but not the actual Master Container. Epic fail but definitely won't be happening again. Thank you, thank you, thank you!

szaimen commented 2 months ago

Thank you so much for all of the help and responses. Plus, @szaimen—you're an absolute legend!

You are welcome, nice to hear! :)

Is there anyway I can support the projcet/you with a beer/coffee/soup?!

Feel free to send something to my Paypal account, it uses the same mail-address that is linked in my profile here on github :)

szaimen commented 1 month ago

This is now released with 9.5.0 Beta. Testing and feedback is welcome! See https://github.com/nextcloud/all-in-one#how-to-switch-the-channel