Closed ice124 closed 2 years ago
Can confirm the issue - had to uninstall and restore from backup
there is new code in the commit that unlocks and removes older version of mongodb. not sure if possible to add code to install 4.0 if older is found.
Not sure if this helps, but I was able to rollback to the May 30th version.
removing mongodb 4.2 version and installing the 4.0 version did allow me to get the unifi controller to start.
I couldn't then upgrade to 4.2, so there's still some upgrade step that's required
So I was digging around the internet and found someone that had same issue. They manage to get it working but it takes some time.
https://forums.gentoo.org/viewtopic-p-8535757.html?sid=b30b27b56d542e94801fad6041933a2e#8535757
having installed mongodb 4.0, I could run the mongo client and update the compatibility version - then rerunning the install script updated to mongodb4.2 and started without any issue
mongo localhost:27117
> db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
{ "featureCompatibilityVersion" : { "version" : "3.6" }, "ok" : 1 }
> db.adminCommand( { setFeatureCompatibilityVersion: "4.0" } )
{ "ok" : 1 }
> db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
{ "featureCompatibilityVersion" : { "version" : "4.0" }, "ok" : 1 }
Could anyone explain the steps of how do you install mongodb40 on PfSense 2.4.5-RELEASE-p1? So that I can go through the intermediate database upgrade process to go from 6.2.25 to 6.4.54, which goes from mongodb 3.6 to 4.2.
This is one way to do it:
Install the May 30 version first (https://github.com/unofficial-unifi/unifi-pfsense/blob/e51c3a6f9b55080d1e9b6100a8d42daa30641ba9/install-unifi/install-unifi.sh) to get a working mongo 3.6 database and make sure everything still works.
Install a mongo 4.0 version: (Jun 1) https://raw.githubusercontent.com/unofficial-unifi/unifi-pfsense/4167b09685d1bdf881d9076ba01d8ff2ab173a81/install-unifi/install-unifi.sh
Set the feature version to 4.0:
having installed mongodb 4.0, I could run the mongo client and update the compatibility version - then rerunning the install script updated to mongodb4.2 and started without any issue
mongo localhost:27117 > db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } ) { "featureCompatibilityVersion" : { "version" : "3.6" }, "ok" : 1 } > db.adminCommand( { setFeatureCompatibilityVersion: "4.0" } ) { "ok" : 1 } > db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } ) { "featureCompatibilityVersion" : { "version" : "4.0" }, "ok" : 1 }
At this point you have a mongodb that was upgraded from 3.6 to 4.0, then the database files were upgraded to 4.0 compatible, then upgrading to mongodb 4.2. allows you to see that it indeed works with the new format (repairs might be needed but the script does that for you)
So now you can install newer versions because the database file formats are now up-to-date.
I am having this issue with one of my machine, my other machines upgrade ok with latest mongodb42. the follow is the log error when installing scripts with mongodb42. weird thing is I have already tried a clean install (using the clean uninstall script, even tried to make my own uninstall command for mongodb) what I have not yet tried is clean uninstall+uninstall mongodb+check files in(usr/lib/bin/mongodb) using mongodb40 works fine for unifi
how do I fully uninstall mongodb?
Fetching mongodb42-4.2.17.txz: .......... done Installing mongodb42-4.2.17... pkg: mongodb42-4.2.17 conflicts with mongodb40-4.0.27 (installs files into the same place). Problematic file: /usr/local/bin/install_compass ignored by forced mode pkg: mongodb42-4.2.17 conflicts with mongodb40-4.0.27 (installs files into the same place). Problematic file: /usr/local/bin/mongo ignored by forced mode pkg: mongodb42-4.2.17 conflicts with mongodb40-4.0.27 (installs files into the same place). Problematic file: /usr/local/bin/mongod ignored by forced mode pkg: mongodb42-4.2.17 conflicts with mongodb40-4.0.27 (installs files into the same place). Problematic file: /usr/local/bin/mongos ignored by forced mode pkg: mongodb42-4.2.17 conflicts with mongodb40-4.0.27 (installs files into the same place). Problematic file: /usr/local/etc/mongodb.conf.sample ignored by forced mode pkg: mongodb42-4.2.17 conflicts with mongodb40-4.0.27 (installs files into the same place). Problematic file: /usr/local/etc/rc.d/mongod ignored by forced mode
running the commands above before upgrading seems to fail also...
The 6.2.26 merge on 6/18/2021 jumps the Mongodb from 3.6 to 4.2. By skipping the 4.0 version of Mongodb, an upgraded installation will fail to start up, as Mongodb is incapable of upgrading across more than one major release version.
Suggest modifying the install script to check the existing Mongodb version, and if it is more than one major release apart, either abort install or install the intermediate Mongodb releases and upgrade the DB until the target DB version is reached.
Here's the relevant log entry: