[GH-ISSUE #92] Using compose from readme - issue connecting to PG #73

Open
opened 2026-02-26 21:34:18 +03:00 by kerem · 1 comment
Owner

Originally created by @stanthewizzard on GitHub (Feb 7, 2025).
Original GitHub issue: https://github.com/eduardolat/pgbackweb/issues/92

Hello

Here is my compose:

services:
  pgbackweb:
    image: eduardolat/pgbackweb:latest
    container_name: pgbackweb
    ports:
      - "48085:8085" # Access the web interface at http://localhost:8085
    volumes:
      - ./backups:/backups # If you only use S3 destinations, you don't need this volume
    environment:
      PBW_ENCRYPTION_KEY: "yffgDKX1eXQR" # Change this to a strong key
      PBW_POSTGRES_CONN_STRING: "postgresql://postgres:password@postgres:5432/pgbackweb?sslmode=disable"
      TZ: "Europe/Paris" # Set your timezone, optional
    depends_on:
      postgres:
        condition: service_healthy

  postgres:
    image: postgres:17
    container_name: pgbackweb_DB
    environment:
      POSTGRES_USER: postgres
      POSTGRES_DB: pgbackweb
      POSTGRES_PASSWORD: password
    ports:
      - "5432:5432"
    volumes:
      - ./data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      timeout: 5s
      retries: 5

task: [migrate-serve] task goose -- up
2025/02/07 15:31:22 goose run: failed to connect to user=postgres database=pgbackweb: 172.20.0.2:5432 (postgres): failed SASL auth: FATAL: password authentication failed for user "postgres" (SQLSTATE 28P01)
task: Failed to run task "goose": exit status 1
task: Failed to run task "migrate-serve": exit status 201

Thanks for help

Originally created by @stanthewizzard on GitHub (Feb 7, 2025). Original GitHub issue: https://github.com/eduardolat/pgbackweb/issues/92 Hello Here is my compose: ``` services: pgbackweb: image: eduardolat/pgbackweb:latest container_name: pgbackweb ports: - "48085:8085" # Access the web interface at http://localhost:8085 volumes: - ./backups:/backups # If you only use S3 destinations, you don't need this volume environment: PBW_ENCRYPTION_KEY: "yffgDKX1eXQR" # Change this to a strong key PBW_POSTGRES_CONN_STRING: "postgresql://postgres:password@postgres:5432/pgbackweb?sslmode=disable" TZ: "Europe/Paris" # Set your timezone, optional depends_on: postgres: condition: service_healthy postgres: image: postgres:17 container_name: pgbackweb_DB environment: POSTGRES_USER: postgres POSTGRES_DB: pgbackweb POSTGRES_PASSWORD: password ports: - "5432:5432" volumes: - ./data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 5 ``` task: [migrate-serve] task goose -- up 2025/02/07 15:31:22 goose run: failed to connect to `user=postgres database=pgbackweb`: 172.20.0.2:5432 (postgres): failed SASL auth: FATAL: password authentication failed for user "postgres" (SQLSTATE 28P01) task: Failed to run task "goose": exit status 1 task: Failed to run task "migrate-serve": exit status 201 Thanks for help
Author
Owner

@stanthewizzard commented on GitHub (Feb 7, 2025):

Answering myself

create reset_password.sql via
nano reset_password.sql
with
ALTER USER postgres WITH PASSWORD 'xxxxxxxxxxxxxxxxxxxxx';

then
cat reset_password.sql | docker exec -i pgbackweb_DB psql -U postgres

docker compose down

sudo docker compose up -d

<!-- gh-comment-id:2643124956 --> @stanthewizzard commented on GitHub (Feb 7, 2025): Answering myself create reset_password.sql via nano reset_password.sql with `ALTER USER postgres WITH PASSWORD 'xxxxxxxxxxxxxxxxxxxxx';` then `cat reset_password.sql | docker exec -i pgbackweb_DB psql -U postgres` `docker compose down ` `sudo docker compose up -d`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/pgbackweb#73
No description provided.