opn-repo icon indicating copy to clipboard operation
opn-repo copied to clipboard

Unifi Controller seems to stop working

Open Boostflow opened this issue 3 years ago • 12 comments

Hi all,

I'm on OPNsense 22.1 running the Unifi controller 1.1 (latest). The controller is installed and running correctly. However opening https://<ip>:8443 and http://<ip>:8080 throw a 404 error.

This is on a fresh install of the plugin. I tried reinstalling but no success. Terminal: service unifi onestatus confirms the service is running. Any pointers on how to go about getting this resolved?

Boostflow avatar Feb 10 '22 23:02 Boostflow

Output of sockstat -4

mimugmail avatar Feb 11 '22 05:02 mimugmail

image

Boostflow avatar Feb 11 '22 09:02 Boostflow

Can you check the running processes if mongo is running? Maybe the database is broken

mimugmail avatar Feb 16 '22 13:02 mimugmail

Hi, I had a similar problem in the past after a power outage. Checking the MongoDB log at /usr/local/share/java/unifi/logs/mongod.log revealed entries like this:

E STORAGE [initandlisten] WiredTiger error (-31804) [1646396990:885788][97050:0x804c12000], file:WiredTiger.wt, connection: __wt_panic, 523: the process must exit and restart: WT_PANIC: WiredTiger library panic Raw: [1646396990:885788][97050:0x804c12000], file:WiredTiger.wt, connection: __wt_panic, 523: the process must exit and restart: WT_PANIC: WiredTiger library panic

Unfortunately this could not be fixed using mongod --repair so I started from scratch using a backup from /usr/local/share/java/unifi/data/backup.

After this incident I reinstalled my OPNsense using ZFS instead of UFS as the root file system. This should me much more resilient in the case of unexpected shutdown.

NKnusperer avatar Mar 10 '22 14:03 NKnusperer

I'm not sure if ZFS is really the answer for this as mongo is quite a diva, but maybe, yes :)

mimugmail avatar Mar 10 '22 14:03 mimugmail

I seem to be having the same issue. the root cause for me is that the mongod binary is compiled against version 1.72.0 of the boost libraries and on my OPNsense router, version 1.79.0 is installed.

% /usr/local/bin/mongod
ld-elf.so.1: Shared object "libboost_program_options.so.1.72.0" not found, required by "mongod"
% pkg info mongodb36-3.6.23
mongodb36-3.6.23
Name           : mongodb36
Version        : 3.6.23
Installed on   : Thu May 26 13:37:14 2022 EDT
Origin         : databases/mongodb36
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : databases net
Licenses       : APACHE20, SSPLv1
Maintainer     : [email protected]
WWW            : https://docs.mongodb.com/v3.6/
Comment        : Distributed document-oriented "NoSQL" database
Options        :
	SASL           : on
	SSL            : on
Shared Libs required:
	libboost_program_options.so.1.72.0
	libpcre.so.1
	libpcrecpp.so.0
	libsnappy.so.1
	libsasl2.so.3
	libcrypto.so.11
	libssl.so.11
	libboost_iostreams.so.1.72.0
	libboost_system.so.1.72.0
	libboost_filesystem.so.1.72.0
Annotations    :
	FreeBSD_version: 1300523
	cpe            : cpe:2.3:a:mongodb:mongodb:3.6.23:::::freebsd13:x64
	repo_type      : binary
	repository     : mimugmail
Flat size      : 134MiB
Description    :
Mongo (from "humongous") is a high-performance, open source,
schema-free, document-oriented database. A common name in the
"NOSQL" community.

WWW: https://docs.mongodb.com/v3.6/
% pkg info | grep boost
boost-libs-1.79.0              Free portable C++ libraries (without Boost.Python)

guillaumeautran avatar May 26 '22 17:05 guillaumeautran

I'll update my build machine :)

mimugmail avatar May 26 '22 17:05 mimugmail

Can you check again please?

mimugmail avatar May 27 '22 20:05 mimugmail

Thanks for the quick turnaround. I won't be able to check to make sure it all works until tonight or tomorrow. Sorry for the delay.

guillaumeautran avatar May 30 '22 13:05 guillaumeautran

The mongodb does work now but I'm still struggling to get the unifi controller working.

guillaumeautran avatar May 31 '22 13:05 guillaumeautran

ok, all working now. I had to remove, delete the folder and reinstall unifi controller (then reload my config), but at least it works now. Thanks for the assistance.

guillaumeautran avatar May 31 '22 14:05 guillaumeautran

Mongo is a diva

mimugmail avatar May 31 '22 15:05 mimugmail