Skip to content

Backups and restores fail on the workers: No module named 'fastapi' #660

Closed

Description

@Valtora

Backups, restores and the six-hourly backup cleanup all fail on the workers with ModuleNotFoundError: No module named 'fastapi'.

create_backup_task, restore_backup_task and cleanup_backup_artifacts in backend/worker/tasks/system.py import backend.core.backup, whose restore stages import backend/utils/document_storage.py, which imports HTTPException from FastAPI at module level. The worker images install requirements/worker.txt, which has no FastAPI. The chain arrived with #571 (22 Oct), so no release has it. CI installs both requirement sets together, so the suite never saw it.

Fix: keep FastAPI out of modules the workers import, and add a test that imports every worker task module with FastAPI unavailable.

Ours

Activity

  1. self-assigned this
    on Oct 23, 2026
  2. added
    bugSomething isn't working
    severity:highMajor function broken with no easy workaround.
    scope:backendBackend API and shared backend code.
    scope:workerCelery worker, ML, and the processing pipeline.
    on Oct 23, 2026
  3. Valtora commented on Oct 23, 2026

    @Valtora
    OwnerAuthor

    Fixed by #663. document_storage no longer imports FastAPI, the daily temp cleanup imports storage hygiene inside its guard, and a new test imports every module the workers can reach with the backend-only packages blocked. Both live worker images import all of them cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingscope:backendBackend API and shared backend code.scope:workerCelery worker, ML, and the processing pipeline.severity:highMajor function broken with no easy workaround.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions