linuxserver / docker-unifi-network-application

GNU General Public License v3.0
551 stars 40 forks source link

[BUG] Unifi Express does not appear for adoption #68

Closed b0bcarlson closed 4 months ago

b0bcarlson commented 4 months ago

Is there an existing issue for this?

Current Behavior

Unifi Express does not appear for adoption. When the Express is connected to the network via the LAN port: The device gets an ip from the upstream DHCP server. The device appears under "Client Devices", but not "Unifi Devices". When setting up on the mobile app on the step to select the setup type the button for adding to the existing system is disabled "Searching for Express on console's network". When the Express is connected to the network via the WAN port: The device uses default ip 192.168.1.1 and does not appear in the Unifi console

Expected Behavior

The Express should appear for adoption and be adoptable like all other devices

Steps To Reproduce

  1. Clean install unifi-network-application
  2. Factory reset Unifi Express
  3. Set the inform host to the host ip
  4. Adopt other devices as needed
  5. Connect Express to the network via the LAN port
  6. Express never appears for adoption

Environment

- OS: Ubuntu 22.04.3 Server
- How docker service was installed: apt
- Hosted on Portainer

CPU architecture

x86-64

Docker creation

version: "2.1"
services:
  unifi-controller:
    image: linuxserver/unifi-network-application:latest
    container_name: unifi-controller
    environment:
      - PUID=1000
      - PGID=1000
      - MONGO_USER=unifi
      - MONGO_PASS=snip
      - MONGO_HOST=unifi-db
      - MONGO_PORT=27017
      - MONGO_DBNAME=unifi
    volumes:
      - /mnt/containers/unifi-network-application/config:/config
    ports:
      - 2443:8443
      - 3478:3478/udp
      - 10001:10001/udp
      - 8080:8080
      - 1900:1900/udp #optional
      - 8843:8843 #optional
      - 8880:8880 #optional
      - 6789:6789 #optional
      - 5514:5514/udp #optional
    depends_on:
      - unifi-db
    restart: unless-stopped
  unifi-db:
    image: docker.io/mongo:4.4
    container_name: unifi-db
    volumes:
      - /mnt/containers/unifi-network-application/mongo/db:/data/db
      - /mnt/containers/unifi-network-application/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
    restart: unless-stopped

Container logs

[migrations] started
[migrations] no migrations found
───────────────────────────────────────
      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝
   Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    1000
User GID:    1000
───────────────────────────────────────
*** Waiting for MONGO_HOST unifi-db to be reachable. ***
Generating 4,096 bit RSA key pair and self-signed certificate (SHA384withRSA) with a validity of 3,650 days
    for: CN=unifi
[custom-init] No custom files found, skipping...
[ls.io-init] done.
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: destroy called
Exception in thread "Thread-8" java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
    at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:168)
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1172)
    at com.ubnt.service.C.Ö00000(Unknown Source)
    at com.ubnt.ace.Launcher.Ö00000(Unknown Source)
    at java.base/java.lang.Thread.run(Thread.java:840)
:0 TCP candidates not supported yet
:0 TCP candidates not supported yet
:0 Permanent error code on channel bind request: 400 - Empty port number in channel bind request
:0 All TURN channel bindings failed
github-actions[bot] commented 4 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

b0bcarlson commented 4 months ago

For reference, I have also opened a ticket with Ubiquiti directly to see if they have any information.

j0nnymoe commented 4 months ago

It's because the unifi express runs the controller itself.

b0bcarlson commented 4 months ago

It does, but it should also be adoptable as an AP https://community.ui.com/questions/Unifi-Express-and-a-separate-controller-cloudkey-docker/9d8ca0d1-ee54-45f5-bf11-789e865e0c4c#answer/664c3025-333d-41d4-a37e-51971427d0ca

j0nnymoe commented 4 months ago

Have you tried manually setting the inform URL on the device?

b0bcarlson commented 4 months ago

Just tried that with no change in behavior. My guess is the Express is not supported on self hosted Unifi, but I am awaiting clarification from Ubiquiti on that.

b0bcarlson commented 4 months ago

Reply from Ubiquiti:

Thank you for your response. We understand your concern and want to confirm that you can adopt and set it up as an Access point on a self-hosted UniFi Network server. However, we don't recommend installing the UniFi Network Server on a VM or a 3rd Party Cloud since it falls beyond our support scope and may lead to issues like the one you are having. We suggest installing it natively on a Windows/Linux or Mac Host or using a UniFi Console.

Please ensure that the UniFi Express is connected using its LAN port instead of the WAN one. After that, you will need to select "Add to Existing System".

Express can work as an AP via two methods:

  1. Connected via a wired connection to the same network: The Express, in this case, automatically shows up in the devices tab in the self-hosted Network Application, which we can adopt as an AP.

  2. Connected via a wireless connection in the same network: If there are other UniFi APs present in the network, then we can set the express as an AP via wireless meshing provided wireless meshing is ON in global settings. In that case, the Express will mesh with any of the other APs we might have in our network post-adoption as shown below.

If the issue persists, then please share the latest support file from the Self-hosted UniFi Network server on a Natively hosted client. You can download the support file by following the steps in this article.

I hope that's helpful. We will be looking forward to your response.

Per their suggestion I was able to adopt it when I first adopted another AP and then connecting wirelessly.