Skip to content

fix: create pg_wal if missing before single-user mode#19

Merged
passcod merged 1 commit intomainfrom
fix/create-pg-wal-if-missing
Mar 20, 2026
Merged

fix: create pg_wal if missing before single-user mode#19
passcod merged 1 commit intomainfrom
fix/create-pg-wal-if-missing

Conversation

@passcod
Copy link
Copy Markdown
Member

@passcod passcod commented Mar 20, 2026

Snapshots from Windows PostgreSQL installs (EDB/BigSQL layout) do not include pg_wal if it lives outside the snapshotted directory. This caused setup-auth to fail immediately with:

FATAL:  required WAL directory "pg_wal" does not exist

The fix creates an empty pg_wal before invoking postgres --single if it's absent. Postgres will initialise a fresh WAL segment inside it and proceed with crash recovery normally.

Observed on tamanu-replica-palau-dev and tamanu-replica-palau-prod (PG 12, Windows source host).

Snapshots from Windows PostgreSQL installs (EDB/BigSQL layout) may not
include pg_wal if it lives outside the snapshotted directory. Creating
an empty pg_wal allows postgres --single to start and complete crash
recovery; it will initialise a new WAL segment on its own.
@passcod passcod merged commit f091bd4 into main Mar 20, 2026
18 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.

1 participant