oae / kaizoku

Self-hosted manga downloader
https://kaizoku.app
MIT License
578 stars 34 forks source link

[Issue] Postgres authentication issues #20

Closed axsddlr closed 2 years ago

axsddlr commented 2 years ago

Following README docker-compose

Logs

DB container

2022-10-28 18:02:31.577 UTC [823] DETAIL:  Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"
2022-10-28 18:02:36.057 UTC [831] FATAL:  password authentication failed for user "kaizoku"

Main app container

[14:04:27.002] ERROR (4491): 
Invalid `prisma.manga.findMany()` invocation:
Authentication failed against database server at `db`, the provided database credentials for `kaizoku` are not valid.
Please make sure to provide valid database credentials for the database server at `db`.
oae commented 2 years ago

Can you share your exact docker-compose file? Because I am not able to reproduce this with the example inside README.

axsddlr commented 2 years ago

Can you share your exact docker-compose file? Because I am not able to reproduce this with the example inside README.

version: '3'

volumes:
  db:
  redis:

services:
  app:
    container_name: kaizoku
    image: ghcr.io/oae/kaizoku:latest
    environment:
      - DATABASE_URL=postgresql://kaizoku:kaizoku@db:5432/kaizoku
      - KAIZOKU_PORT=3000
      - REDIS_HOST=redis
      - REDIS_PORT=6379
      - PUID=1000
      - PGID=1000
      - TZ=America/New_York
    volumes:
      - /home/node1/Manga:/data
      - /home/node1/docker_configs/kaizoku/config:/config
      - /home/node1/docker_configs/kaizoku/logs:/logs
    depends_on:
      db:
        condition: service_healthy
    ports:
      - '3011:3000'
  redis:
    image: redis:7-alpine
    volumes:
      - redis:/data
  db:
    image: postgres:alpine
    restart: unless-stopped
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready -U kaizoku']
      interval: 5s
      timeout: 5s
      retries: 5
    environment:
      - POSTGRES_USER=kaizoku
      - POSTGRES_DB=kaizoku
      - POSTGRES_PASSWORD=kaizoku
    volumes:
      - db:/var/lib/postgresql/data
oae commented 2 years ago

I tried this exact configuration and I don't have this problem. Maybe your db volume was created with the older credentials before. Can you try it on a fresh db?

axsddlr commented 2 years ago

I tried this exact configuration and I don't have this problem. Maybe your db volume was created with the older credentials before. Can you try it on a fresh db?

deleted image, volume and tried again on my amd64 machine, same issue

oae commented 2 years ago

Can you add ports to db container and access it with a database tool? I don't have any solution to this problem.

axsddlr commented 2 years ago

ill comeback to this project when issues are sorted or sqlite locally is supported

axsddlr commented 2 years ago

building straight from source alpine linux

image

oae commented 2 years ago

You need buildkit to build. https://docs.docker.com/build/buildkit/

axsddlr commented 2 years ago

isnt that something shouldve been in the image already?

oae commented 2 years ago

It is not about the image. Buildkit provides a caching mechanism to improve build times. Images that are being released are built with docker buildkit. If you want to create an image, you need to enable it for your docker.