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