What: routes/new_server.py rollback uses shutil.rmtree(target, ignore_errors=True) plus db.delete_server(...) with no transactional guarantee.
Why: A partial failure (scaffold succeeds, DB insert fails, then rmtree fails) leaves the host in an inconsistent state with no automated recovery.
Approach: Either (a) add a reconcile task that detects orphan dirs / orphan DB rows on startup, or (b) at minimum, log and surface the failed cleanup path so an operator can act.
What:
routes/new_server.pyrollback usesshutil.rmtree(target, ignore_errors=True)plusdb.delete_server(...)with no transactional guarantee.Why: A partial failure (scaffold succeeds, DB insert fails, then rmtree fails) leaves the host in an inconsistent state with no automated recovery.
Approach: Either (a) add a reconcile task that detects orphan dirs / orphan DB rows on startup, or (b) at minimum, log and surface the failed cleanup path so an operator can act.