Use this runbook when the backend is deployed but unhealthy, returning 502s, failing websocket upgrades, or needing a quick rollback.
Run from your local machine:
BACKEND_HOST=ws.bobsgame.com BACKEND_USER=root DOMAIN_NAME=ws.bobsgame.com ./scripts/collect-backend-diagnostics.shBefore any planned maintenance-window restart, capture a read-only readiness snapshot too:
BACKEND_HOST=5.161.250.43 BACKEND_URL=https://ws.bobsgame.com EXPECTED_BACKEND_VERSION=2.1.52 ./scripts/snapshot-backend-restart-readiness.shThis will show:
- systemd status
- journal logs
- nginx config test
- listening ports
- local health checks
ssh root@ws.bobsgame.com "sudo systemctl restart bobsgameweb-server && sudo systemctl status bobsgameweb-server --no-pager"ssh root@ws.bobsgame.com "sudo nginx -t && sudo systemctl reload nginx"BACKEND_HOST=ws.bobsgame.com BACKEND_USER=root DOMAIN_NAME=ws.bobsgame.com ./scripts/install-backend-service.shBACKEND_HOST=ws.bobsgame.com BACKEND_USER=root BACKEND_INSTALL_DEPS=1 ./scripts/deploy-backend-vps.shBACKEND_URL=https://ws.bobsgame.com ./scripts/check-backend-host.shFor a controlled maintenance-window restart with pre/post checks, prefer:
BACKEND_HOST=5.161.250.43 BACKEND_URL=https://ws.bobsgame.com EXPECTED_BACKEND_VERSION=2.1.52 ./scripts/run-backend-maintenance-restart.shThat helper is dry-run by default. It only performs the restart if EXECUTE_BACKEND_RESTART=1 is explicitly supplied.
For the complete ordered maintenance-window flow, see MAINTENANCE_WINDOW_RUNBOOK.md.
Afterward, compare the current state against the saved readiness snapshot with:
SNAPSHOT_FILE=artifacts/pre-restart.txt BACKEND_HOST=5.161.250.43 BACKEND_URL=https://ws.bobsgame.com EXPECTED_BACKEND_VERSION=2.1.52 ./scripts/compare-backend-restart-snapshot.shIf the frontend has already been rebuilt to the new backend but the backend is unstable:
Rebuild frontend against the previous known-good backend URL and redeploy.
Temporarily point DNS for ws.bobsgame.com back to the previous backend if one exists.
Do not rebuild/redeploy the frontend to target the backend host until:
/healthzworks/socket.io/?EIO=4&transport=pollingworks- nginx is passing traffic
- TLS is valid
If the backend deploy is too broken and time-sensitive rollback is needed:
- stop using the new backend host in the frontend build
- redeploy frontend pointing to the previous known-good backend
- debug the VPS independently using the diagnostics helper