Intro

I recently moved onto my new house and I finally got the chance to mount the wireless access points that I had in storage for a couple of years. When I connected them, the Unifi controller said they are managed by another controller. Since I last used these access points, I had re-built the controller so this makes sense.

Getting the APs under management of the Unifi controller was frustraighting and not very straight forward. This post covers the issues I enountered and the eventual fix to get the APs managed.

Software

The following software was used in this post.

  • Ubiquiti UAP-AC-Pro - 6.2.44
  • Unifi Controller (VM) - 6.5.55

Factory Reset

The first thing I tried was to factory reset the APs. When I did this the APs connected, but I got the error that the Adoption Failed. At this point, there was no way to remove the AP from the UI.

Inform URL

The Inform URL is used to tell the controller about the Access point. Alot of forum posts and aritcles pointed to manually set this to restart the adoptiopn procees. The default inform URL is: http://unifi:8080/inform. I SSH'd to the AP using the default credentials ubnt/ubnt and set the inform URL with the set-inform http://<controller-ip>:8080/inform.

Unfortunately, this did not help and the AP was still stuck in the Adoption Failed state.

Logs

At this point, I started looking at the log files. The log on the APs is located here: /var/log/messages. The log had some errors relating to the inform process failing.

log
Fri Dec  9 11:11:50 2022 daemon.err mcad: mcad[1235]: ace_reporter.reporter_fail(): Server Reject (http://<controller-ip>:8080/inform)

On the controller, the logs are located here: /var/log/unifi/server.log. I found numerous errors relating to AP adoption.

log
[2022-12-09T21:17:36,471] <inform-2> WARN inform - dev[78:8a:20:80:2b:e6] used default key in ADOPT_FAILED state, reject it!
[2022-12-09T22:09:47,258] Detected duplicated uap[78:8a:20:80:2b:e6] while fetching site and pending adoption devices
[2022-12-09T22:09:47,258] <ubnt/tcp4> ERROR dev - SSH adopt failed adopt_state[2],prev_state[2],firmware[6.2.44.14098],model[U7PG2],uses_default_credentials[false]

Solution

The solution to this problem involves a few steps:

  • Connect to the Mongo DB database on the Unifi Controller.
  • Delete the access points from the database.
  • Restart the Unifi Controller.
  • Factory Reset the Access Points.

To connect to Mongo DB, I needed to install the mongodb-clients package.

cmd
sudo apt install -y mongodb-clients

Next, connect to Mongo DB and delete the offending AP's.

cmd
sudo mongo --port 27117
use ace
db.device.remove({"mac":"<mac-address>"});
exit

Finally, restart the controller and factory reset the APs. The APs will be removed from the Unifi controller and you will be able to start the adoption process again. Fingers crossed, this works, I had to do this multiple times for some APs, but eventually, I get them all connected again.

Outro

In this post, I covered the process to recover an Ubiquiti AP that is stuck in the Adoption Failed state. It was a bit painful, but I got there in the end, if you faced the same issue I did and found this post, I hope it helped you get to the solution faster than I did ✌️