[NIEAKTYWNE — WAHA zdecommissioned 2026-06-30] WAHA zastąpiona przez
whatsup-android-chat-puller. Ten dokument zachowany jako archiwum historyczne. Patrz: issue #2007
Playbook: WAHA session STOPPED after reboot
Trigger
vps-h1 reboots (planned or unplanned) and the WhatsApp default session comes up in STOPPED state.
Symptoms: WhatsApp messages not received, webhook to n8n not firing, WAHA dashboard shows “STOPPED”.
Discovered: 2026-06-25 reboot.
Confirm
ssh root@72.60.32.61
WAHA_KEY=$(grep '^WAHA_API_KEY' /root/.env | cut -d= -f2-)
curl -s -H "X-Api-Key: $WAHA_KEY" http://localhost:13000/api/sessions/default | python3 -c "import sys,json; d=json.load(sys.stdin); print('status:', d.get('status'))"
# Expected WORKING, problem = STOPPEDStep-by-step fix
Immediate: Start the session via API
ssh root@72.60.32.61
WAHA_KEY=$(grep '^WAHA_API_KEY' /root/.env | cut -d= -f2-)
curl -s -X POST -H "X-Api-Key: $WAHA_KEY" -H "Content-Type: application/json" \
http://localhost:13000/api/sessions/default/start
sleep 10
curl -s -H "X-Api-Key: $WAHA_KEY" http://localhost:13000/api/sessions/default \
| python3 -c "import sys,json; d=json.load(sys.stdin); print('status:', d.get('status'))"
# Must show: status: WORKINGVerify webhook routing works
Send a test WhatsApp message to +49 1578 5573196 and confirm it appears in n8n.
Root cause (fixed in PR #1362)
Two bugs caused the session not to auto-start:
-
WHATSAPP_FILES_FOLDER=/app/sessions(no dot) didn’t match the volume mount at/app/.sessions. WAHA created a fresh empty sqlite DB on every container start, soWHATSAPP_RESTART_ALL_SESSIONSfound nothing to restart. -
WHATSAPP_RESTART_ALL_SESSIONS=trueis silently ignored on WAHA CORE tier (PLUS/PRO feature only).
Fixes applied (PR #1362, merged 2026-06-25):
WHATSAPP_FILES_FOLDER=/app/.sessions(matches volume)waha-session.servicesystemd unit: waits 30s after docker.service, polls/api/health, then callsPOST /api/sessions/default/start
Confirm permanent fix is in place
ssh root@72.60.32.61
# Check docker-compose has correct FILES_FOLDER
grep WHATSAPP_FILES_FOLDER /root/docker-compose.yml
# Expected: - WHATSAPP_FILES_FOLDER=/app/.sessions
# Check systemd service is enabled
systemctl is-enabled waha-session
# Expected: enabled
# Check service ran after last boot
systemctl status waha-session
# Expected: "Active: active (exited)" after last bootIf systemd service is missing
ssh root@72.60.32.61
# Copy from repo (PR #1362 adds hostinger/waha-session.service)
cp /opt/p24-infra/hostinger/waha-session.service /etc/systemd/system/waha-session.service
systemctl daemon-reload
systemctl enable waha-sessionEscalation
If session shows STOPPED even after POST /api/sessions/default/start:
- Check if credentials are still valid:
docker exec waha ls /app/.sessions/noweb/default/creds.json - If creds missing: session needs to be re-authenticated (QR code scan) — create human-action issue
- If creds present but status stays STOPPED after 30s: check WAHA logs:
docker logs waha --tail 50
Prevention
- vps-h1 planned reboots: check session status within 2 minutes of reboot complete
- Monitor: Prometheus
container_last_seen{name="waha"}— fires ContainerHighRestarts if WAHA crashes - The systemd service handles the normal reboot case automatically from PR #1362 onwards
Audit Log — Log to infra_operations
After this operation completes, log it to the infra_operations audit table.
Python (Linux server — bms-4, vps-i1, vps-h1, or similar):
import sys
sys.path.insert(0, '/opt/p24-infra')
from scripts.lib.log_op import log_op
log_op(
actor="claude", # "radieu" for manual human ops, "claude" for agent
op_type="restart",
resource="waha-session",
result="success", # "success" | "failed" | "skipped"
detail="WAHA session restarted after VPS reboot",
env="vps-h1",
gh_issue=2730,
)PowerShell (Windows dev machine):
$env:SUPABASE_URL = (Get-Content "C:\code_2026\p24-infra\.env.local" | Select-String "^SUPABASE_URL=").ToString().Split("=",2)[1].Trim()
$env:SUPABASE_SERVICE_KEY = (Get-Content "C:\code_2026\p24-infra\.env.local" | Select-String "^SUPABASE_SERVICE_KEY=").ToString().Split("=",2)[1].Trim()
python -c "
import os, sys
sys.path.insert(0, 'C:/code_2026/p24-infra')
from scripts.lib.log_op import log_op
log_op('claude', 'restart', 'waha-session', 'success', 'WAHA session restarted after VPS reboot', 'vps-h1')
"
$env:SUPABASE_URL = ''; $env:SUPABASE_SERVICE_KEY = ''