Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 758875 - net-wireless/unifi make MongoDB optional
Summary: net-wireless/unifi make MongoDB optional
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Ben Kohler
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-07 06:23 UTC by thomas
Modified: 2020-12-09 16:09 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description thomas 2020-12-07 06:23:49 UTC
Unifi needs an old version of MongoDB (<4.0), which prevents systems from updating world because it needs Python 2.

The workaround is to run the old version of MongoDB in docker or on an external system.

Unifi can be configured to use an external MongoDB. So, it would help if MongoDB was a use flag for this ebuild.

Reproducible: Always
Comment 1 Conrad Kostecki gentoo-dev 2020-12-07 22:03:53 UTC
My UniFi is locally here working fine with a newer MongoDB?
Also no ebuild does enfore '<dev-db/mongo-4.0'?
Comment 2 Conrad Kostecki gentoo-dev 2020-12-07 22:04:49 UTC
(In reply to thomas from comment #0)
> Unifi can be configured to use an external MongoDB. So, it would help if
> MongoDB was a use flag for this ebuild.

How is that configured? Per default, unifi starts itself a mongodb process. Are there any options to override that?
Comment 3 Ionen Wolkens gentoo-dev 2020-12-08 00:17:26 UTC
I think upstream and need for migration are confusing users into thinking they _need_ <4.0.

There was threads about this recently, and seems to be successfully switching to 4.2.x now:
https://forums.gentoo.org/viewtopic-p-8541049.html#8541049
Comment 5 Ben Kohler gentoo-dev 2020-12-08 12:55:44 UTC
Current unifi release notes say "We support MongoDB 3.6 since 5.13.10, older controllers only support up to MongoDB 3.4.".  I take that to mean "we support mongodb >=3.6 finally".  There was a *specific* problem in >=3.6 that has been fixed on their end, I see no reason to believe that support TOPS OUT at 3.6.x.

Our ebuilds allow even the very latest mongodb-4.4.x, and I have been testing the latest unstable mongodb all along since I first added the workaround shim in our ebuilds to allow mongodb 3.6+.  I have not heard a single report of mongodb compatibility issues.  We are still using that shim in unifi-5.6.42-r1.

In my opinion, the idea of supporting external-mongodb is a completely separate topic from mongodb-4.x support.  We have full mongodb-4.x support.

Would you be willing to whip up an ebuild patch which adds IUSE="external-mongodb" which controls the dependencies and either adds an example entry to system.properties and/or gives some information in pkg_postinst to explain how to set this up?
Comment 6 Ben Kohler gentoo-dev 2020-12-08 13:06:24 UTC
Thinking about this just a bit more, I don't think "external-mongodb" is quite the right flag name. That would be used for whether to use a bundled copy or not.  Possibly IUSE="remote-mongodb" ?
Comment 7 thomas 2020-12-08 17:16:31 UTC
OK, so I made a backup from within Unifi and reinstalled Unifi and MongoDB (4.4.1) from scratch and then restored the backup. It works. 
Unifi itself sets the compatibility level for MongoDB to 3.6.
So, the only problem in migrating from 3.6 to 4.4 is if one wants to migrate via the MongoDB database (without Unifi backup/restore), which means migrating over version 4.0 to 4.4.
So, I do not need the use flag anymore.