Skip to content

Conversation

@xar
Copy link
Owner

@xar xar commented Jun 28, 2025

Fixes authentication issue where PostgreSQL instance creation failed due to password prompts on TCP/IP connections.

The problem occurred during temporary PostgreSQL startup for database creation, where the code was using TCP/IP connections (-h 127.0.0.1) which require md5 authentication, but the postgres user doesn't have a password set during this phase.

The fix switches to Unix socket connections which use peer authentication and don't require passwords.

Fixes #43

🤖 Generated with Claude Code

Fixes authentication issue where temporary PostgreSQL instance creation
failed due to password prompts on TCP/IP connections.

Changes:
- Modified waitForPostgreSQLReady() to use Unix socket directory parameter
- Updated all psql commands to use Unix socket (-h socketDirectory) 
  instead of TCP/IP (-h 127.0.0.1) during temporary startup
- This uses peer authentication (no password) instead of md5 (password required)

The issue occurred because initdb sets --auth-host=md5 for TCP/IP connections
but the postgres user doesn't have a password set during temporary startup.
Unix socket connections use peer authentication which doesn't require passwords.

Fixes #43

Co-authored-by: Samuel <xar@users.noreply.github.com>
@xar xar merged commit cca9871 into main Jun 28, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

Still cannot connect to set user & password

2 participants