Jump to content
linuxserver.io

[Support] Linuxserver.io - Unifi

815 posts in this topic Last Reply

Recommended Posts

linuxserver_medium.png

 

Application Name: Unifi

Application Site: https://www.ubnt.com/download/unifi

Docker Hub: https://hub.docker.com/r/linuxserver/unifi/

Github: https://github.com/linuxserver/docker-unifi

 

Please post any questions/issues relating to this docker you have in this thread.

 

If you are not using Unraid (and you should be!) then please do not post here, instead head to linuxserver.io to see how to get support.

Edited by linuxserver.io
  • Upvote 1

Share this post


Link to post

Has anyone gotten this to work? The docker appears to start fine, but I can't ever get to the webUI.

The log just repeats

 

Nov 14 20:17:03 03a5abfe3858 /USR/SBIN/CRON[3388]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)

 

every hour.

Share this post


Link to post

Has anyone gotten this to work? The docker appears to start fine, but I can't ever get to the webUI.

The log just repeats

 

Nov 14 20:17:03 03a5abfe3858 /USR/SBIN/CRON[3388]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)

 

every hour.

 

I don't use this as I don't have a Ubiquiti, but have just installed it from scracth and got through the webconfig.  The cron job is just something that runs every hour in the background and isn't part of the problem.

 

It does run on HTTPS which I've found occasionally causes problems accessing the config pages with other dockers, maybe try another browser?

 

Oh, once the container is installed it then has to install the app, so don't restart or stop it during that period, check the logs for progress.

 

This was a fresh install right? 

 

Maybe try deleting the container and the corresponding appdata folder and install again.  If it doesn't work then, post the logs here and we'll take a look.  :)

Share this post


Link to post

I havent had this Unifi Docker up and running as I've only just seen it but the other Unifi Docker didn't appear to like to work when its data was on the array.  If I had it running from cache it seemed to be fine. 

Share this post


Link to post

Had a fresh try at this tonight.

 

So it runs with a certain user/group that can be set with -e PUID and -e PGID but I'm not sure how youre meant to do this through the UI.

 

I can see in the server.log the following error:

 

[2015-11-16 18:06:06,592] <db-server> ERROR system - [exec] error, rc=1, output=all output going to: /usr/lib/unifi/logs/mongod.logcan't open [/usr/lib/unifi/logs/mongod.log] for log file: errno:13 Permission deniedBad logpath value: "/usr/lib/unifi/logs/mongod.log"; terminating.

[2015-11-16 18:06:06,593] <db-server> INFO  db    - DbServer stopped

 

i.e. Permission denied.

Share this post


Link to post

Had a fresh try at this tonight.

 

So it runs with a certain user/group that can be set with -e PUID and -e PGID but I'm not sure how youre meant to do this through the UI.

 

I can see in the server.log the following error:

 

[2015-11-16 18:06:06,592] <db-server> ERROR system - [exec] error, rc=1, output=all output going to: /usr/lib/unifi/logs/mongod.logcan't open [/usr/lib/unifi/logs/mongod.log] for log file: errno:13 Permission deniedBad logpath value: "/usr/lib/unifi/logs/mongod.log"; terminating.

[2015-11-16 18:06:06,593] <db-server> INFO  db    - DbServer stopped

 

i.e. Permission denied.

 

the internal apps run as user abc irrrespective of any setting of uid and gid in the docker run (or unraid template).

 

the various files and folders concerned are owned by abc, when the uid and gid become relevant is when saving files externally of the docker.

 

are you trying to move from a previous version to this version ?

Share this post


Link to post

I had a look at the logs a bit better and I'm wrong on the permissions.

 

So I have been using pducharme/unifi:latest.  I stopped this running.

 

I then created a new container of linuxserver/unifi:latest (all using the unRAID UI) and pointed at a new config folder on my cache drive.  So basically as if I've never used unifi before.

 

I have additional errors in my log that relate to addresses in use.  I have checked and there is no port conflicts with other containers (on the host side).  I can't think that the old container is causing an issue as it is stopped - I could be wrong though?

Share this post


Link to post

does this work? it seems to use a lot of ports that overlap with my other apps, can I move the ports to something else?

Share this post


Link to post

I rebooted with both containers off and then turned just this one on.  Is there some sort of port reserving going on within docker?

Share this post


Link to post

I rebooted with both containers off and then turned just this one on.  Is there some sort of port reserving going on within docker?

 

no idea, but just stopping a container does not release the port, if one or either dockers fighting for the same port is in host mode for networking, then one or neither of the containers will be able to use the port, but not both.

 

edit, should put my glasses on, thought that said reversing....

 

yes ports are reservered, whether it's an unraid specific thing i'm not sure.

 

 

Share this post


Link to post

if both containers are in bridge mode and the ports are editable the second container will fail to start with a warning the port is already allocated.

Share this post


Link to post

Got it!

 

I knew two couldn't use the same port but couldn't work out what was using it given it was stopped.

 

All up and running with your containers now :)

 

Thanks!

Share this post


Link to post

got this installed moved some ports but it can't find my device

 

i guess the ports for the devices to be seen are immutable.

 

change the ports on the other dockers where you have a clash.

Share this post


Link to post

got this installed moved some ports but it can't find my device

 

i guess the ports for the devices to be seen are immutable.

 

change the ports on the other dockers where you have a clash.

 

You can change the ports the Docker uses internally by editing the system.properties file in the docker config directory.

Share this post


Link to post

kept the standard ports, and still can't find it. maybe because the docker runs in bridge mode

 

It's not related to bridge mode. The AP doesn't know where the controller is unless you have your DHCP server specifically set up to issue the controller address as an option in the lease. Normally you would use the UniFi discovery tool to find the AP and tell it the IP of the controller, but the UniFi dockers don't have the discovery tool as it is a separate app.

 

To get the AP to show up in the controller so it can be adopted and provisioned, do the following:

 

Determine the IP the AP was leased

SSH to that IP

Login as ubnt / ubnt

mca-cli

set-inform http://address:port/inform (where address is IP of controller and port is the port you are using for inform, default is 8080)

 

Once you run the set inform command it should show in the controller. As soon as you click adopt you need to run the set inform command a second time on the AP.

 

EDIT: Syntax correction

  • Like 2
  • Upvote 2

Share this post


Link to post

This docker is pretty broken.  Is anyone in the Linuxserver.io group actually using it?

 

I migrated to this docker today from the existing pducharme docker.  I was unable to successfully migrate and keep the existing configuration.  I eventually had to wipe the existing and start from scratch.  No biggie really, as I wouldn't expect to always be able to migrate an existing docker config anyway.

 

As for how the docker is broken, there are 2 major issues.

 

1.  If the docker is restarted, it will not come back online.  If you watch the logs, it will just sit at "We are now refreshing packages from apt repositorys, this *may* take a while" indefinitely.  The only way to get it running again is to "edit and save" the docker (without changing anything) causing it to rebuild the container which will cause it to actually refresh the packages from the apt repository and rebuild the container.

 

2.  The much bigger issue is after the container is rebuilt, you connect to the webGUI all configuration is lost and you are presented with the UniFi Controller Setup Page again.

 

The one thing I haven't tried is if it will start successfully after a full server reboot.

 

If you need any further information, or testing (since I actively use UniFi Controller), please let me know.

Share this post


Link to post

This docker is pretty broken.  Is anyone in the Linuxserver.io group actually using it?

 

I migrated to this docker today from the existing pducharme docker.  I was unable to successfully migrate and keep the existing configuration.  I eventually had to wipe the existing and start from scratch.  No biggie really, as I wouldn't expect to always be able to migrate an existing docker config anyway.

 

As for how the docker is broken, there are 2 major issues.

 

1.  If the docker is restarted, it will not come back online.  If you watch the logs, it will just sit at "We are now refreshing packages from apt repositorys, this *may* take a while" indefinitely.  The only way to get it running again is to "edit and save" the docker (without changing anything) causing it to rebuild the container which will cause it to actually refresh the packages from the apt repository and rebuild the container.

 

2.  The much bigger issue is after the container is rebuilt, you connect to the webGUI all configuration is lost and you are presented with the UniFi Controller Setup Page again.

 

The one thing I haven't tried is if it will start successfully after a full server reboot.

 

If you need any further information, or testing (since I actively use UniFi Controller), please let me know.

 

i guess

 

"We are now refreshing packages from apt repositorys, this *may* take a while"

 

we have no way of knowing if your internet speed is terrible or you are downloading anything.

 

but just restarting a container mid update and expecting everything to work and then screaming that the container is broken.....

 

 

Share this post


Link to post

I just done a test install of this docker (I don't use unifi products), here is my log output:

 

-----------------------------------
_ _ _
| |___| (_) ___
| / __| | |/ _ \ 
| \__ \ | | (_) |
|_|___/ |_|\___/
|_|

Brought to you by linuxserver.io
-----------------------------------
GID/UID
-----------------------------------
User uid: 99
User gid: 100
-----------------------------------

We are now refreshing packages from apt repositorys, this *may* take a while

-----------------------------------
_ _ _
| |___| (_) ___
| / __| | |/ _ \ 
| \__ \ | | (_) |
|_|___/ |_|\___/
|_|

Brought to you by linuxserver.io
-----------------------------------
GID/UID
-----------------------------------
User uid: 99
User gid: 100
-----------------------------------

We are now refreshing packages from apt repositorys, this *may* take a while
(Reading database ... 15447 files and directories currently installed.)
Preparing to unpack .../unifi_4.7.6-6357_all.deb ...
Unpacking unifi (4.7.6-6357) over (4.7.5-6348) ...
Removing any system startup links for /etc/init.d/unifi ...
/etc/rc0.d/K08unifi
/etc/rc1.d/K08unifi
/etc/rc2.d/S92unifi
/etc/rc3.d/S92unifi
/etc/rc4.d/S92unifi
/etc/rc5.d/S92unifi
/etc/rc6.d/K08unifi
Processing triggers for ureadahead (0.100.0-16) ...
Setting up unifi (4.7.6-6357) ...
Adding system startup for /etc/init.d/unifi ...
/etc/rc0.d/K08unifi -> ../init.d/unifi
/etc/rc1.d/K08unifi -> ../init.d/unifi
/etc/rc6.d/K08unifi -> ../init.d/unifi
/etc/rc2.d/S92unifi -> ../init.d/unifi
/etc/rc3.d/S92unifi -> ../init.d/unifi
/etc/rc4.d/S92unifi -> ../init.d/unifi
/etc/rc5.d/S92unifi -> ../init.d/unifi
* Starting Ubiquiti UniFi Controller unifi
...done.
Nov 17 23:36:09 d7d25b3354a3 syslog-ng[223]: syslog-ng starting up; version='3.5.3'

 

and I can get to the Unifi wizard.

Share this post


Link to post

i guess

 

"We are now refreshing packages from apt repositorys, this *may* take a while"

 

we have no way of knowing if your internet speed is terrible or you are downloading anything.

 

but just restarting a container mid update and expecting everything to work and then screaming that the container is broken.....

 

When it's hung it will sit there forever, I don't think that has anything to do with my Internet speed.  But if you think it's pertinent my connection is 60/4.  When it does in fact check and update it takes roughly 60 seconds or so.

 

I'm not "screaming that it's broken" and if it came off that way I apologize.  That said, if I fully configure UniFi and have it operational, then stop the docker and start the docker (no different than what happens during a reboot of the server) IF it does in fact restart successfully, the config is lost and you are back at the UniFi Setup Wizard.  Does that not sound broken to you?

Share this post


Link to post

I just done a test install of this docker (I don't use unifi products), here is my log output:

 

-----------------------------------
_ _ _
| |___| (_) ___
| / __| | |/ _ \ 
| \__ \ | | (_) |
|_|___/ |_|\___/
|_|

Brought to you by linuxserver.io
-----------------------------------
GID/UID
-----------------------------------
User uid: 99
User gid: 100
-----------------------------------

We are now refreshing packages from apt repositorys, this *may* take a while

-----------------------------------
_ _ _
| |___| (_) ___
| / __| | |/ _ \ 
| \__ \ | | (_) |
|_|___/ |_|\___/
|_|

Brought to you by linuxserver.io
-----------------------------------
GID/UID
-----------------------------------
User uid: 99
User gid: 100
-----------------------------------

We are now refreshing packages from apt repositorys, this *may* take a while
(Reading database ... 15447 files and directories currently installed.)
Preparing to unpack .../unifi_4.7.6-6357_all.deb ...
Unpacking unifi (4.7.6-6357) over (4.7.5-6348) ...
Removing any system startup links for /etc/init.d/unifi ...
/etc/rc0.d/K08unifi
/etc/rc1.d/K08unifi
/etc/rc2.d/S92unifi
/etc/rc3.d/S92unifi
/etc/rc4.d/S92unifi
/etc/rc5.d/S92unifi
/etc/rc6.d/K08unifi
Processing triggers for ureadahead (0.100.0-16) ...
Setting up unifi (4.7.6-6357) ...
Adding system startup for /etc/init.d/unifi ...
/etc/rc0.d/K08unifi -> ../init.d/unifi
/etc/rc1.d/K08unifi -> ../init.d/unifi
/etc/rc6.d/K08unifi -> ../init.d/unifi
/etc/rc2.d/S92unifi -> ../init.d/unifi
/etc/rc3.d/S92unifi -> ../init.d/unifi
/etc/rc4.d/S92unifi -> ../init.d/unifi
/etc/rc5.d/S92unifi -> ../init.d/unifi
* Starting Ubiquiti UniFi Controller unifi
...done.
Nov 17 23:36:09 d7d25b3354a3 syslog-ng[223]: syslog-ng starting up; version='3.5.3'

 

and I can get to the Unifi wizard.

 

I think you misunderstood my post.  I can get it to install and start.  I can configure the controller, adopt my AP's, etc and all is well.  But as soon as the container is restarted it will no longer run.  The only way to get it to run is to "edit and save" the container without changing anything.  Once the container rebuilds it will run again, but when you connect to the webGUI the config is lost and you are back to the UniFi Setup Wizard.....

Share this post


Link to post

there was an update to the unifi program which broke the symlinks to /config folders and temporarily stored the data inside the container.

 

pushing a fix that checks the symlinks are pointing to the right place during startup routine and remakes them if they aren't.

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now