1.3 KiB
1.3 KiB
Database Authentication Issue Fixed
Problem
- PostgreSQL authentication was failing with error code 28P01 "password authentication failed for user 'quixotic'"
- The docker-compose.yml had default password
quixotic123but .env.docker had different passwordGGkM0a6r7pw3F65ZvYbbuOgbt7gO2AoW3JynEk7m9Go= - Secondary issue: table creation conflicts due to SERIAL sequences being created multiple times
Solution
-
Password sync: Removed postgres container and volume to reset with correct password from .env.docker
docker compose down postgres docker volume rm quixotic_postgres-data docker compose up postgres -d -
Table creation fix: Modified database.ts to check table existence before creating:
- Added proper table existence check using information_schema
- Removed
CREATE TABLE IF NOT EXISTSwhich wasn't handling SERIAL sequences properly - Added logging for better debugging
Commands used
docker compose down postgres
docker volume rm quixotic_postgres-data
docker compose up postgres -d
docker compose build quixotic-app
docker compose up quixotic-app -d
Result
- Database authentication working
- No more table creation conflicts
- App starts successfully with "Database tables already exist" message