You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(setup): don't start managed Postgres with a password the volume will ignore
POSTGRES_PASSWORD only applies when initdb runs on an empty data directory. The sim-postgres-data volume outlives its container (sim down keeps it, docker rm keeps it, and the wizard's own recreate path keeps it), and inspectManagedContainer recovers the password from the *container*, not the volume — so once the container is gone the password is unrecoverable.
Setup then generated a fresh password and ran against the initialized volume. Postgres kept its original password and rejected every connection with 'password authentication failed for user postgres', which surfaced as a misleading 'container did not become healthy'.
Detect an already-bootstrapped volume (PG_VERSION present) before choosing a password, and ask: supply the existing password, or delete the volume and start fresh (double-confirmed, since that destroys data). Refusing both fails with the exact docker volume rm command instead of looping.
`The ${DB_VOLUME} volume already contains a database, but its password is not recoverable — Postgres ignores POSTGRES_PASSWORD on an existing data directory.`
162
+
)
163
+
constchoice=awaitp.select({
164
+
message: 'How should the wizard proceed?',
165
+
options: [
166
+
{
167
+
value: 'password',
168
+
label: 'Keep the data — I have its password',
169
+
hint: 'from a previous .env, or your notes',
170
+
},
171
+
{
172
+
value: 'wipe',
173
+
label: 'Delete the old data and start fresh',
174
+
hint: `removes the ${DB_VOLUME} volume — this cannot be undone`,
175
+
},
176
+
],
177
+
initialValue: 'password',
178
+
})
179
+
if(choice==='password'){
180
+
returnp.password({
181
+
message: `Password for the existing ${DB_VOLUME} database`,
0 commit comments