generated from john/python-template
3.3 KiB
3.3 KiB
V1 Operations Runbook
This runbook provides day-2 operational procedures for the V1 baseline.
Scope
Applies to:
- local/hosted V1 runtime
- SQLite-backed persistence
- in-process worker lifecycle
- OpenRouter provider integration
Preconditions
.envcontainsOPENROUTER_API_KEY- app starts successfully
uploads/andprompts/are writable- health endpoint responds at
/healthz
Standard Startup Procedure
- Start the app using the project-standard command.
- Open
/healthzand verify{"status":"ok"}. - Open
/ui/uploadand submit a small valid file. - Confirm job transitions from
queued->processing->transcribed(orfailedwith detail).
Standard Shutdown Procedure
- Stop the application process.
- Ensure no active process still holds the SQLite file.
- If maintenance is planned, copy the DB file before edits:
transcription.db(or configuredDATABASE_URLfile path)
Incident: Jobs Stuck In processing
Symptoms
- Jobs remain
processingfor longer than provider timeout - New uploads queue but do not complete
- provider usage increases but no terminal job state is visible
Checks
- Confirm app process is still running.
- Confirm worker loop is active (startup logs include worker lifespan start).
- Inspect recent app logs for:
worker.process_joberror_idcategoryjob_id/document_id/source_id
- Verify provider credentials and provider status.
Recovery
- Restart the app to trigger stale-processing recovery.
- On startup, app re-queues stale processing jobs based on timeout policy.
- Re-check jobs page and confirm terminal state progression.
- If persistent, capture logs + error IDs and move to deep investigation.
Incident: Provider Authentication Failures
Symptoms
- failures categorized as provider/auth
- jobs fail quickly with authentication guidance
Recovery
- Validate
OPENROUTER_API_KEYvalue. - Restart app after updating env.
- Re-run a small transcription to confirm recovery.
Incident: Upload Failures
Symptoms
- UI reports upload errors
- unsupported extension or empty payload
Recovery
- Validate file extension (
.jpg,.jpeg,.png,.tif,.tiff,.pdf). - Validate file is not empty.
- Validate upload directory permissions.
- Retry upload.
Incident: Database File/Permission Issues
Symptoms
- persistence errors during upload/job update
- startup failures around schema/runtime
Recovery
- Confirm the configured DB file path exists and is writable.
- Confirm parent directory permissions.
- Restore from last known backup copy if corruption is suspected.
- Restart app and run smoke test.
Logging Requirements (Operational)
Operational triage should always capture:
error_id- category
- operation name
job_id,document_id,source_idwhen applicable- UTC timestamp
Escalation Packet (When opening an issue)
Include:
- exact timestamp window
- one failing
job_id - relevant
error_idvalues - latest 100 lines of app logs
- environment summary (
DATABASE_URLtype, app version/commit)
Post-Incident Validation
After mitigation, verify:
- Upload works.
- One job reaches
transcribed. - One induced failure reaches
failedwith error detail. - Jobs page and detail page render correctly.