BUG: API delete endpoint does not stop/remove Docker container — orphaned containers #106
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: HIGH
File & Line
internal/handlers/api.go:283-305Description
HandleAPIDeleteAppcallsh.appService.DeleteApp()which only deletes the database record (with CASCADE). It does not callh.cleanupContainer()to stop and remove the running Docker container.Compare with the HTML handler
HandleAppDelete(app.go:325) which correctly cleans up:Impact
Deleting an app via the API leaves its Docker container running forever. The container has
restart: unless-stoppedpolicy, so it will persist across Docker daemon restarts. Since the DB record is gone, upaas has no way to discover or manage the orphaned container.Suggested Fix
Call
h.cleanupContainer(request.Context(), appID, application.Name)before deleting the app record, same as the HTML handler.