Reply
New Member
Posts: 30
Registered: ‎05-27-2015
Kudos: 2
Solutions: 1
Accepted Solution

MongoDB - ERROR: listen(): bind() failed errno:99 (Unifi 5.4.11)

[ Edited ]

Hello,

I just upgraded to 5.4.11 and now the controller won't start.

 

It seems to be an error with MongoDB not being able to bind to the listening address.  I have tried a complete server reboot and the same thing happens.

 

SERVER LOG

[2017-03-01 10:36:15,964] <launcher> INFO  system - ======================================================================
[2017-03-01 10:36:15,965] <launcher> INFO  system - UniFi 5.4.11 (build atag_5.4.11_9184 - release) is started
[2017-03-01 10:36:15,965] <launcher> INFO  system - ======================================================================
[2017-03-01 10:36:15,970] <launcher> INFO  system - BASE dir:/usr/lib/unifi
[2017-03-01 10:36:15,977] <launcher> INFO  system - Current System IP: xx.xx.xx.xx
[2017-03-01 10:36:15,977] <launcher> INFO  system - Hostname: **
[2017-03-01 10:36:16,113] <launcher> INFO  db     - waiting for db connection...
[2017-03-01 10:36:16,614] <launcher> INFO  db     - Connecting to mongodb://127.0.0.1:27117
[2017-03-01 10:36:17,478] <db-server> ERROR system - [exec] error, rc=48
[2017-03-01 10:36:17,478] <db-server> INFO  db     - DbServer stopped
[2017-03-01 10:36:21,614] <db-server> ERROR system - [exec] error, rc=48
[2017-03-01 10:36:21,615] <db-server> INFO  db     - DbServer stopped
[2017-03-01 10:36:25,744] <db-server> ERROR system - [exec] error, rc=48
[2017-03-01 10:36:25,745] <db-server> INFO  db     - DbServer stopped

 

MongoDB.log

***** SERVER RESTARTED *****

Wed Mar  1 10:36:21.534 [initandlisten] MongoDB starting : pid=8755 port=27117 dbpath=/usr/lib/unifi/data/db 64-bit host=**
Wed Mar  1 10:36:21.534 [initandlisten] db version v2.4.14
Wed Mar  1 10:36:21.534 [initandlisten] git version: 05bebf9ab15511a71bfbded684bb226014c0a553
Wed Mar  1 10:36:21.534 [initandlisten] build info: Linux ip-x-x-x-x 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
Wed Mar  1 10:36:21.534 [initandlisten] allocator: tcmalloc
Wed Mar  1 10:36:21.534 [initandlisten] options: { bind_ip: "127.0.0.1", dbpath: "/usr/lib/unifi/data/db", logappend: true, logpath: "logs/mongod.log", nohttpinterface: true, port: 27
117 }
Wed Mar  1 10:36:21.536 [initandlisten] journal dir=/usr/lib/unifi/data/db/journal
Wed Mar  1 10:36:21.536 [initandlisten] recover : no journal files present, no recovery needed
Wed Mar  1 10:36:21.607 [initandlisten] ERROR: listen(): bind() failed errno:99 Cannot assign requested address for socket: 127.0.0.1:27117
Wed Mar  1 10:36:21.607 [initandlisten] now exiting
Wed Mar  1 10:36:21.607 dbexit:
Wed Mar  1 10:36:21.607 [initandlisten] shutdown: going to close listening sockets...
Wed Mar  1 10:36:21.607 [initandlisten] shutdown: going to flush diaglog...
Wed Mar  1 10:36:21.607 [initandlisten] shutdown: going to close sockets...
Wed Mar  1 10:36:21.607 [initandlisten] shutdown: waiting for fs preallocator...
Wed Mar  1 10:36:21.607 [initandlisten] shutdown: lock for final commit...
Wed Mar  1 10:36:21.607 [initandlisten] shutdown: final commit...
Wed Mar  1 10:36:21.610 [initandlisten] shutdown: closing all files...
Wed Mar  1 10:36:21.610 [initandlisten] closeAllFiles() finished
Wed Mar  1 10:36:21.610 [initandlisten] journalCleanup...
Wed Mar  1 10:36:21.610 [initandlisten] removeJournalFiles
Wed Mar  1 10:36:21.611 [initandlisten] shutdown: removing fs lock...
Wed Mar  1 10:36:21.611 dbexit: really exiting now

The log entry from MongoDB just keeps repeating itself... server restarted, cannot bind.

 

I checked port 27117 and made sure nothing is running on that port.

 

This all happened after I did an apt-get upgrade and upgraded to Unifi 5.4.11

 

Any suggestions on how to recover from this error and get MongoDB to start working again?

 

Thanks in advance for any help!

 


Accepted Solutions
New Member
Posts: 30
Registered: ‎05-27-2015
Kudos: 2
Solutions: 1

Re: MongoDB - ERROR: listen(): bind() failed errno:99 (Unifi 5.4.11)

Well, after much googling I think that I figured it out... hopefully this will help someone in the future.

 

The issue was that the loopback interface (lo) was not up.  I found this out by trying to ping 127.0.0.1 with no response.

 

Unfortunately, a simple "ifup lo" wouldn't work, so I went through the following commands:

 

sudo apt-get update
sudo dpkg --configure -a
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo reboot now

 

And voila... after a long startup period, everything seems to be operating normally.

 

Hope this helps someone in the future.

View solution in original post


All Replies
New Member
Posts: 30
Registered: ‎05-27-2015
Kudos: 2
Solutions: 1

Re: MongoDB - ERROR: listen(): bind() failed errno:99 (Unifi 5.4.11)

Well, after much googling I think that I figured it out... hopefully this will help someone in the future.

 

The issue was that the loopback interface (lo) was not up.  I found this out by trying to ping 127.0.0.1 with no response.

 

Unfortunately, a simple "ifup lo" wouldn't work, so I went through the following commands:

 

sudo apt-get update
sudo dpkg --configure -a
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo reboot now

 

And voila... after a long startup period, everything seems to be operating normally.

 

Hope this helps someone in the future.

Emerging Member
Posts: 62
Registered: ‎06-24-2016
Kudos: 19

Re: MongoDB - ERROR: listen(): bind() failed errno:99 (Unifi 5.4.11)

This just helped me immensely - I could'nt figure out what was amiss until I saw this.

 

Indeed, I had the identical issue, I could not ping loopback!

 

Only difference was that I required the "-f" to force the upgrades, but otherwise, your description of the fix was dead on!

Reply