Skip to content

Sync endpoint returns 500 with unhelpful error when gateway not running #214

@isaacrowntree

Description

@isaacrowntree

Problem

POST /api/admin/storage/sync returns HTTP 500 with "Sync aborted: no config file found" when the gateway process hasn't started yet (or when config files are missing for other reasons). The error gives no context about why the config is missing.

Related to #207 — the cron sync handler already guards against this ([cron] Gateway not running yet, skipping sync), but the manual sync endpoint doesn't.

Expected behaviour

  • Return 409 (not 500) when gateway isn't running — it's a precondition, not a server error
  • When config files are missing but the gateway IS running, provide diagnostic info: what's in the config directories, what's in the R2 backup, whether R2 is responsive
  • Return 400 for other client-side errors like "R2 not configured"

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions