Reply
Highlighted
New Member
Posts: 16
Registered: ‎01-17-2013
Kudos: 3

Mongod DB keeps restarting

[ Edited ]

I went to add an AP this morning and found that my controller was not working correctly, pages kept timing out and just strange behavior.

 

I went to the server and found that the mongod.exe process would grown exponentially larger till it got to about 900mb and then it would close.

 

I've tried doing a DB repair and that has not fixed the issue.  It's a 32 bit Server 2003 machine but the DB is not particularly large, around 1GB and I've performed regular purges in the past.

 

I do see it saying it needs to upgrade the database to pdfile version 4.5 but it's saying it's on 4.5 ?

 

Tue Nov 14 13:10:10.628 [initandlisten] need to upgrade database local with pdfile version 4.5, new version: 4.5
Tue Nov 14 13:10:10.628 [initandlisten]   starting upgrade
Tue Nov 14 13:10:10.628 [initandlisten]  local repairDatabase local
Tue Nov 14 13:10:10.628 [initandlisten] allocating new ns file C:\Documents and Settings\Administrator\Ubiquiti UniFi\data\db\_tmp_repairDatabase_0\local.ns, filling with zeroes...
Tue Nov 14 13:10:11.222 [FileAllocator] allocating new datafile C:\Documents and Settings\Administrator\Ubiquiti UniFi\data\db\_tmp_repairDatabase_0\local.0, filling with zeroes...
Tue Nov 14 13:10:11.222 [FileAllocator] creating directory C:\Documents and Settings\Administrator\Ubiquiti UniFi\data\db\_tmp_repairDatabase_0\_tmp
Tue Nov 14 13:10:11.222 [FileAllocator] done allocating datafile C:\Documents and Settings\Administrator\Ubiquiti UniFi\data\db\_tmp_repairDatabase_0\local.0, size: 16MB,  took 0.002 secs
Tue Nov 14 13:10:11.253 [initandlisten] finished checking dbs
Tue Nov 14 13:10:11.253 dbexit:
Tue Nov 14 13:10:11.253 [initandlisten] shutdown: going to close listening sockets...
Tue Nov 14 13:10:11.253 [initandlisten] shutdown: going to flush diaglog...
Tue Nov 14 13:10:11.253 [initandlisten] shutdown: going to close sockets...
Tue Nov 14 13:10:11.253 [initandlisten] shutdown: waiting for fs preallocator...
Tue Nov 14 13:10:11.253 [initandlisten] shutdown: closing all files...
Tue Nov 14 13:10:11.253 [initandlisten] closeAllFiles() finished
Tue Nov 14 13:10:11.253 [initandlisten] shutdown: removing fs lock...
Tue Nov 14 13:10:11.253 dbexit: really exiting now

New Member
Posts: 4
Registered: ‎10-02-2017

Re: Mongod DB keeps restarting

I have the same problem... Mongod 3.6.1 and UniFi 5.6.26 .

Can't get it to start.. just stops the mongod..

New Member
Posts: 4
Registered: ‎10-02-2017

Re: Mongod DB keeps restarting

To add some log info when unifi tries to connect:

Seems like unifi sends a termination command to mongod... why ?

 

Mongod.log

2017-12-27T09:05:34.792+0100 I NETWORK [listener] connection accepted from 127.0.0.1:38108 #1 (1 connection now open)
2017-12-27T09:05:34.809+0100 I NETWORK [listener] connection accepted from 127.0.0.1:38110 #2 (2 connections now open)
2017-12-27T09:05:34.811+0100 I COMMAND [conn2] terminating, shutdown command received
2017-12-27T09:05:34.811+0100 I NETWORK [conn2] shutdown: going to close listening sockets...

 

Unifi.log

[2017-12-27 09:05:35,213] <launcher> INFO db - Connecting to mongodb://127.0.0.1:27017
[2017-12-27 09:05:39,023] <db-server> ERROR system - [exec] error, rc=2
[2017-12-27 09:05:39,024] <db-server> INFO db - DbServer stopped
[2017-12-27 09:05:43,044] <db-server> ERROR system - [exec] error, rc=2
[2017-12-27 09:05:43,044] <db-server> INFO db - DbServer stopped

 

New Member
Posts: 4
Registered: ‎10-02-2017

Re: Mongod DB keeps restarting

bump

New Member
Posts: 1
Registered: ‎02-11-2018

Re: Mongod DB keeps restarting

[ Edited ]

I am trying to setup brand new installation on Gentoo server using following installation script for unifi https://data.gpo.zugaina.org/fkmclane/net-wireless/unifi/ while mongodb got installed as default Gentoo package.

 

[ebuild R ] dev-db/mongodb-3.6.2::gentoo USE="ssl tools -debug -kerberos -libressl -mms-agent {-test}" PYTHON_TARGETS="python2_7" 0 KiB

[ebuild R ] net-wireless/unifi-5.6.30::fkmclane 0 KiB Java Enviroment: java -version openjdk version "1.8.0_151" OpenJDK Runtime Environment (IcedTea 3.6.0) (Gentoo icedtea-3.6.0) OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

 

Just like others in the thread I am experiencing mongodb process shutdown as soon as unifi server is started. Unifi is just able to create /usr/lib/unifi/data/system.properties file and nothing more as it is not able to connect to mongodb I noticed by default unifi uses port 21117

 

## local-bound port for DB server

## unifi.db.port=27117

 

while /etc/mongodb.conf sets up database on port 27017

 

net: port: 27017

bindIp: 127.0.0.1

 

and /usr/lib/unifi/data/system.properties has:

system_ip=192.168.101.101

unifi.db.port=27017

unifi.http.port=8081

 

Regardless of which port I do set mongodb shutdowns as soon as unifi process starts. Unifi package also includes following.

/usr/lib64/unifi/bin/mongod

/usr/lib64/unifi/lib/mongo-java-driver-2.14.3.jar

Maybe one of them interferes with the mongodb package?

 

Any pointers appreciated.

New Member
Posts: 1
Registered: 3 weeks ago

Re: Mongod DB keeps restarting

[ Edited ]

I had a problem that I assume is they same as @wmyrda

 

Anyways this was in my server.log:

[2018-06-02 13:06:31,722] <main> WARN  system - reload system.properties failed: file not found
[2018-06-02 13:06:32,416] <launcher> INFO  system - *** Running for the first time, creating identity ***
[2018-06-02 13:06:32,417] <launcher> INFO  system - UUID: 050d53cc-2f35-4391-a01e-d5784ee8a15b
[2018-06-02 13:06:32,417] <launcher> WARN  system - reload system.properties failed: file not found
[2018-06-02 13:06:32,418] <launcher> INFO  system - ======================================================================
[2018-06-02 13:06:32,419] <launcher> INFO  system - UniFi 5.7.23 (build atag_5.7.23_10670 - release) is started
[2018-06-02 13:06:32,419] <launcher> INFO  system - ======================================================================
[2018-06-02 13:06:32,420] <launcher> INFO  system - BASE dir:/home/user/UniFi
[2018-06-02 13:06:32,425] <launcher> INFO  system - Current System IP: 172.17.0.1
[2018-06-02 13:06:32,438] <launcher> INFO  system - Hostname: anor
[2018-06-02 13:06:32,637] <launcher> INFO  system - Valid keystore is missing. Generating one ...
[2018-06-02 13:06:32,638] <launcher> INFO  system - Generating Certificate[UniFi]... please wait...
[2018-06-02 13:06:33,231] <launcher> INFO  system - Certificate[UniFi] generated!
[2018-06-02 13:06:34,142] <launcher> INFO  db     - waiting for db connection...
[2018-06-02 13:06:34,643] <launcher> INFO  db     - Connecting to mongodb://127.0.0.1:27117
[2018-06-02 13:06:35,264] <db-server> ERROR system - [exec] error, rc=2
[2018-06-02 13:06:35,264] <db-server> INFO  db     - DbServer stopped
[2018-06-02 13:06:39,303] <db-server> ERROR system - [exec] error, rc=2
[2018-06-02 13:06:39,304] <db-server> INFO  db     - DbServer stopped

After A LOT of digging a suddenly realized that the mongo-java-driver was version 3.4.2 while I was running version 3.6.3 of the Mongo server.

 

After downgrading the Mongo server to 3.4.15 the webinterface now starts.

New Member
Posts: 4
Registered: ‎06-04-2016
Kudos: 1

Re: Mongod DB keeps restarting

This thread has, I think, the solution to your problem

 

https://community.ubnt.com/t5/UniFi-Wireless/Unifi-controller-on-Ubuntu-18-04/td-p/2331657

 

The controller try to start MongoDB with a parameter that has been removed on version 3.6.

 

Right now the controller can't be used on all Linux distribution with an up-to-date MongoDB.

Emerging Member
Posts: 57
Registered: ‎02-03-2017
Kudos: 7

Re: Mongod DB keeps restarting


Milesteg, I think that is also mentioned in the release notes for 5.8.20.

Karl

New Member
Posts: 4
Registered: ‎10-02-2017

Re: Mongod DB keeps restarting

Thanks 

New Member
Posts: 4
Registered: ‎06-04-2016
Kudos: 1

Re: Mongod DB keeps restarting

[ Edited ]

@ktat1994Yep that has been added to the release notes of the 5.8.20, and 5.6.39 version.

 

But for me that was too late, I have had the problem at work with an Ubuntu 18.04 and at home with a Fedora 28.

Emerging Member
Posts: 57
Registered: ‎02-03-2017
Kudos: 7

Re: Mongod DB keeps restarting

 

Milesteg, 

   Sorry to hear about that. As I was running on a Cloud Key exclusively until recently, I never bumped into it. As soon as I set up my own controller on Rasbian (first 5.7.28 and then 5.8.20) it was already there in the release notes. 
I was glad for that, as I had enough issues diagnosing why Spotipo wouldn't run (I did get it to run though).

Karl 

Reply