linuxserver / docker-unifi-network-application

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

404 Not Found Issue #47

Closed tom-43 closed 6 months ago

tom-43 commented 6 months ago

Is there an existing issue for this?

Current Behavior

Like in some other existing closed issues I have the problem that I get "HTTP Status 404 – Not Found" when I open the webpage after the installation. I tried to change the compose files but it just doesn't work. This is my docker-compose.yml:

version: "2.1"

services:
  unifi-db:
    image: mongo:3.6
    container_name: unifi-db
    environment:
      - PUID=1000
      - PGID=1000
    volumes:
      - /docker/unifi/mongo/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=unifipwd
      - 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"

Expected Behavior

No response

Steps To Reproduce

  1. start the containers
  2. open the webpage

Environment

- OS: Ubuntu 22.04
- How docker service was installed: via the official docker guide

CPU architecture

x86-64

Docker creation

via docker compose

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
───────────────────────────────────────
[custom-init] No custom files found, skipping...

2023-12-12T13:31:15.133+0000 I CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=c22f8bfb7673
2023-12-12T13:31:15.134+0000 I CONTROL  [initandlisten] db version v3.6.23
2023-12-12T13:31:15.134+0000 I CONTROL  [initandlisten] git version: d352e6a4764659e0d0350ce77279de3c1f243e5c
2023-12-12T13:31:15.134+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
2023-12-12T13:31:15.134+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2023-12-12T13:31:15.134+0000 I CONTROL  [initandlisten] modules: none
2023-12-12T13:31:15.134+0000 I CONTROL  [initandlisten] build environment:
2023-12-12T13:31:15.134+0000 I CONTROL  [initandlisten]     distmod: ubuntu1604
2023-12-12T13:31:15.134+0000 I CONTROL  [initandlisten]     distarch: x86_64
2023-12-12T13:31:15.134+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2023-12-12T13:31:15.134+0000 I CONTROL  [initandlisten] options: { net: { bindIpAll: true } }
2023-12-12T13:31:15.135+0000 I -        [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2023-12-12T13:31:15.135+0000 I STORAGE  [initandlisten] 
2023-12-12T13:31:15.135+0000 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2023-12-12T13:31:15.135+0000 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2023-12-12T13:31:15.135+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=1035M,cache_overflow=(file_max=0M),session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),compatibility=(release="3.0",require_max="3.0"),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2023-12-12T13:31:15.858+0000 I STORAGE  [initandlisten] WiredTiger message [1702387875:858628][1:0x7f979edaca40], txn-recover: Main recovery loop: starting at 5/6016
2023-12-12T13:31:15.945+0000 I STORAGE  [initandlisten] WiredTiger message [1702387875:945015][1:0x7f979edaca40], txn-recover: Recovering log 5 through 6
2023-12-12T13:31:16.003+0000 I STORAGE  [initandlisten] WiredTiger message [1702387876:3695][1:0x7f979edaca40], txn-recover: Recovering log 6 through 6
2023-12-12T13:31:16.042+0000 I STORAGE  [initandlisten] WiredTiger message [1702387876:42911][1:0x7f979edaca40], txn-recover: Set global recovery timestamp: 0
2023-12-12T13:31:16.400+0000 I CONTROL  [initandlisten] 
2023-12-12T13:31:16.400+0000 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2023-12-12T13:31:16.400+0000 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2023-12-12T13:31:16.400+0000 I CONTROL  [initandlisten] 
2023-12-12T13:31:16.412+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2023-12-12T13:31:16.412+0000 I NETWORK  [initandlisten] listening via socket bound to 0.0.0.0
2023-12-12T13:31:16.413+0000 I NETWORK  [initandlisten] listening via socket bound to /tmp/mongodb-27017.sock
2023-12-12T13:31:16.413+0000 I NETWORK  [initandlisten] waiting for connections on port 27017
github-actions[bot] commented 6 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.

DenDeXTeR51 commented 6 months ago

@tschmitt1605 Check unifi config folder, there is file with mongo URL. Seems it not see your DB by name from unifi-network-application container

Xeevis commented 6 months ago

Same issue, it used to work fine, but I assume after upgrade to 8.x, it went bust and just keeps looping

image

docker-compose.yml ```docker version: "3.8" services: unifi-network-application: image: lscr.io/linuxserver/unifi-network-application:latest container_name: unifi-network-application depends_on: - unifi-db environment: - PUID=1000 - PGID=1000 - TZ=Europe/Prague - MONGO_USER=unifi - MONGO_PASS=unifi - MONGO_HOST=unifi-db - MONGO_PORT=27017 - MONGO_DBNAME=unifi - MEM_LIMIT=1024 #optional - MEM_STARTUP=1024 #optional volumes: - /volume1/docker/unifi/app/config:/config networks: - unifi-network 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 restart: unless-stopped unifi-db: image: docker.io/mongo:4 container_name: unifi-db networks: - unifi-network ports: - 27017:27017 volumes: - /volume1/docker/unifi/db/data:/data/db - /volume1/docker/unifi/db/config:/data/configdb - /volume1/docker/unifi/db/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro restart: unless-stopped networks: unifi-network: driver: bridge ```
tom-43 commented 6 months ago

@tschmitt1605 Check unifi config folder, there is file with mongo URL. Seems it not see your DB by name from unifi-network-application container

Sorry for the late answer. I will try again later.

kevincw01 commented 6 months ago

I recommend starting the container the first time without -d e.g. docker-compose up. Then you will see all of the live logs. After it looked like it was done I went to the https://ip:8443/ and got the same 404 error. But then I noticed in the logs about 30s later that the container was still building the database. If you wait a good 3-4 mins (at least on the mac mini I am using) then it comes up. I actually had the same issue with the https://github.com/jacobalberty/unifi-docker solution.

tom-43 commented 6 months ago

I now have the UniFi Controller running in an LXC and it works perfectly. I have thus avoided the error...