linuxserver / docker-unifi-network-application

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

[BUG] grep: /config/data/system.properties: binary file matches log spam #95

Closed 5andr0 closed 4 months ago

5andr0 commented 4 months ago

Is there an existing issue for this?

Current Behavior

My log file is full of grep: /config/data/system.properties: binary file matches The check in /etc/s6-overlay/s6-rc.d/svc-unifi-network-application/data/check#L3 fails, because either the init script or the app converted the settings file to binary (i never touched it).

root@63f8244bdcc2:/# file /config/data/system.properties
/config/data/system.properties: data
root@63f8244bdcc2:/# file /config/data/system.properties.bk
/config/data/system.properties.bk: data
root@63f8244bdcc2:/# file /defaults/system.properties
/defaults/system.properties: ASCII text

workaround fix: WEB_PORT=$(grep --text 'unifi.https.port=' '/config/data/system.properties' | awk -F '=' '{print $2}')

UPDATE: just found out instead of the line statdb.mongo.uri=mongodb\://unifi\:totallyrandom@unifi-db\:27017/unifi_stat?tls\=false there's 1577 zero bytes followed by = and newline

Deleting the file restores it with the correct statdb.mongo.uri line. Could've been caused on my end by a power fault. But I'll leave the issue open for now, might be a code bug.

Expected Behavior

No response

Steps To Reproduce

Run a fresh container and wait for the error

Environment

- OS: win10 latest wsl2
- How docker service was installed: official docker repo

CPU architecture

x86-64

Docker creation

version: '3.4'

x-mongo: &mongo
  MONGO_USER: unifi
  MONGO_PASS: totallyrandom
  MONGO_PORT: 27017
  MONGO_DBNAME: unifi

x-users: &users
  PUID: 1000
  PGID: 1000

services:
  unifi-network-application:
    image: lscr.io/linuxserver/unifi-network-application:latest
    container_name: unifi
    environment:
      << : [*mongo, *users]
      TZ: Europe/Athens
      MONGO_HOST: unifi-db
      MEM_LIMIT: 1024 #optional
      MEM_STARTUP: 1024 #optional
      MONGO_TLS:  #optional
      MONGO_AUTHSOURCE:  #optional
    volumes:
      - ./app/data:/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
    restart: always
    depends_on:
      - unifi-db
    networks:
      - unifi

  unifi-db:
    image: mongo:7.0
    container_name: unifi-db
    volumes:
      - ./db/data:/data/db
      - ./db/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
    environment:
      << : [*mongo, *users]
    restart: always
    networks:
      - unifi

networks:
  host:
    name: host
    external: true
  unifi:

Container logs

grep: /config/data/system.properties: binary file matches
grep: /config/data/system.properties: binary file matches
grep: /config/data/system.properties: binary file matches
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.

5andr0 commented 4 months ago

Can't find a bug in the code. Must've happend because of my power faults. -> closing