Because the API can no longer start with an empty configuration file, a factory reset makes it unusable. Instead of crashing altogether (which would be unrecoverable), I made it run a subset of routes until the configuration is valid.
All unsupported routes should (and will) return 503 Service Unavailable during such a restart (it’s a bug at the moment). However, the Dashboard queries GET /v1/workspace and breaks because it gets a 404:
What it should do instead is:
When receiving a 503 (no matter the route), display a full screen saying something like “Service Unavailable” “It’s likely your server is missing some configuration, please contact an admin to fix this. Once the configuration file is valid, press the button below:”
“[Reload]” → calls POST /reload
- If the response is
202 Accepted, refresh the page.
- If the response is
401 Unauthorized or 403 Forbidden, it means someone else did the reload and the API now works correctly. Make sure to not reset the user token, then refresh the page.
Because the API can no longer start with an empty configuration file, a factory reset makes it unusable. Instead of crashing altogether (which would be unrecoverable), I made it run a subset of routes until the configuration is valid.
All unsupported routes should (and will) return 503 Service Unavailable during such a restart (it’s a bug at the moment). However, the Dashboard queries
GET /v1/workspaceand breaks because it gets a 404:What it should do instead is:
When receiving a 503 (no matter the route), display a full screen saying something like “Service Unavailable” “It’s likely your server is missing some configuration, please contact an admin to fix this. Once the configuration file is valid, press the button below:”
“[Reload]” → calls
POST /reload202 Accepted, refresh the page.401 Unauthorizedor403 Forbidden, it means someone else did the reload and the API now works correctly. Make sure to not reset the user token, then refresh the page.