Skip to content

Operations, Maintenance & Disaster Recovery

This guide provides system operators with procedures for maintaining, troubleshooting, and recovering self-hosted brūhi Cloud instances.


brūhi Cloud runs as a multi-process container supervised by supervisord, coupled with a Caddy reverse proxy:

┌────────────────────────────────────────────────────────┐
│ bruhi-caddy │
│ (Port 80, 443 / SSL & HTTP/3 Ingress) │
└──────────────────────────┬─────────────────────────────┘
│ Reverse Proxy :8000
▼
┌────────────────────────────────────────────────────────┐
│ bruhi-cloud │
│ ┌──────────────────────────────────────────────────┐ │
│ │ FastAPI Server & SvelteKit UI (:8000) │ │
│ └───────────────────────┬──────────────────────────┘ │
│ │ localhost:7700 │
│ ┌───────────────────────▼──────────────────────────┐ │
│ │ bruhi-audio Playout Engine (Daemon) │ │
│ └──────────────────────────────────────────────────┘ │
└────────────────────────────────────────────────────────┘
Terminal window
# 1. Check container running state and restart counts
docker compose ps
# 2. Query HTTP health check endpoint
curl -i http://localhost:8000/healthz
# Expected output: HTTP/1.1 200 OK -> {"status":"ok"}
# 3. Verify internal playout engine status
docker compose exec bruhi-cloud curl -s http://localhost:7700/healthz
# 4. Check live HLS output generation in RAM tmpfs
docker compose exec bruhi-cloud ls -lh /hls

Production environments configured via install.sh do not use git pull because ~/bruhi-cloud is a standalone configuration directory. Use curl to update definitions:

  1. Create Pre-Update Hot Backup

    Terminal window
    cd ~/bruhi-cloud
    docker compose exec bruhi-cloud sqlite3 /app/data/bruhi.db ".backup '/app/data/pre-update-$(date +%F).db'"
    docker compose cp bruhi-cloud:/app/data/pre-update-$(date +%F).db ./
  2. Refresh Deployment Files & Pull Image

    Terminal window
    curl -fsSL https://raw.githubusercontent.com/bruhi-technologies/bruhi-deploy/main/docker-compose.yml -o docker-compose.yml
    curl -fsSL https://raw.githubusercontent.com/bruhi-technologies/bruhi-deploy/main/Caddyfile -o Caddyfile
    docker compose pull
  3. Recreate Containers with Auto-Migration

    Terminal window
    docker compose up -d

    FastAPI applies missing SQLite migrations automatically during startup.

  4. Verify Operational State

    Terminal window
    docker compose ps
    curl -f http://localhost:8000/healthz
    docker compose logs --tail=50 bruhi-cloud

If an update introduces a regression or fails to boot:

  1. Stop the current stack:
    Terminal window
    docker compose down
  2. Pin the previously working container image tag in docker-compose.yml:
    image: ghcr.io/bruhi-technologies/bruhi-cloud:v0.22.0
  3. Restore the pre-update SQLite database:
    Terminal window
    docker compose run --rm -v bruhi-cloud_bruhi_db:/data alpine cp /data/pre-update-*.db /data/bruhi.db
  4. Restart the stack:
    Terminal window
    docker compose up -d

To restore a saved SQLite backup file (bruhi-backup.db) into the running container:

  1. Stop Application Container

    Terminal window
    docker compose stop bruhi-cloud
  2. Replace Database File in Docker Volume

    Terminal window
    docker run --rm \
    -v bruhi-cloud_bruhi_db:/data \
    -v $(pwd):/backup \
    alpine cp /backup/bruhi-backup.db /data/bruhi.db
  3. Verify SQLite Integrity

    Terminal window
    docker run --rm \
    -v bruhi-cloud_bruhi_db:/data \
    alpine sqlite3 /data/bruhi.db "PRAGMA integrity_check;"
    # Expected output: ok
  4. Restart Stack

    Terminal window
    docker compose start bruhi-cloud

Symptom: Recordings fail to save, SQLite writes fail with disk I/O error, or Docker crashes.

Recovery Steps:

  1. Check disk utilization:
    Terminal window
    df -h /
    docker system df
  2. Prune obsolete Docker images and build caches:
    Terminal window
    docker image prune -a --filter "until=72h" -f
  3. Remove old segment recordings from the audio volume:
    Terminal window
    docker compose exec bruhi-cloud find /app/audio_files/recordings -name "*.part" -mtime +2 -delete
  4. Configure S3 Object Storage offloading in Admin Dashboard → Storage & Maintenance to prevent local disk exhaustion.

Symptom: Logs show sqlite3.OperationalError: database is locked or database disk image is malformed.

Recovery Steps:

  1. Force a WAL checkpoint to truncate journal logs:
    Terminal window
    docker compose exec bruhi-cloud sqlite3 /app/data/bruhi.db "PRAGMA wal_checkpoint(TRUNCATE);"
  2. Check database integrity:
    Terminal window
    docker compose exec bruhi-cloud sqlite3 /app/data/bruhi.db "PRAGMA integrity_check;"
  3. If corruption is detected, dump and rebuild:
    Terminal window
    docker compose exec bruhi-cloud sqlite3 /app/data/bruhi.db ".dump" | docker compose exec -T bruhi-cloud sqlite3 /app/data/bruhi-repaired.db
    docker compose run --rm -v bruhi-cloud_bruhi_db:/data alpine mv /data/bruhi-repaired.db /data/bruhi.db
    docker compose restart bruhi-cloud

3. Audio Playout Engine Lockup or Dead Air

Section titled “3. Audio Playout Engine Lockup or Dead Air”

Symptom: Studio displays “Connecting to Audio Engine” or listener stream goes silent.

Recovery Steps:

  1. Check if the internal audio daemon is running:
    Terminal window
    docker compose exec bruhi-cloud ps aux | grep bruhi-audio
  2. Query the audio engine status directly:
    Terminal window
    docker compose exec bruhi-cloud curl -s http://localhost:7700/healthz
  3. Restart only the bruhi-cloud container without tearing down network volumes:
    Terminal window
    docker compose restart bruhi-cloud

Incident Escalation: What Information to Collect

Section titled “Incident Escalation: What Information to Collect”

Before escalating an outage or opening an issue on GitHub, capture the following diagnostics:

Terminal window
# 1. Collect container statuses and restart counts
docker compose ps > incident-report.txt
# 2. Collect recent application error logs
docker compose logs --tail=200 bruhi-cloud >> incident-report.txt
# 3. Collect reverse proxy access & SSL logs
docker compose logs --tail=100 caddy >> incident-report.txt
# 4. Record host resource metrics
uptime >> incident-report.txt
free -m >> incident-report.txt
df -h >> incident-report.txt
# 5. Check database integrity
docker compose exec bruhi-cloud sqlite3 /app/data/bruhi.db "PRAGMA integrity_check;" >> incident-report.txt