podify-org/podify

DB Auth Error

BadCo-NZ opened this issue · 3 comments

Hi, I have fired up the docker-compose in portainer as a stack, and I am having issues with the DB User password.

2021-09-05 07:20:33.021 UTC [32] FATAL: password authentication failed for user "podify"
2021-09-05 07:20:33.021 UTC [32] DETAIL: Password does not match for user "podify".
Connection matched pg_hba.conf line 95: "host all all all md5"

Here is my compose file, obviously the passwords do match, could I be missing something else?

version: '3.4'

x-app-defaults: &app-defaults
  restart: always
  environment: &app-env
    URL_HOST: https://podify.domain.com
    DATABASE_URL: postgres://podify:password@db/podify
    REDIS_URL: redis://redis
    SECRET_KEY_BASE: supersecretkey
    RAILS_LOG_TO_STDOUT: "yes"
    STORAGE_DIR: /storage
    INITIAL_USER_EMAIL: badco@domain.com
    INITIAL_USER_PASSWORD: password
    ENABLE_SIGNUP: "no"

  volumes:
    - storage:/storage

  depends_on:
    - db
    - redis

services:
  web:
    <<: *app-defaults
    image: maxhollmann/podify-web:latest
    ports:
      - 3000:3000
    environment:
      <<: *app-env

  worker:
    <<: *app-defaults
    image: maxhollmann/podify-worker:latest
    environment:
      <<: *app-env

  db:
    image: postgres:12.3
    restart: always
    environment:
      POSTGRES_USER: podify
      POSTGRES_DB: podify
      POSTGRES_PASSWORD: password
      PGDATA: /var/lib/postgresql/data/pgdata
    volumes:
      - pgdata:/var/lib/postgresql/data/pgdata

  redis:
    image: redis:6
    restart: always

volumes:
  storage:
  pgdata:

Could you check whether you can connect manually using these credentials?

docker-compose exec db bash

# inside the db shell:
psql -U podify

Seems to work:

root@5c588fa66840:/# psql -U podify
psql (12.3 (Debian 12.3-1.pgdg100+1))
Type "help" for help.

podify=# \l
                              List of databases
   Name    | Owner  | Encoding |  Collate   |   Ctype    | Access privileges 
-----------+--------+----------+------------+------------+-------------------
 podify    | podify | UTF8     | en_US.utf8 | en_US.utf8 | 
 postgres  | podify | UTF8     | en_US.utf8 | en_US.utf8 | 
 template0 | podify | UTF8     | en_US.utf8 | en_US.utf8 | =c/podify        +
           |        |          |            |            | podify=CTc/podify
 template1 | podify | UTF8     | en_US.utf8 | en_US.utf8 | =c/podify        +
           |        |          |            |            | podify=CTc/podify
(4 rows)

podify=# \du
                                   List of roles
 Role name |                         Attributes                         | Member of 
-----------+------------------------------------------------------------+-----------
 podify    | Superuser, Create role, Create DB, Replication, Bypass RLS | {}

I'm seeing the same issue. See #44.