Unifi Access Point says in Adopting state

I’m running the UniFi Controller on my Synology NAS in a docker container. After a firewall upgrade (gateway for the AP LAN), I noticed that all my Access Points were in the Adopting state. The wireless was still working fine, but no UniFI AP was in the Connected state. Forcing provisioning the AP’s did not work. So I restated all my AP’s the hard way by restarting the PoE adapters, just to get it working again, i hoped…

This fixed the issue for the AP-AC-Pro access points. However the AP-Pro stayed in the Adopting state even after a reboot.

I logged in to the node and checked the configuration;

$ ssh <user>@ 
<user>@'s password: 

BusyBox v1.25.1 () built-in shell (ash)

  ___ ___      .__________.__
 |   |   |____ |__\_  ____/__|
 |   |   /    \|  ||  __) |  |   (c) 2010-2019
 |   |  |   |  \  ||  \   |  |   Ubiquiti Networks, Inc.
 |______|___|  /__||__/   |__|
            |_/                  https://www.ui.com/

      Welcome to UniFi UAP-Pro!

AP1-BZ.v4.0.69# grep url cfg/mgmt 

As you can see the mgmt.servers.1.url is set to IP, this is incorrect! No idea how it ended up in there, but I changed it and intermediately the AP had a Connected state with the controller again!

AP1-BZ.v4.0.69# set-inform

Adoption request sent to ''.  Use the controller to complete the adopt process.

After this setting change, I upgraded the AP to version, checked the cfg/mgmt file again and now the mgmt.servers.1.url value is just fine.

Update: Now I got an idea what happened :) is the IP the docker container is using. Somehow this ended up at the AP. I changed the following settings and now it’s fixed;

Settings > Controller Settings > Advanced Configuration

Controller Hostname/IP: (my controller IP)
Override Inform Host With Controller Hostname/IP: enabled