YunoHost-Apps / wekan_ynh

Wekan package for YunoHost
MIT License
17 stars 18 forks source link

after the update to 7.51 mongod does not start (wekan board is down) #330

Open intellekta opened 3 months ago

intellekta commented 3 months ago

The issue is also described here:

https://forum.yunohost.org/t/wekan-failed-upgrade-from-7-49-to-7-51/30260

A wekan solution is described her, but i dont know how this works on a yunohost.

https://usercomp.com/news/1339843/salvaging-failed-wekan-upgrade

datenbrei commented 3 months ago

Same for me. This was the last version running for me:

WeKan ® Version 7.49.0 Meteor-Version 2.14 Node-Version 14.21.3 MongoDB-Version 4.4.29 MongoDB-Speicher-Engine wiredTiger MongoDB-Oplog aktiviert
Typ des Betriebssystems Linux Plattform linux Betriebssystem-Architektur x64 Version des Betriebssystem 5.10.0-31-amd64

Limezy commented 3 months ago

A wekan solution is described her, but i dont know how this works on a yunohost.

I was able to save my own instance using a similar mechanism

  1. Move /var/lib/mongodb to /var/lib/mongodb2
  2. Remove Wekan
  3. Force Wekan installation latest working version sudo yunohost app install --force --debug https://github.com/YunoHost-Apps/wekan_ynh/tree/5fbc3826dc598145af712c7ac639ee834997cc81
  4. Connect to mongo new instance using mongosh and drop wekan database
  5. Launch the mongo old instance on another port using mongod --dbpath /var/lib/mongodb2 --port 27018
  6. On another terminal, connect to that old instance and create a dump mongodump -db=wekan --port=27018
  7. Restore from dump on the new instance mongorestore dump/

Didn't even have to restart Wekan service. My only fail was losing my avatar picture, which is clearly a minor hassle...

This doesn't solve the issue but at least I got all my tasks back !

Limezy commented 3 months ago

@ericgaspar I think we should revert to 7.49 while finding someone that could solve the issue on the package. More and more instances will be probably broken as people launch updates

clicit commented 2 months ago

upgraded Yunohost and also Wekan from 7.42, which resulted in the Wekan board being not reachable anymore (I guess for the same reason). Uninstalled and wanted to restore the backup, which now unfortunately also fails! https://paste.yunohost.org/raw/kocojuruqi Would be great if someone can help! Thanks!

clicit commented 2 months ago

my link seems not to work.. EDIT: now it works again but I guess my backup wants mongodb 4.4, which doesnt work under the new Yunohost version? Some relevant logs from the restore process:

image

from the related mongodb logs:

{"t":{"$date":"2024-09-25T09:25:10.614+00:00"},"s":"F", "c":"CONTROL", "id":20573, "ctx":"initandlisten","msg":"Wrong mongod version","attr":{"error":"UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: Location4926900: Invalid featureCompatibilityVersion document in admin.system.version: { _id: \"featureCompatibilityVersion\", version: \"4.4\" }. See https://docs.mongodb.com/master/release-notes/6.0-compatibility/#feature-compatibility. :: caused by :: Invalid feature compatibility version value '4.4'; expected '6.0' or '6.3' or '7.0'. See https://docs.mongodb.com/master/release-notes/6.0-compatibility/#feature-compatibility.). If the current featureCompatibilityVersion is below 6.0, see the documentation on upgrading at https://docs.mongodb.com/master/release-notes/6.0/#upgrade-procedures."}}

clicit commented 2 months ago

Anynone an idea how to get my backup running? We are on Debian 11 bullseye, which might be a problem for MongoDB 4.4. But the strange thing is that it worked on bullseye before the Yuno&Wekan upgrade? Having no option to get this running now really brings us into troubles 🙄 Tried also to install 7.49 as described by @Limezy , but it fails too.. Logs: https://paste.yunohost.org/raw/qukuqexita

EDIT: Will check this now: https://forum.yunohost.org/t/wekan-upgrade-from-7-49-to-7-51-failed-with-mongod-error/30616

Limezy commented 2 months ago

@clicit i was in the same spot as yours and managed to get back to a working 7.49. Unfortunately, to do so I had to go through quite complex Mongodb manipulations and I didn't document the process. I should try to find some time to give you some ressources about how I did.

(I didn't say that 7.49 would solve your problem. I said that 7.49 is the last functional version. Every one upgrading past this version will be doomed... In fact the first thing to do would be to have the main branch back to 7.49 so that nobody sees an available upgrade in their Yunohost)

Limezy commented 2 months ago

EDIT: Will check this now: https://forum.yunohost.org/t/wekan-upgrade-from-7-49-to-7-51-failed-with-mongod-error/30616

Indeed I managed to have my instance back working following the last post of this forum thread, but I remember it didn't exactly work only following these steps. They are a good first step, though

clicit commented 2 months ago

@Limezy many thanks for your answers! Finally, I also managed to get the old instance back working, actually with a combination of your steps and the linked forum post:

  1. Move /var/lib/mongodb to /var/lib/mongodb2
  2. Remove Wekan
  3. Downgrade to mongodb 5 (see forum post)
  4. Force Wekan installation latest working version sudo yunohost app install --force --debug https://github.com/YunoHost-Apps/wekan_ynh/tree/5fbc3826dc598145af712c7ac639ee834997cc81
  5. Repair the old instance and set featureCompatibilityVersion to 5 (see forum post)
  6. Launch the old instance as background task using mongod --dbpath /var/lib/mongodb2 &
  7. Create a dump mongodump without parameters (using -db=wekan and/or doing the whole thing on a different port somehow lead to mongodump not working)
  8. Stop the running old instance systemctl stop mongod
  9. Start mongod systemctl start mongod. If that fails for some reason, like it was in my case, delete or mv the db again mv /var/lib/mongodb /var/lib/mongodb3 and create an empty one mkdir /var/lib/mongodb. Then again start the mongod service.
  10. Restore the created dump with mongorestore
Limezy commented 1 month ago

Congrats and glad you got your instance back...

autra commented 3 days ago

Same problem here. The gap between mongodb 4.4 and 7 is too big. This app should have gone through each major version separately. Also, yunohost/wekan_ynh seems to be lacking a way to upgrade mongodb instances. (That might not be easy to do though, because it depends on whatever other apps depends on mongo)

That's what I did :

  1. after the fail, restored the previous version with mongo 4.4 (so wekan <= 7.49)
  2. make a backup of /var/www/lib/mongodb
  3. stop mongod service
  4. uninstall mongodb-org and other mongodb package (be careful of not desinstalling other packages. Also, this works because only wekan depends on mongodb in my case. If you have other application, this won't work as is)
  5. add the 5.0 mongo repo in source.list
  6. reinstall mongodb-org
  7. connect with mongosh wekan and follow the steps to upgrade the compatibility to 5.0 (db.adminCommand( { setFeatureCompatibilityVersion: "5.0" } ), cf mongodb doc)
  8. do step 3 to 7 with mongodb version 6
  9. upgrade wekan

At the moment, I decided to stay in 6.0 for mongo, because the official wekan doc list this version as its dependency.