But it’s failing the health checks now and not coming back up:
failed post-init: failed to establish connection to local node: failed to connect to `host=fdaa:a:87f5:a7b:a:87cd:572a:2 user=postgres database=postgres`: dial error (dial tcp [fdaa:a:87f5:a7b:a:87cd:572a:2]:5433: connect: connection refused). Retrying...
Now that I took another look, I totally messed up work_mem when converting units.
Is there anything I can do to recover from this, or am I stuck deleting the app/machine and recreating from scratch?
If I’m stuck deleting it this time, is there anything in the future I can do to make recovering from similar easier?
Tried reverting the config, but I’m getting Error: no active leader found now.
Swapping the attachment was a bit wonky, but worked.
$ fly postgres attach foobar2 --app foobar
Checking for existing attachments
Error: consumer app "foobar" already contains a secret named DATABASE_URL
$ fly postgres detach foobar1 --app foobar
Error: no active leader found
$ fly secrets unset DATABASE_URL --app foobar
Updating existing machines in 'foobar' with rolling strategy
$ fly postgres attach foobar2 --app foobar
Checking for existing attachments
? Database "foobar" already exists. Continue with the attachment process? Yes
Error: database user "foobar" already exists. Please specify a new database user via --database-user
# manually `DROP USER foobar;`, then retry
$ fly postgres attach foobar2 --app foobar
# success
As that was happening, my application hit the max restarts and stopped. Couldn’t get it to start back up through the web UI by pressing start, but fly machine restart brought it back up with the new database config.