Problems running Unifi controller on 18.7

Started by xaxero, October 30, 2018, 08:26:18 PM

Previous topic - Next topic
We have been running Unifi controller very nicely on the older versions of opnSense. using the link https://github.com/gozoinks/unifi-pfsense

Now we have an issue - starting MongoDB we have a library missing

root@gabtest:~ # mongod
Shared object "libdl.so.1" not found, required by "mongod"

Incorporating the controller has been a key part of our deployments and would be nice to keep everything in the one box if possible.

I realize this may void the warranty but if the pieces could play nice together it would be great and any ideas I can try in my sandbox would be much appreciated.



The Unifi controller is working for me on 18.7. try running the script again which will update the controller version and all required packages. Version 2 of mongodb was deprecated recently to force people onto version 3.. maybe issues with version 2 is what you are seeing


I have 2 boxes with the issue. LIBDL is not in this 18.7 version and that breaks mongodb


I just want to point out the way the Unifi software is installed you're deliberately breaking it now that their software packages are based on FreeBSD 11.2 while we are still on FreeBSD 11.1.

https://github.com/gozoinks/unifi-pfsense/blob/master/install-unifi/install-unifi.sh#L30

This is not an OPNsense issue and will fix itself when 19.1 is out. We have fixed release schedules so was can't speed this up. ;)


Cheers,
Franco

Quote from: mimugmail on October 31, 2018, 07:49:38 AM
Solution described in other thread

Can you please provide a link to other thread. Thanks

The link is already in this topic. The "problem" can't be "fixed", however.

Yeah, I was the OP on that other thread, and my 'solution' was to uninstall the unifi controller and migrate it to a raspberry pi. The unifipi works great, but the best solution would probably be to have an official way to install the controller in the same box as opnsense. Hell, while I am fantisizing, why not make it a widget, too? Seriously, though, is this fix in 19.1 just because opnsense will move to freebsd 11.2, which might break the unifi installation again in the future? Or is there any plan to have an official way to have them play nicely together?

There is a way to compile all of the packages from the opnsense source tree... I found the instructions (somewhere) and tried it about a year ago... It took several hours (8-10ish). I think it would have worked but there was a big in the Java runtime at the time so I gave up until I found the above scripta couple weeks later which worked and was orders of magnitude faster.

You could try:

opnsense-code ports
cd /usr/port/net-mgmt/unifi5
make install

No idea if it compiles well :)

Quote from: jds on October 31, 2018, 04:16:36 PM
Yeah, I was the OP on that other thread, and my 'solution' was to uninstall the unifi controller and migrate it to a raspberry pi. The unifipi works great, but the best solution would probably be to have an official way to install the controller in the same box as opnsense. Hell, while I am fantisizing, why not make it a widget, too? Seriously, though, is this fix in 19.1 just because opnsense will move to freebsd 11.2, which might break the unifi installation again in the future? Or is there any plan to have an official way to have them play nicely together?

Unifi on the Raspberry Pi works incredibly well. I have two of them deployed and they work flawlessly. I would also say, just because you could run the Unifi controller on Opnsense, it might not be a great idea from a security standpoint. The software is a large java application that is essentially a "black box"; you don't know what kind of potential vulnerabilities it has. It is closed source and proprietary. The code most likely doesn't get the scrutiny that the standard, packaged, Opnsense daemons do. I'm not saying in any way it's bad software, I use it and I like it. I'm just saying we don't know what is in it and I wouldn't recommend running on a firewall. Especially when it runs like a champ on a $35 device  :)
"Computers allow people to make mistakes faster than anything else in history, with the possible exception of handguns and tequila."

19.1-BETA images will be released later today which will work with the FreeBSD repo because the BETA is essentially 18.7.6 with HardenedBSD 11.2 underneath and can be updated as usual. However, no warranty is made for compatibility of our 11.1 and the used 11.2 remote packages as usual: It works until it doesn't.


Cheers,
Franco

I found a solution to "fix" a broken installation but it requires a working installation. On the router/controller which is working run the following commands:

pkg create mongodb
pkg create mongodb34
pkg create cyrus-sasl

The first command generates a pretty big file so it took a while to run. But those commands will create three files. On mine they were mongodb-2.6.12_5.txz, mongodb34-3.4.16.txz, and cyrus-sasl-2.1.26_13.txz. Copy those files to the router/controller with the broken installation. Run the following commands on that router:

pkg add -f mongodb-2.6.12_5.txz
pkg add -f mongodb34-3.4.16.txz
pkg add -f cyrus-sasl-2.1.26_13.txz


That worked for me. Your mileage may vary.