Situation #
The Dispatch server stays silent, answers safe_mode, or reports damaged data after a power cut, a crash or a disk fault.
What keeps working #
- Your records stay on disk. A forced stop leaves the database consistent, because every change is written as a whole transaction.
- Reading, exporting and backing up keep working in safe mode.
- Drivers' queued writes wait on their phones and send again with their idempotency keys when the server returns, so nothing posts twice. See "Safe retries (idempotency)".
- Deliveries to webhooks wait in the queue and send after the server returns.
Steps #
- Check the server computer. Is it on, connected and out of disk space? Open
/healthfrom the server itself. - Look at the answer.
- No answer: start the server (
dispatch-server serve). Read the first lines of its log. If the data folder, port or licence settings are wrong, the message says which. ok: true: the server is well. Check the office network and the address people use.safe_mode: true: the server crashed three times in five minutes. Keep the newest file in thecrashfolder of the data folder, and go to step 4 after five quiet minutes.ok: falsewith the banner "The app needs your help": the safety check found a problem. Go to step 4.
- No answer: start the server (
- Give dispatchers a fallback while you work: take calls on paper with the pickup address, phone number and time, and enter them when the server returns.
- Restore the newest good backup.
- Stop the server.
- Open the
backupsfolder in the data folder. Pick the newest folder by time. - Run
dispatch-server restore --from <that folder> --data-dir <data folder>. - Read the message. It names each owner and gives their
reset-passwordcommand.
- Run
reset-passwordfor each owner, then for everyone else. Each person gets a one-time password and chooses their own at sign-in. - Start the server. Owners and managers set up the authenticator app again. Make a new signing secret for each webhook endpoint.
- If the restore reports a failed check, try the next older backup. Your data from before the restore stays safe as the before-restore backup.
How to confirm it worked #
/healthanswersok: trueandsafe_mode: false.- The owner signs in and
GET /tow/boardshows the calls you expect. - Open an invoice: its lines and payments are in step, because every invoice passes an integrity check when it is read.
- Take a call and see it on the board.
Afterwards #
- Enter the calls you took on paper.
- Anything done after the backup time is missing. Ask drivers for their queued work and dispatchers for recent calls.
- Find the cause: disk space, a power cut, hardware. Read the newest crash log.
- Make a backup now, and check that tomorrow's nightly backup appears.
- Put the data folder on a disk with a nightly copy. See "Setting up the office server".