Describe the bug
WhatsApp Web credentials file (creds.json) gets corrupted approximately every 35 minutes, which coincides with WhatsApp's pre-key rotation cycle. The system automatically restores from backup, but this causes intermittent connection failures and breaks scheduled task notifications.
Environment
- OpenClaw Version: 2026.4.1
- Node.js: v22.22.2
- OS: Linux (VPS, virtual disk /dev/vda3)
- Channel: WhatsApp Web
- Account: [REDACTED - Phone number removed for privacy]
Logs
12:39:08 WARN restored corrupted WhatsApp creds.json from backup
13:14:08 WARN restored corrupted WhatsApp creds.json from backup
13:49:09 WARN restored corrupted WhatsApp creds.json from backup
Corruption interval: ~35 minutes (matches pre-key rotation)
Impact
- Scheduled cron jobs fail to send notifications (3 tasks affected)
- Requires manual
openclaw channels login to reconnect
- Gateway status 499 disconnections
Expected behavior
Credentials should be written atomically (write to temp file, then rename) to prevent corruption during pre-key rotation.
Possible cause
Race condition or non-atomic write in WhatsApp credential storage logic. The corruption occurs during the pre-key rotation write operation.
Workaround
Deployed monitoring script with:
- Auto-relogin on disconnect (every 2 min check)
- Automatic credential backup (every 30 min)
- Removed forced 30-min refresh (triggers rate limiting)
Additional context
After deploying the workaround, observed a secondary issue: WhatsApp gateway disconnects every ~60 seconds (status 499), possibly due to rate limiting from forced refresh. This was resolved by removing the 30-minute forced login task.
Reproduction steps:
- Link WhatsApp Web account:
openclaw channels login --channel whatsapp --account default
- Wait ~35 minutes for pre-key rotation
- Check logs for
restored corrupted WhatsApp creds.json from backup
- Observe connection drops and failed scheduled tasks
Describe the bug
WhatsApp Web credentials file (
creds.json) gets corrupted approximately every 35 minutes, which coincides with WhatsApp's pre-key rotation cycle. The system automatically restores from backup, but this causes intermittent connection failures and breaks scheduled task notifications.Environment
Logs
Corruption interval: ~35 minutes (matches pre-key rotation)
Impact
openclaw channels loginto reconnectExpected behavior
Credentials should be written atomically (write to temp file, then rename) to prevent corruption during pre-key rotation.
Possible cause
Race condition or non-atomic write in WhatsApp credential storage logic. The corruption occurs during the pre-key rotation write operation.
Workaround
Deployed monitoring script with:
Additional context
After deploying the workaround, observed a secondary issue: WhatsApp gateway disconnects every ~60 seconds (status 499), possibly due to rate limiting from forced refresh. This was resolved by removing the 30-minute forced login task.
Reproduction steps:
openclaw channels login --channel whatsapp --account defaultrestored corrupted WhatsApp creds.json from backup