Summary
Deleting a PostgreSQL database in Cleavr while it’s still actively used by a running Strapi 5 app removes it from the Cleavr UI but does not drop it on the DB server. After that, attempting to create a database with the same name in Cleavr consistently returns “Error creating database”, even though the database is actually created on the DB server.
Description
Environment
- Provider: Hetzner (separate App server + Database server)
- Database: PostgreSQL
- Backend: Strapi 5
- Managed via Cleavr
Problem
-
I created a PostgreSQL database on the DB server and a Strapi site on a separate app server.
-
I configured the DB credentials in the Strapi
.envand started the app (active DB connection). -
Without stopping the app, I deleted the database from the Cleavr interface.
-
Cleavr removed the database from the UI, but the database still existed on the DB server because it was still in use / had active connections.
- Cleavr did not warn or prevent deleting an “active/in-use” database.
-
To fully remove it, I must stop the app or manually terminate PostgreSQL connections, then drop the database.
-
After that, when I try to create a database again in Cleavr using the exact same database name, Cleavr always shows: “Error creating database”.
- However, the database does get created on the DB server successfully.
- Cleavr then fails to reflect/manage it properly in the UI, so the UI state becomes inconsistent with the real server state.
Expected behavior / Suggestions
-
When deleting a database with active connections:
- Show a clear warning and block deletion, or provide an option to safely terminate sessions and drop it properly.
-
When creating a database:
- If creation succeeds on the server, Cleavr should not return an error, and it should always display/manage the DB correctly in the UI.
-
Add visibility on app connections:
- It would be helpful to show which database an app/site is currently connected to (or last known DB connection) to avoid accidental deletion of an active DB.
Impact
- Inconsistent state between Cleavr UI and the actual PostgreSQL server.
- Misleading error message during DB creation (UI says failure while server succeeds).
- Extra manual steps and risk of orphaned/untracked databases.