chiefonboarding / ChiefOnboarding

Free and open-source employee onboarding platform. Onboard new hires through Slack or the web portal.
https://chiefonboarding.com
GNU Affero General Public License v3.0
640 stars 119 forks source link

Password authentication failed for user [DOCKER] #423

Closed drmcentee closed 5 months ago

drmcentee commented 5 months ago

Running via Docker Compose I get the following error:

  File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 289, in ensure_connection
    self.connect()
  File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 270, in connect
    self.connection = self.get_new_connection(conn_params)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/db/backends/postgresql/base.py", line 275, in get_new_connection
    connection = self.Database.connect(**conn_params)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/psycopg/connection.py", line 745, in connect
    raise last_ex.with_traceback(None)
psycopg.OperationalError: connection failed: FATAL:  password authentication failed for user "postgres"

My Docker compose file, with some redactions:

version: '3'

services:
  db:
    image: postgres:latest
    restart: always
    expose:
      - "5432"
    volumes:
      - pgdata:/var/lib/postgresql/data/
    environment:
      - POSTGRES_DB=chiefonboarding
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    networks:
      - traefik_default

  web:
    image: chiefonboarding/chiefonboarding:latest
    restart: always
    expose:
      - "8000"
    environment:
      - SECRET_KEY=12FC6598DEC26
      - BASE_URL=https://start.REDACTED.com
      - DATABASE_URL=postgres://postgres:postgres@db:5432/chiefonboarding
      - ALLOWED_HOSTS=start.REDACTED.com
    depends_on:
      - db
    networks:
      - traefik_default
    labels:
      traefik.enable: true
      traefik.http.routers.start.entrypoints: websecure
      traefik.http.routers.start.rule: Host(`start.REDACTED.com`)
      traefik.http.routers.start.tls: true
      traefik.http.routers.start.tls.certresolver: staging

volumes:
  pgdata:

networks:

  traefik_default:
    external: true
    name: "traefik_default"

While I can get to the login screen, and sometimes to other parts, in general I get a 500 error. I've tried a variety of user/password combinations which doesn't fix the error I notice there was a previous issue with authentication, perhaps it's something similar

drmcentee commented 5 months ago

Conflicting database with other docker container