solution integration high macos linux windows
Email OAuth keeps requiring re-auth (tokens disappear or refresh fails)
Fix repeated email OAuth logins by persisting the OpenClaw state directory, eliminating config/runtime drift, and diagnosing refresh failures from logs.
By CoClaw Team •
Error signatures: reauth | login required | needs authentication
Symptoms
- Email integration works once, then repeatedly asks you to authenticate again.
- After redeploy/reboot, OpenClaw behaves like it never had email credentials.
Cause
Most cases reduce to one of:
- The OpenClaw state directory is not persisted (Docker layer reset, ephemeral disk, image resets).
- The gateway service is running with a different home/state than your shell (multiple installs, different user, different env vars).
- OAuth refresh fails (provider invalidated the refresh token or account policy blocks it).
Fix
1) Confirm state persistence first (do not skip)
Follow:
2) Capture logs around refresh/auth
openclaw status --deep
openclaw logs --follow
3) Eliminate runtime drift
If updates were installed in one environment but the service uses another:
Verify
- Reboot/restart the gateway and confirm email auth persists.
- Cron/email runs keep working for multiple cycles without manual login.