unofficial-unifi / unifi-pfsense

A script that installs the UniFi Controller software on pfSense and other FreeBSD systems
BSD 2-Clause "Simplified" License
747 stars 241 forks source link

MongoDb failing to start after PFSense upgrade #322

Closed douglasg14b closed 11 months ago

douglasg14b commented 1 year ago

Seems that after an upgrade a while back, the unifi controller broke. MongoDb fails to start:

-----  END BACKTRACE  -----
2023-02-19T16:08:59.686-0800 I CONTROL  [main] ***** SERVER RESTARTED *****
2023-02-19T16:08:59.775-0800 I CONTROL  [initandlisten] MongoDB starting : pid=86916 port=27117 dbpath=/usr/local/UniFi/data/db 64-bit host=shield.moochermedia.co
2023-02-19T16:08:59.775-0800 I CONTROL  [initandlisten] db version v3.6.21
2023-02-19T16:08:59.775-0800 I CONTROL  [initandlisten] git version: 1cd2db51dce4b16f4bc97a75056269df0dc0bddb
2023-02-19T16:08:59.775-0800 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2u-freebsd  20 Dec 2019
2023-02-19T16:08:59.775-0800 I CONTROL  [initandlisten] allocator: system
2023-02-19T16:08:59.775-0800 I CONTROL  [initandlisten] modules: none
2023-02-19T16:08:59.775-0800 I CONTROL  [initandlisten] build environment:
2023-02-19T16:08:59.775-0800 I CONTROL  [initandlisten]     distarch: x86_64
2023-02-19T16:08:59.775-0800 I CONTROL  [initandlisten]     target_arch: x86_64
2023-02-19T16:08:59.775-0800 I CONTROL  [initandlisten] options: { net: { bindIp: "127.0.0.1", port: 27117, unixDomainSocket: { pathPrefix: "/usr/local/UniFi/run" } }, processManagement: { pidFilePath: "/usr/local/UniFi/run/mongod.pid" }, storage: { dbPath: "/usr/local/UniFi/data/db" }, systemLog: { destination: "file", logAppend: true, logRotate: "reopen", path: "/usr/local/UniFi/logs/mongod.log" } }
2023-02-19T16:08:59.775-0800 I -        [initandlisten] Detected data files in /usr/local/UniFi/data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2023-02-19T16:08:59.779-0800 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=2495M,cache_overflow=(file_max=0M),session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),compatibility=(release="3.0",require_max="3.0"),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2023-02-19T16:09:00.356-0800 E STORAGE  [initandlisten] WiredTiger error (-31803) [1676851740:356689][86916:0x807c16000], file:WiredTiger.wt, connection: __wt_turtle_read, 336: WiredTiger.turtle: fatal turtle file read error: WT_NOTFOUND: item not found Raw: [1676851740:356689][86916:0x807c16000], file:WiredTiger.wt, connection: __wt_turtle_read, 336: WiredTiger.turtle: fatal turtle file read error: WT_NOTFOUND: item not found
2023-02-19T16:09:00.356-0800 E STORAGE  [initandlisten] WiredTiger error (-31804) [1676851740:356770][86916:0x807c16000], file:WiredTiger.wt, connection: __wt_panic, 523: the process must exit and restart: WT_PANIC: WiredTiger library panic Raw: [1676851740:356770][86916:0x807c16000], file:WiredTiger.wt, connection: __wt_panic, 523: the process must exit and restart: WT_PANIC: WiredTiger library panic
2023-02-19T16:09:00.356-0800 F -        [initandlisten] Fatal Assertion 50853 at src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp 420
2023-02-19T16:09:00.356-0800 F -        [initandlisten] \n\n***aborting after fassert() failure\n\n
2023-02-19T16:09:00.376-0800 F -        [initandlisten] Got signal: 6 (Abort trap).

 0x2ef8c16 0x2ef84db 0x806c37d70
----- BEGIN BACKTRACE -----
{"backtrace":[{"b":"1021000","o":"1ED7C16","s":"_ZN5mongo15printStackTraceERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEE"},{"b":"1021000","o":"1ED74DB","s":"_ZN5mongo29reportOutOfMemoryErrorAndExitEv"},{"b":"806C29000","o":"ED70","s":"pthread_sigmask"}],"processInfo":{ "mongodbVersion" : "3.6.21", "gitVersion" : "1cd2db51dce4b16f4bc97a75056269df0dc0bddb", "compiledModules" : [], "uname" : { "sysname" : "FreeBSD", "release" : "11.3-STABLE", "version" : "FreeBSD 11.3-STABLE #243 abf8cba50ce(RELENG_2_4_5): Tue Jun  2 17:53:37 EDT 2020     root@buildbot1-nyi.netgate.com:/build/ce-crossbuild-245/obj/amd64/YNx4Qq3j/build/ce-crossbuild-245/sources/FreeBSD-src/sys/pfSense", "machine" : "amd64" } }}
 mongod(_ZN5mongo15printStackTraceERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEE+0x36) [0x2ef8c16]
 mongod(_ZN5mongo29reportOutOfMemoryErrorAndExitEv+0x15B) [0x2ef84db]
 libthr.so.3(pthread_sigmask+0x530) [0x806c37d70]
-----  END BACKTRACE  -----

Any suggestions for what I might do to resolve this?

tong2x commented 1 year ago

read error...

try rebooting and retrying again if no avail

try a clean install (backup your files first)

btw it would help if you could tell us more details on your setup PFsense version scrip version(or which script you used)

dvdp commented 1 year ago

pfSense upgrade to 2.7.0 maybe? Please check https://github.com/unofficial-unifi/unifi-pfsense/issues/320

douglasg14b commented 1 year ago

This was to 2.4 I think. Turns out the controller has been dead for the last 7 months 😬

What files are good to backup for this? The entire unifi folder, or? I'm a dummy and never exported/backed up the controller config for my network, and I have a LOT of config there for switch ports, VLANs and what not

PFSense: 2.4.5-RELEASE-p1 Script Version: Unknown, installed 2020-12-27

wyrickre commented 1 year ago

You could try: $ mongod --dbpath /usr/local/UniFi/data/db --repair I find I have to do that after a power failure.

tong2x commented 11 months ago

closing no more updates