linuxserver / docker-unifi-network-application

GNU General Public License v3.0
721 stars 54 forks source link

[BUG] When recreating the container my settings are gone #120

Closed me1299 closed 3 weeks ago

me1299 commented 3 weeks ago

Is there an existing issue for this?

Current Behavior

I recreate the container and pull the latest image. The container is recreated, and boots up. I'm presented with this screen:

image

Expected Behavior

I expect my settings to still be there and to just upgrade the container. I have to restore a backup everytime I upgrade to get my stuff back.

Steps To Reproduce

  unifi-db:
    image: docker.io/mongo:7.0.11
    container_name: unifi-db
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${DOCKERDIR}/unifi-db/data:/data/db
      - ${DOCKERDIR}/unifi-db/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
    ports:
      - 27017:27017
    restart: unless-stopped

  unifi:
    image: lscr.io/linuxserver/unifi-network-application:latest
    container_name: unifi
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - MONGO_USER=unifi
      - MONGO_PASS=*********
      - MONGO_HOST=unifi-db
      - MONGO_PORT=27017
      - MONGO_DBNAME=unifi-db
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${DOCKERDIR}/unifi-network-application/data:/data/config
    ports:
      - 8443:8443
      - 3478:3478/udp
      - 10001:10001/udp
      - 8080:8080
      - 8843:8843
      - 8880:8880
      - 6789:6789
      - 5514:5514/udp
    restart: unless-stopped
    networks:
      - default

One thing I notice is that nothing is written in ${DOCKERDIR}/unifi-network-application/data But I can enter the container (/BIN/BASH) and see the directory and create files etc without issues.

Environment

- OS: Ubuntu 22.04.4 LTS
- How docker service was installed:

CPU architecture

x86-64

Docker creation

I use the composer configuration as stated above.

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:    997

───────────────────────────────────────

Linuxserver.io version: 8.5.6-ls68

Build-date: 2024-10-22T17:31:57+00:00

───────────────────────────────────────

*** 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.
github-actions[bot] commented 3 weeks ago

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

aptalca commented 3 weeks ago

Your folder mapping is incorrect

me1299 commented 3 weeks ago

Your folder mapping is incorrect

I see the error myself. Thank you very much!

me1299 commented 3 weeks ago

I'm not a smart man