openclaw - 💡(How to fix) Fix WhatsApp multi-account: secondary account crashes on boot with 'Cannot read properties of undefined (reading readWebAuthState)' [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#77066Fetched 2026-05-05 05:52:49
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
2
Timeline (top)
commented ×1

On OpenClaw v2026.5.2, a WhatsApp multi-account setup with a default and secondary account consistently crashes the secondary account on gateway boot with:

[channels/whatsapp] [whatsapp] channel startup failed: Cannot read properties of undefined (reading 'readWebAuthState')

The default account starts successfully, but the secondary account never registers its provider. The health monitor repeatedly tries to restart it (reason: stopped), but the same crash occurs each time.

Error Message

  1. The crash is at the channel level — The error says channel startup failed, suggesting the entire WhatsApp channel initialization sequence is affected, not just the secondary account init.

Root Cause

On OpenClaw v2026.5.2, a WhatsApp multi-account setup with a default and secondary account consistently crashes the secondary account on gateway boot with:

[channels/whatsapp] [whatsapp] channel startup failed: Cannot read properties of undefined (reading 'readWebAuthState')

The default account starts successfully, but the secondary account never registers its provider. The health monitor repeatedly tries to restart it (reason: stopped), but the same crash occurs each time.

Code Example

[channels/whatsapp] [whatsapp] channel startup failed: Cannot read properties of undefined (reading 'readWebAuthState')

---

{
  "authDir": "/Users/.../.openclaw/credentials/whatsapp/secondary",
  "dmPolicy": "allowlist",
  "groupPolicy": "allowlist",
  "groupAllowFrom": ["[email protected]", "[email protected]"],
  "groups": {
    "[email protected]": { "requireMention": false },
    "[email protected]": { "requireMention": false }
  },
  "allowFrom": ["..."],
  "debounceMs": 2000
}
RAW_BUFFERClick to expand / collapse

Description

On OpenClaw v2026.5.2, a WhatsApp multi-account setup with a default and secondary account consistently crashes the secondary account on gateway boot with:

[channels/whatsapp] [whatsapp] channel startup failed: Cannot read properties of undefined (reading 'readWebAuthState')

The default account starts successfully, but the secondary account never registers its provider. The health monitor repeatedly tries to restart it (reason: stopped), but the same crash occurs each time.

Key observations

  1. In-process pairing worksopenclaw channels login --channel whatsapp --account secondary successfully pairs and saves credentials to the configured authDir. The whatsapp_login tool reports Linked! WhatsApp is ready.
  2. Cold boot always fails — After any gateway restart (LaunchAgent, SIGUSR1, or openclaw gateway restart), only the default account starts. Secondary crashes immediately.
  3. Fresh credentials don't help — Nuking the entire ~/.openclaw/credentials/whatsapp/secondary/ directory, re-linking with a fresh QR scan, and restarting still produces the same readWebAuthState crash.
  4. Outbound works mid-session — If the secondary is recovered in-process via the login tool (without a restart), outbound DMs succeed. But the persistent listener never registers, so no inbound messages are received.
  5. The crash is at the channel level — The error says channel startup failed, suggesting the entire WhatsApp channel initialization sequence is affected, not just the secondary account init.

Secondary account config

{
  "authDir": "/Users/.../.openclaw/credentials/whatsapp/secondary",
  "dmPolicy": "allowlist",
  "groupPolicy": "allowlist",
  "groupAllowFrom": ["[email protected]", "[email protected]"],
  "groups": {
    "[email protected]": { "requireMention": false },
    "[email protected]": { "requireMention": false }
  },
  "allowFrom": ["..."],
  "debounceMs": 2000
}

The default account has no authDir set (uses auto-derived path) and boots fine.

Reproduction

  1. Configure a secondary WhatsApp account with an explicit authDir
  2. Link it via openclaw channels login --channel whatsapp --account secondary
  3. Restart the gateway
  4. Check verbose log — readWebAuthState TypeError on secondary

Environment

  • OpenClaw v2026.5.2 (8b2a6e5)
  • Node v25.8.2
  • macOS 26 (arm64)
  • Baileys (bundled version)

Expected behavior

Both WhatsApp accounts should start successfully on gateway boot and register persistent inbound listeners.

Actual behavior

Only the default account starts. Secondary crashes with readWebAuthState TypeError. Health monitor loops restart attempts indefinitely.

extent analysis

TL;DR

The secondary WhatsApp account crashes on gateway boot due to a readWebAuthState TypeError, suggesting an issue with the authentication state handling.

Guidance

  • Verify that the authDir path for the secondary account is correctly configured and accessible.
  • Check if the readWebAuthState function is being called before the authentication state is fully initialized.
  • Investigate if there are any differences in the authentication flow between the default and secondary accounts that could cause this issue.
  • Try setting the authDir for the default account to an explicit path to see if the issue is specific to the secondary account or the explicit authDir configuration.

Example

No code snippet is provided as the issue seems to be related to the configuration and authentication flow rather than a specific code block.

Notes

The issue might be related to the way the authentication state is handled for the secondary account, possibly due to the explicit authDir configuration. Further investigation is needed to determine the root cause.

Recommendation

Apply a workaround by trying to initialize the authentication state manually for the secondary account before starting the gateway, or investigate if there's an update available for OpenClaw that addresses this issue. The reason is that the current configuration and authentication flow seem to be causing the crash, and a workaround or update might resolve the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Both WhatsApp accounts should start successfully on gateway boot and register persistent inbound listeners.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix WhatsApp multi-account: secondary account crashes on boot with 'Cannot read properties of undefined (reading readWebAuthState)' [1 comments, 2 participants]