Reply
Highlighted
Emerging Member
Posts: 99
Registered: ‎01-08-2017
Kudos: 4
Solutions: 5

Unifi Controller and free disk space issue

I have noticed that both the Linux and Windows variant of Unifi Controller doesnt starts with only 2.7 GB free disk space. This is annoying. Why is that? I made about 4GB free space and it started however it is not always possible.

 

Any fix on it, or whats the deal here?

Established Member
Posts: 1,598
Registered: ‎10-11-2009
Kudos: 327
Solutions: 6

Re: Unifi Controller and free disk space issue

It seems like every 6months I have to add 20GB of disk space to mine, its nuts.  Adjusting data retention settings and hitting compact does nothing to save on the 100GB of ace_stat files in the system. It goes back over a year and retention is set to 180days for the longest ones I'm keeping. The prune script gives me an error that it can't find the directory \data\db, I don't see how it the script to give it the full path to that location yet but I haven't messed with that in a while.  This ongoing disk space issue is getting old!

Senior Member
Posts: 10,589
Registered: ‎08-04-2017
Kudos: 1719
Solutions: 518

Re: Unifi Controller and free disk space issue

Hello @russman,

 

What OS are you running?

Could you post the output of the error?

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
Established Member
Posts: 1,598
Registered: ‎10-11-2009
Kudos: 327
Solutions: 6

Re: Unifi Controller and free disk space issue

Its on our last Server 2012 R2 our other unifi boxes are on Ubuntu.
I'm trying to find binaries for 2.4.14 but the oldest I can find is older 3.0 version. I'm not even sure the version of monogodb this server is on since the exe doesn't include a version and the command to ID it gives me this:

C:\Users\administrator.SYNCWAVE\Ubiquiti UniFi\bin>mongod.exe --verson
error command line: unknown option verson

 

The error running the script is:

c:\prune>mongod.exe --port 27117 < mongo_prune_js.js
Sat Sep 08 15:08:01.005 [initandlisten] MongoDB starting : pid=8180 port=27117 dbpath=\data\db\ 64-bit host=SW-UNIFI
Sat Sep 08 15:08:01.005 [initandlisten] db version v2.4.14
Sat Sep 08 15:08:01.005 [initandlisten] git version: 05bebf9ab15511a71bfbded684bb226014c0a553
Sat Sep 08 15:08:01.020 [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49
Sat Sep 08 15:08:01.020 [initandlisten] allocator: system
Sat Sep 08 15:08:01.020 [initandlisten] options: { port: 27117 }
Sat Sep 08 15:08:01.036 [initandlisten] exception in initAndListen: 10296
*********************************************************************
 ERROR: dbpath (\data\db\) does not exist.
 Create this directory or give existing directory in --dbpath.
 See http://dochub.mongodb.org/core/startingandstoppingmongo
*********************************************************************
, terminating
Sat Sep 08 15:08:01.052 dbexit:
Sat Sep 08 15:08:01.052 [initandlisten] shutdown: going to close listening sockets...
Sat Sep 08 15:08:01.052 [initandlisten] shutdown: going to flush diaglog...
Sat Sep 08 15:08:01.052 [initandlisten] shutdown: going to close sockets...
Sat Sep 08 15:08:01.052 [initandlisten] shutdown: waiting for fs preallocator...
Sat Sep 08 15:08:01.067 [initandlisten] shutdown: lock for final commit...
Sat Sep 08 15:08:01.067 [initandlisten] shutdown: final commit...
Sat Sep 08 15:08:01.067 [initandlisten] shutdown: closing all files...
Sat Sep 08 15:08:01.067 [initandlisten] closeAllFiles() finished
Sat Sep 08 15:08:01.067 dbexit: really exiting now

Senior Member
Posts: 10,589
Registered: ‎08-04-2017
Kudos: 1719
Solutions: 518

Re: Unifi Controller and free disk space issue

Hello @russman,

 

Did you download the right script?

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
Established Member
Posts: 1,598
Registered: ‎10-11-2009
Kudos: 327
Solutions: 6

Re: Unifi Controller and free disk space issue


@AmazedMender16 wrote:

Hello @russman,

 

Did you download the right script?

 

 

Regards,

Glenn R.


Yes, as I alluded to it's probably related to not having all the binaries but I haven't found a download for them pre version 3.0.

Senior Member
Posts: 10,589
Registered: ‎08-04-2017
Kudos: 1719
Solutions: 518

Re: Unifi Controller and free disk space issue

Hello @russman,

 

You can download the older versions from here.

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
Established Member
Posts: 1,598
Registered: ‎10-11-2009
Kudos: 327
Solutions: 6

Re: Unifi Controller and free disk space issue

That link helped, they didn't have 2.4.14 but a newer version seemed to help getting other commands to work.  However, it still didn't like the dbpath and gave me the same error. 

 

I used the --dpath option and now it doesn't give me an error, one line item says:

Mon Sep 10 11:59:56.641 [initandlisten] exception in initAndListen: 13627 Unable to create/open lock file: C:\...\Ubiquiti UniFi\data\db\mongod.lock The process cannot access the file because it is being used by another process.. Is a mongod instance already running?, terminating

 

Thats understandable since the database is in use, but the instructions specifically say to do this action with the controller running.

 

Senior Member
Posts: 10,589
Registered: ‎08-04-2017
Kudos: 1719
Solutions: 518

Re: Unifi Controller and free disk space issue

Hello @russman,

 

Did you run it as administrator?

I personally never ran it on windows...

 

 

Regards,
Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
Reply