Skip to content

Storage reset failure leaves storage status active #69

@Galaxync

Description

@Galaxync

Storage reset failure leaves storage status active

Summary

When reset_storage() fails, the exception path records the error but still sets the storage status to active. This can make a failed reset look successful and allow old data to continue being treated as healthy storage state.

Proof of concept

  1. Log in as a team admin or owner.
  2. Trigger a storage reset:
POST /<team_slug>/storage/<storage_name>?fragment=danger HTTP/1.1
Cookie: session=<team-admin-session>
Content-Type: application/x-www-form-urlencoded

reset_storage=Reset&csrf_token=<valid>
  1. Cause the underlying reset operation to fail, for example by making the volume/database reset path raise a permissions or deletion error.
  2. The worker enters the exception path and persists:
status = "active"
error.stage = "reset_database" or "reset_volume"
error.message = <exception>

Evidence

  • app/workers/tasks/storage.py:96 implements reset_storage().
  • app/workers/tasks/storage.py:127-135 handles failure and still sets storage.status = "active".
  • app/routers/team.py:339-354 triggers the reset job for team admins.

Expected behavior

If reset fails, storage should be marked failed or restored to its previous state. The UI and business logic should not treat the storage as successfully reset.

Actual behavior

The failure path stores an error but leaves the storage status as active.

Impact

Users may believe the storage was cleared even though old data remains. Later operations can continue using a storage resource whose reset failed.

Suggested fix

Set status = "failed" or restore the previous state in the exception path. Consider blocking normal use while error is populated after a reset failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions