Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB Auth Error #43

Open
BadCo-NZ opened this issue Sep 5, 2021 · 3 comments
Open

DB Auth Error #43

BadCo-NZ opened this issue Sep 5, 2021 · 3 comments

Comments

@BadCo-NZ
Copy link

BadCo-NZ commented Sep 5, 2021

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:
@maxhollmann
Copy link
Collaborator

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

docker-compose exec db bash

# inside the db shell:
psql -U podify

@BadCo-NZ
Copy link
Author

BadCo-NZ commented Sep 6, 2021

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 | {}

@madindehead
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants