xirixiz/dsmr-reader-docker

Password DB issue? can't install on syno docker...

migube opened this issue · 2 comments

Support guidelines

I've found an issue and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

Dag Bram

I initially added this topic here dsmrreader/dsmr-reader#1674
but was informed to post it here, as Docker related.

I followed the config.yml and Readme as best as I could (there might be some volumes to change in the example yml btw...) but can't get the DB connection to work :

"OperationalError: connection to server at "dsmrdb" (172.18.0.7), port 5432 failed: FATAL: password authentication failed for user "dsmrreader"

dsmrdb:
    image: postgres:14
    container_name: dsmrdb
    restart: always
    volumes:
      - dsmrdb:/var/lib/postgresql/data
    environment:
      - TZ=Europe/Amsterdam
      - PG_TZ=Europe/Amsterdam
      - POSTGRES_USER=dsmrreader
      - POSTGRES_PASSWORD=dsmrreader
      - POSTGRES_DB=dsmrreader
dsmr:
    image: xirixiz/dsmr-reader-docker:latest
    depends_on:
      dsmrdb:
        condition: service_healthy
    container_name: dsmr
    links:
      - dsmrdb
    cap_add:
      - NET_ADMIN
    restart: always
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - dsmr_backups:/app/backups
    environment:
      - TZ=Europe/Amsterdam
      - DJANGO_TIME_ZONE=Europe/Amsterdam
      - VIRTUAL_HOST=localhost
      - DUID=1027
      - DGID=100
      - DSMRREADER_ADMIN_USER=admin
      - DSMRREADER_ADMIN_PASSWORD=somethingelse
      - DSMRREADER_LOGLEVEL=WARNING
      - DJANGO_SECRET_KEY=dsmrreader
      - DSMRREADER_SUPPRESS_STORAGE_SIZE_WARNINGS=True
      - DSMRREADER_REMOTE_DATALOGGER_MODE=receiver
      - DJANGO_DATABASE_ENGINE=django.db.backends.postgresql
      - DJANGO_DATABASE_NAME=dsmrreader
      - DJANGO_DATABASE_USER=dsmrreader
      - DJANGO_DATABASE_PASSWORD=dsmrreader
      - DJANGO_DATABASE_HOST=dsmrdb
      - DJANGO_DATABASE_CONN_MAX_AGE=60
...

any ideas?

terminal:
pg_isready -U dsmrreader =>works...

db logs:
image

tx

Expected behaviour

working DB connection

Actual behaviour

error mesg related to pwd

Steps to reproduce

install on syno docker

Docker info

Server:
 Containers: 18
  Running: 8
  Paused: 0
  Stopped: 10
 Images: 43
 Server Version: 20.10.3
 Storage Driver: btrfs
  Build Version: Btrfs v4.0
  Library Version: 101
 Logging Driver: db
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs db fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2 io.containerd.runtime.v1.linux
 Default Runtime: runc
 Init Binary: docker-init

...
Kernel Version: 4.4.59+
 OSType: linux
 Architecture: x86_64

Version

  • Docker compose version (type docker-compose --version):
  • System info (type uname -a):
    docker-compose version 1.28.5, build 1bbbad71
    Linux ds218 4.4.59+ #25556 SMP PREEMPT Sat Aug 28 02:17:26 CST 2021 x86_64 GNU/Linux synology_apollolake_218+

Docker compose

see above

Container logs

see above

Additional info

tx !

ok might have a workaround, went to bash in the postgres container, then
psql
\password

and re-entered the same password...

=)

Nice. I guess you initialized the dsmrreader database earlier with a different password maybe? Anyway, sometimes the order of setting up DSMR Reader messes up things. Maybe I`ll update the README with some better initial steps. However, closing this issue now as it has been resolved.