How to Fix UniFi Adoption – Server Reject

Last week I had a brand new UniFi accesspoint that I just could not get adopted by the controller. It did show up in the controller, ready for adoption, but after adoption, the access point disappeared in the controller. When looking up the status in the access point I noticed the error Server Reject.

unifi server reject
UniFi server reject

My first attempt to solve this was simply resetting the access point back to defaults. You can factory reset the accesspoint using the button, or use SSH and the set-default command. But that didn’t seem to help either. The device kept showing the Server Reject status.

In this article, I will explain how you can solve the UniFi Server Reject error.

Method 1 – Check the inform address

The first step is to check the inform address in the UniFi device. When the inform address is configured incorrectly, then you will also get the server reject status in the UniFi device. Make sure that you know the SSH credentials of the device, default username, and password is ubnt.

ssh ubnt@192.168.1.140

# Check current inform address
info

# Set correct address:
set-inform http://192.168.1.1:8080/inform

Make sure that you pay close attention to the http:// part, port number and don’t forget to add /inform at the end.

Method 2 – Forget and reset the UniFi device

If the inform address is set correctly and the device still won’t adopt, then we are first going to reset the device and remove it from the controller.

  1. Open the UniFi network controller
  2. Go to devices and select the device
  3. Click on Settings
  4. Scroll all the way down, expand Manage, and click on Forget
UniFi forget device
Forget device

The device will reboot and should show up for adoption in the network controller.

Method 3 – Remove it from the MongoDB

If these methods don’t work then there is one last step that we can do. We can remove the device manually from the controller, by deleting it in the Mongo Database of the controller. For this, we are going to make an SSH connection to the controller and we will need the MAC address of the UniFi device that we want to delete.

You can find the MAC address in the network controller, when you open the device or on the bottom of the device itself.

The SSH password of the controller can be found/set in the UniFi OS > Settings > System. It’s different from the SSH password that we have used for the UniFi devices. Make sure that you have a backup of your controller before you start!

# Connect to your controller
ssh root@192.168.1.1

# Open the Mongo db
mongo --port 27117

# Remove the MAC address from the db
use ace
db.device.remove({"mac":"xx:xx:xx:xx:xx:xx"});
exit  # or reboot the controller with the command reboot
unifi server reject solution

The last step is to reboot the console. You can type the command reboot for this or restart it through the browser under Settings > System.

After these steps, I reset the access point back to factory settings once again, just to be sure that everything was removed. You should now be able to adopt the UniFi device without the server reject error.

Wrapping Up

I hope this article helped you with solver the UniFi server reject error, if you have any questions, just drop a comment below.

18 thoughts on “How to Fix UniFi Adoption – Server Reject”

  1. Thanks for another great article. While migrating between controller instances a site did not complete migration. Devices did not show in new controller, but remained in old as “disconnected”.

    Unable to adopt to new controller via ssh after many resets info shows either server reject or not adopted.

    Tried all three methods. Now thinking maybe delete the site and start anew?

    • That is indeed an difficult one. If it’s a small site, then deleting and starting over will be the quickest way, otherwise I would reach out to Ubiquiti support for this.

      • Indeed I have, but I fear the recent mishap where users’ video feeds were going to the wrong users has them a bit occupied. Still waiting.

        In the meantime I did in fact start over and everything was going smoothly. Everything adopted and was working great. I went back an hour or so later and all devices had vanished.

  2. Would the remove command look for the device on any site or do,I need to specify this? In case I have multiple sites on the controller. I use a Unifi Project with multisite support enabled

  3. root@server04:~# mongo –port 27117
    MongoDB shell version: 3.2.11
    connecting to: 127.0.0.1:27117/test

    > use ace
    switched to db ace

    > db.device.remove({“mac”:”f4:92:bf:29:aa:c0″});
    WriteResult({ “nRemoved” : 0 })

    > ^C
    bye
    root@server04:~# reboot

    ******
    if you copy &paste the commands, you have to write the command with double minus..

    mongo –port 27117

  4. Hi Ruud and All of you,

    I was dealing with this adoption problem for some time. 4-5 pcs U6 LRs, U6 Lite and USW 48 POE Gen 2. couldn’t adopt. Of cours you can try all steps in this article if not please try my solution:
    IMPORTANT: Backup your main controller.
    1. Before you start adding new Access Points or other devices make sure you have newest version of controller if not please update your controller first.
    2. Update devices over SSH (like in this article)
    3. Add/adopt devices to controller

    If you recive adoption failure. Get another PC and install newest Unifi Controller and add new site. PC has to be connected to same network as Unifi new devices.
    1. forget any devices with adoption failure message on main controller
    2. export site from your main controller
    3. import site to your new controller
    4. input IP address/host name of your new controller in exporting creator on main controller
    5. delete site on your main controller
    6. wait until devices will show up in new controller (if device is not showing, reset device holding reset button for 10 seceonds or over SSH and do “set-default” command)
    7. add/adopt new devices in new controller
    8. when all devices are adopted and connected you can export site from new controller to your main controller with all same steps without reseting devices.

    Many thanks Ruud for your effort. I like very much how you writing. All the best for you.

    Regards
    Mateusz

  5. Hi Rudy

    Great articles !!!

    Ive got a FlexHD AP that was working previously for 1+ years and is now stubbornly refusing to mesh and stuck as isolated

    Ive tried resetting it multiple times but no change

    I’d like to try your method 3 to remove it from the MongoDB but I get the following

    # mongo –port 27117
    -sh: mongo: not found
    #

    The files there

    # find / -name mongo -print
    /mnt/data/podman/storage/overlay/85132105b147b6feb2e3b6b5705e01694c1f12740029c04c785a13a4cb4b5af0/merged/usr/bin/mongo
    /overlay/root_ro/var/lib/containers/storage/overlay/5c8e2f17e3e35f60fade55c688e0221f11bb29799d44fec18a33fc6d87a0340f/diff/usr/bin/mongo
    find: /proc/26225: No such file or directory
    find: /proc/26350: No such file or directory
    find: /proc/26351: No such file or directory

    Its listening

    # netstat -na | grep 27117
    tcp 0 0 127.0.0.1:27117 0.0.0.0:* LISTEN
    tcp 0 0 127.0.0.1:27117 127.0.0.1:52018 ESTABLISHED
    tcp 0 0 127.0.0.1:27117 127.0.0.1:58186 ESTABLISHED
    tcp 0 0 127.0.0.1:27117 127.0.0.1:46366 ESTABLISHED
    tcp 0 0 ::ffff:127.0.0.1:52018 ::ffff:127.0.0.1:27117 ESTABLISHED
    tcp 0 0 ::ffff:127.0.0.1:46366 ::ffff:127.0.0.1:27117 ESTABLISHED
    tcp 0 0 ::ffff:127.0.0.1:58186 ::ffff:127.0.0.1:27117 ESTABLISHED
    unix 2 [ ACC ] STREAM LISTENING 42707 /usr/lib/unifi/run/mongodb-27117.sock
    unix 2 [ ] DGRAM 271171
    #

    Ive tried running with the full path

    # /mnt/data/podman/storage/overlay/85132105b147b6feb2e3b6b5705e01694c1f12740029c04c785a13a4cb4b5af0/merged/usr/bin/mongo –port 27117
    /mnt/data/podman/storage/overlay/85132105b147b6feb2e3b6b5705e01694c1f12740029c04c785a13a4cb4b5af0/merged/usr/bin/mongo: error while loading shared libraries: libboost_program_options.so.1.62.0: cannot open shared object file: No such file or directory
    #

    Im running UDM 1.12.22

    any ideas ?

    Thanks in advance

    Tom

Leave a Comment

0 Shares
Tweet
Pin
Share
Share