As the title says, I deleted the postgres
database, as I thought it wasn’t needed (flyctl automatically created a database with the name of my app during setup), and now PostgreSQL won’t start.
I’m getting the following output repeated in the metrics, from a cmd/keeper.go
file:
FATAL: database "postgres" does not exist
The reason I deleted it was that I was trying to do a pg_restore
of a dump from Heroku, which put all the data in the postgres
database, which isn’t the one my app is using, so I thought the easiest way to clean up would be to delete the postgres
database.
Has anyone done something equally bad, and found a solution?
I’m in the progress of deleting the database and creating it again which should solve my issue, but I’ll leave this issue here as this might be something someone else runs in to.
That did not work. After deleting the PostgreSQL instance and creating a new with flyctl pg create
it won’t start and keeps looping the following messages:
2022-06-16T19:42:02.371 app[41c69fac] fra [info] keeper | 2022-06-16T19:42:02.371Z INFO cmd/keeper.go:1504 our db requested role is master
2022-06-16T19:42:02.372 app[41c69fac] fra [info] keeper | 2022-06-16T19:42:02.372Z INFO cmd/keeper.go:1542 already master
2022-06-16T19:42:02.395 app[41c69fac] fra [info] keeper | 2022-06-16T19:42:02.395Z INFO cmd/keeper.go:1675 postgres parameters not changed
Looking around, it seems like you are using stolon - could the keeper
have gone into a bad state?
It’s the following health check that keeps failing - same thing happens if I delete and create a new pg app:
pg | critical | 8b6164c1 | fra | HTTP | 17m36s ago | HTTP GET http://X.X.X.X:5500/flycheck/pg: 500 Internal Server Error Output: "failed to connect to proxy: context deadline exceeded"[✓]
Okay, I tried creating a new database with a different name, which works fine. So somehow the name I used when it stopped working is in a bad state, and whenever I try to recreate a database with the same name, it fails.