goofball222/unifi

Existing Devices Not Adopted on New Server

ren-del opened this issue · 6 comments

Distributor ID: Debian
Description: Debian GNU/Linux 9.13 (stretch)
Release: 9.13
Codename: stretch

Docker version 19.03.15, build 99e3ed8919

Issue:
I had to recently migrate over to a new system and ran rsync to mirror old docker files and docker-compose files into a new system with the same IP address and then pulled a new image and rebuilt the dockers. All settings are there but the switch and AP that I have are not adopted. I have docker-compose set for separate mongo and unifi containers.

Docker-Compose:
version: '3'

services:
mongo:
image: mongo
container_name: unifidb
restart: unless-stopped
volumes:
- /docker/mongo/data/db:/data/db

unifi:
image: goofball222/unifi
container_name: unifi
restart: unless-stopped
links:
- mongo
ports:
- 3478:3478/udp
- 8080:8080
- 8443:8443
- 8880:8880
- 8843:8843
- 6789:6789
- 10001:10001/udp
volumes:
- /etc/localtime:/etc/localtime:ro
- /docker/unifi/cert:/usr/lib/unifi/cert
- /docker/unifi/data:/usr/lib/unifi/data
- /docker/unifi/logs:/usr/lib/unifi/logs
environment:
- DB_MONGO_LOCAL=false
- DB_MONGO_URI=mongodb://mongo:27017/unifi
- STATDB_MONGO_URI=mongodb://mongo:27017/unifi_stat
- TZ=America/New_York
- UNIFI_DB_NAME=unifi

Is the UniFi controller interface accessible on the new server? Are there any errors in the container logs for either the mongo or unifi service that might indicate what the issue is? As long as the Docker host IP, hostname (if configured previously), and UniFi data/database is the same the devices should just reconnect, although it sometimes takes a few minutes for them to re-establish STUN if the controller is layer 3 remote.

well, same problem here.
after some dig, I found my AP tries to connect to docker's private address. (172.19.0.4 in my environment)
I'm no idea so far except change it to host network. (no I don't want to do this)
Please give me a little help, let me konw what's I missed.

open "settings" - "controller", set "Controller Hostname/IP" as host IP, check "Override inform host with controller hostname/IP"
it works for me.

@PikuZheng when you set Controller Hostname/IP are you using the actual IP address of the host or the old docker host IP?

I seem to keep getting invalid input error when using either host IP, old or new internal docker IP on the Controller Configuration page

@PikuZheng when you set Controller Hostname/IP are you using the actual IP address of the host or the old docker host IP?

I seem to keep getting invalid input error when using either host IP, old or new internal docker IP on the Controller Configuration page

I'm using host IP , the debian's IP in your env.
try chrome anyway.

Thanks @PikuZheng that worked.

For anyone else having issues this is what I did to migrate over to new system.

Set Controller Inform Address:

  • Settings > System > Application Configuration
  • Override Inform Host - Checked
  • Host for Inform - Set to IP address of Host machine (not docker IP)

Set Inform address on Ubiquiti Devices:

  • SSH out to all Ubiquiti Devices > authenticate to device (this could be the default login or what you set in the controller)
  • run "info" to check inform address
  • run "Set-Inform http://:8080/inform" if the inform address is not the IP address of the Host machine

If any device doesn't automatically connect back into the host you may need to do the following:

  • SSH out to device
  • Forget the device in Controller
  • Run "set-default" or use the reset button to reset the device
  • SSH back out to the device (login will be the default Username: ubnt and password: ubnt)
  • run "Set-Inform http://:8080/inform"
  • It should then show up in the controller after a few minutes, when it does you can adopt it