linuxserver / docker-unifi-network-application

GNU General Public License v3.0
553 stars 41 forks source link

[BUG] <title> #8

Closed Oilman-TX closed 8 months ago

Oilman-TX commented 9 months ago

Is there an existing issue for this?

Current Behavior

I am trying to migrate from Unifi Controller Docker to the Unifi Network application docker. My understanding is that the Controller docker will be deprecated in the near future.

I am running this on an Unraid server. The Unifi Controller docker has a WebUI that allows me to log in to the Unifi application. In the WebUI I was able to create a backup of my network setup and history. However, when I shut down the "controller" container, and start up the "Network Application" docker, the network application only gives me the option of a >_ Console.

Also, it isn't clear whether I need to install the MongoDB docker container or whether it is running in the background as part of the Unifi Network Application install.

Expected Behavior

I believe that after starting the docker container, a WebUI should show up for the Unifi Network Application. In that WebUI I should then be able to restore from the back-up made in the Controller.

Steps To Reproduce

1) Install the Network application docker.
2) it auto starts running the container 3) There is no WEBUI option.

Note that I have not deleted the old docker "Unifi Controller" yet and it has some of the same port assignments. However, I have that docker container stopped while I am trying to get the newer Network Application to install. Tower_UpdateContainer.pdf

Environment

- OS:Unraid Version 6.12.3
- How docker service was installed: the linuxserver unifi-network-application app from the APPS menu.

CPU architecture

x86-64

Docker creation

Actually run from the docker interface in unraid (see attached pdf), but here is the completed script.

docker run
  -d
  --name='unifi-network-application'
  --net='host'
  -e TZ="America/Chicago"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="Tower"
  -e HOST_CONTAINERNAME="unifi-network-application"
  -e 'TCP_PORT_8443'='8443'
  -e 'UDP_PORT_3478'='3478'
  -e 'UDP_PORT_10001'='10001'
  -e 'TCP_PORT_8080'='8080'
  -e 'UDP_PORT_1900'='1900'
  -e 'TCP_PORT_8843'='8843'
  -e 'TCP_PORT_8880'='8880'
  -e 'TCP_PORT_6789'='6789'
  -e 'UDP_PORT_5514'='5514'
  -e 'MONGO_USER'='unifi'
  -e 'MONGO_PASS'='CuencA_25'
  -e 'MONGO_HOST'='unifi-db'
  -e 'MONGO_PORT'='27017'
  -e 'MONGO_DBNAME'='unifi'
  -e 'MEM_LIMIT'='1024'
  -e 'MEM_STARTUP'='1024'
  -e 'PUID'='99'
  -e 'PGID'='100'
  -e 'UMASK'='022'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver-ls-logo.png'
  -v '/mnt/user/appdata/unifi-network-application':'/config':'rw' 'lscr.io/linuxserver/unifi-network-application'
0a9a8cf07d62c4f19ad674c991fcdc45499651f55193ba7cd94647f7b61dc96d

The command finished successfully!

Container logs

text  error  warn  system  array  login  

[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:    99
User GID:    100
───────────────────────────────────────

[custom-init] No custom files found, skipping...
17:12:39,183 |-INFO in ch.qos.logback.access.tomcat.LogbackValve[null] - Could NOT configuration file [/usr/lib/unifi/logback-access.xml] using property "catalina.base"
17:12:39,183 |-INFO in ch.qos.logback.access.tomcat.LogbackValve[null] - Could NOT configuration file [/usr/lib/unifi/logback-access.xml] using property "catalina.home"
17:12:39,183 |-INFO in ch.qos.logback.access.tomcat.LogbackValve[null] - Found [logback-access.xml] as a resource.
17:12:39,184 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@327ed9f5 - URL [jar:file:/usr/lib/unifi/lib/ace.jar!/logback-access.xml] is not of type file
17:12:39,190 |-INFO in ch.qos.logback.access.joran.action.ConfigurationAction - debug attribute not set
17:12:39,190 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
17:12:39,190 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [access_log]
17:12:39,191 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@67594471 - No compression will be used
17:12:39,191 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.access.PatternLayoutEncoder] for [encoder] property
17:12:39,194 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[access_log] - Active log file name: logs/access.log
17:12:39,194 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[access_log] - File property is set to [logs/access.log]
17:12:39,194 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [access_log] to ch.qos.logback.access.tomcat.LogbackValve[null]
17:12:39,194 |-INFO in ch.qos.logback.access.joran.action.ConfigurationAction - End of configuration.
17:12:39,195 |-INFO in ch.qos.logback.access.joran.JoranConfigurator@756b58a7 - Registering current configuration as safe fallback point
17:12:39,195 |-INFO in ch.qos.logback.access.tomcat.LogbackValve[null] - Done configuring
github-actions[bot] commented 9 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.

j0nnymoe commented 9 months ago

If you read here, seems clear that you require an external mongodb container 🙂 https://github.com/linuxserver/docker-unifi-network-application#application-setup

hanno2003 commented 9 months ago

If you read here, seems clear that you require an external mongodb container 🙂 https://github.com/linuxserver/docker-unifi-network-application#application-setup

could you please provide a valid docker-compose.yaml for setting up a mongodb container with the right version? thanks in advance!

Mystery-X commented 9 months ago

put these 2 files in a folder (ex. Unifi).

Replace in both files "YOURPASSWD" with your own secure password.

filename : init-mongo.js

db.getSiblingDB("unifi").createUser({user: "unifi", pwd: "YOURPASSWD", roles: [{role: "readWrite", db: "unifi"}]});
db.getSiblingDB("unifi_stat").createUser({user: "unifi", pwd: "YOURPASSWD", roles: [{role: "readWrite", db: "unifi_stat"}]});

filename : docker-compose.yml

version: "2.1"

services:
  unifi-db:
    image : mongo:3.6
    container_name: unifi-db
    environment:
      - PUID=1000
      - PGID=1000
    volumes:
      - ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
      - unifi_db:/data/db
      - mongo_cnfdb:/data/configdb
    ports:
      - 27017:27017
    restart: unless-stopped

  unifi-network-application:
    image: lscr.io/linuxserver/unifi-network-application:latest
    container_name: unifi-network-application
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - MONGO_USER=unifi
      - MONGO_PASS=YOURPASSWD
      - MONGO_HOST=unifi-db
      - MONGO_PORT=27017
      - MONGO_DBNAME=unifi
      - MEM_LIMIT=1024 #optional
      - MEM_STARTUP=1024 #optional
    volumes:
      - unifi_app:/config
    ports:
      - 8443: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

volumes:
  unifi_app:
    name: "unifi_app"
  unifi_db:
    name: "unifi_db"
  mongo_cnfdb:
    name: "mongo_cnfdb"

Now from this folder run docker-compose -up (add -d if you want to daemonize).

Good luck.

AgentTechnoman commented 9 months ago

Good luck.

Without going over it with a fine-toothed comb, I don't know what the difference is between your compose file and mine, but yours brought my Unifi Controller back from the dead!

Thanks a million!

drizuid commented 8 months ago

OP did not follow the readme and did not reply after being told why they had an issue. Mongo provides examples for their container's compose and docker run already another user graciously provided a full compose for users who couldn't be bothered to take the example from mongo directly :)

closing this as not reproducible by those following the readme.

JustKuz commented 5 months ago

This is still an issue as I just worked through installing the new application on unRAID and noticed the same thing. This is specifically related to the unRAID template for this container. It's missing a value, but can be added after you install the container fairly easily.

  1. Click on the advanced view of the container properties
  2. Notice the missing entry for "WebUI"
  3. Enter "https://[IP]:[PORT:8443]"
  4. Click Apply at the bottom and it should be resolved.

Maintainers of the template will need to update this

image