Package Details: unifi 9.0.114-1

Git Clone URL: https://aur.archlinux.org/unifi.git (read-only, click to copy)
Package Base: unifi
Description: Centralized management system for Ubiquiti UniFi AP
Upstream URL: https://unifi-network.ui.com
Licenses: custom
Conflicts: tomcat-native
Submitter: seblu
Maintainer: freswa
Last Packager: freswa
Votes: 70
Popularity: 0.61
First Submitted: 2017-08-22 01:31 (UTC)
Last Updated: 2025-02-04 12:05 (UTC)

Dependencies (3)

Required by (0)

Sources (6)

Pinned Comments

freswa commented on 2019-10-30 11:50 (UTC)

We are on Stable with this Package. Please flag out-of-date only if the Version provided with this package does not match the version under "Stable" in this link: https://help.ubnt.com/hc/en-us/articles/360008240754#1

Latest Comments

« First ‹ Previous 1 .. 16 17 18 19 20 21 22 23 Next › Last »

Evils commented on 2018-01-06 19:00 (UTC)

Start mongo with --repair in addition to the dbpath to repair your mongodb instace

yochaigal commented on 2018-01-06 16:04 (UTC)

@Termi I think you made a typo!

Where you write /usr/lib/unifi/bin/unifi it should be /usr/lib/unifi/bin/mongod

Thermi commented on 2018-01-06 10:40 (UTC) (edited on 2018-01-06 10:41 (UTC) by Thermi)

To fix: Do all of this as root.

1) Check logs in /var/log/unifi/ for clear errors
2) stop unifi service (systemctl stop unifi)
3) Potentially recover the crashed mongodb database (was crashed in my case) by starting it once from cmdline with a custom data directory (mongod --dbpath /var/lib/unifi/data/db). Then check the output of it to see if the DB was recovered. If it was, continue. If there was no problem, continue.
4) Connect to the database (mongo mongodb://127.0.0.1:27017( and run the following command:
db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } )

That should give you the output
{ "ok" : 1 }

5) Stop the mongodb database
6) Remove the file /usr/lib/unifi/bin/unifi (rm /usr/lib/unifi/bin/unifi)
7) Create the text file /usr/lib/unifi/bin/unifi with the following content

#!/bin/bash  
exec /usr/bin/mongod ${*//--nohttpinterface/}

7) Change owner:group and permissions of /usr/lib/unifi/bin/unifi to root:root and 755
8) Change owner:group of /var/lib/unifi/ to unifi:unifi
9) start unifi again (systemctl start unifi)
10) Check unifi daemon logs in /var/log/unifi/server.log for errors

If that worked, be happy. If it didn't, comment the problem here.

Thanks @treitmayr and @Spider.007

mihanson commented on 2018-01-06 06:08 (UTC)

I followed treitmayr comments on 2017-12-31 09:28 with a fresh install and was able to get my UniFi Switch US-48 set up successfully. My MongoDB version is 3.6.1. After creating an account at https://account.ubnt.com, I can now connect/configure the switch at https://myIPaddress:8443

Thanks so much community! I was lost before reading through these comments!

yochaigal commented on 2018-01-06 00:36 (UTC)

Nevermind, I fixed it. I reinstalled and got a permissions differ error. Fixed them. It works!

yochaigal commented on 2018-01-05 20:31 (UTC) (edited on 2018-01-05 20:40 (UTC) by yochaigal)

OK, so: I downgraded mongodb and wiredtiger to the veresions @Spider.007 specified, then I stopped unifi, started the mongodb using @treitmayr's command, then connected to it and set the featurecompatibilityversion to 3.4 as directed. I then created the shell script at /usr/lib/unifi/bin/mongod which removes the illegal optoin, marked it as executable and chowned to unifi user.

I then upgraded the packages to the newer versions and started Unifi. I now get

[internal] unable to list files under /usr/lib/unifi/data/db/local

Obviously, those files exist. They are currently owned by both unifi and root.

Any ideas what I've missed?

Spider.007 commented on 2017-12-31 12:57 (UTC) (edited on 2017-12-31 13:06 (UTC) by Spider.007)

@treitmayr what you suggest probably works for new installs, not existing ones. I fixed mine by following the upgrade procedure; like @abra says - downgrade to mongodb-3.4.9-1 and wiredtiger-2.9.3-1 and upgrade the unifi database instance like this:

$ mongo mongodb://127.0.0.1:27117
> db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } )
{ "ok" : 1 }

Now you can upgrade wiredtiger and mongodb to the latest versions - with the fix of a custom wrapper to remove the nohttpinterface parameter it will work

m01 commented on 2017-12-31 12:53 (UTC)

With a clean installation, I kept on getting this error:

[2017-12-31 12:43:54,108] <db-server> ERROR system - [exec] error, rc=2
[2017-12-31 12:43:54,109] <db-server> INFO  db     - DbServer stopped

.. until I tried @treitmayr's suggested fix, and restarted unifi. That seemed to do the trick. Unlike @treitmayr, I did not have to start mongod manually as unifi:unifi user/group, it just worked.

yaron commented on 2017-12-31 09:50 (UTC)

Part of the problem is "net.http" option specified in the config file.

I tried running the DB manually and it worked for a while, after several seconds it crashes and I can't figure out why (the log didn't help as I expected).

treitmayr commented on 2017-12-31 09:28 (UTC) (edited on 2017-12-31 10:50 (UTC) by treitmayr)

From what I can tell the main problem is the mongod parameter "--nohttpinterface" which was deprecated before and was removed with MongoDB 3.6, see link.

In our case the mongod process just exits with an error because unifi still invokes MongoDB as shown below:

bin/mongod --dbpath /usr/lib/unifi/data/db --port 27117 --unixSocketPrefix /usr/lib/unifi/run --logappend --logpath /usr/lib/unifi/logs/mongod.log --nohttpinterface --bind_ip 127.0.0.1

My workaround was to replace the mongod link in /usr/lib/unifi/bin with the following tiny script which just removes the now unsupported parameter:

#!/bin/bash  
exec /usr/bin/mongod ${*//--nohttpinterface/}

Strange enough I still had to restart unifi a couple of times after the above change and had to start the mongod process manually once (as unifi:unifi user/group) before MongoDB was willing to cooperate with unifi. But now it works without problems (until the next unifi update where I will have to redo the change).