openclaw - 💡(How to fix) Fix Bonjour plugin crashes gateway in restart loop on macOS (CIAO ANNOUNCEMENT CANCELLED) [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#71781Fetched 2026-04-26 05:08:27
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×2closed ×1commented ×1cross-referenced ×1

Root Cause

Root Cause (two parts)

Fix Action

Workaround

OPENCLAW_DISABLE_BONJOUR=1

(env var check exists at line 48 of extensions/bonjour/index.js)

Important: Must be set in both .zshrc and the launchd plist EnvironmentVariables dict, since launchd doesn't inherit shell env.

Code Example

OPENCLAW_DISABLE_BONJOUR=1
RAW_BUFFERClick to expand / collapse

Bug Summary

Regression introduced ~2026.4.3–2026.4.24

Symptom

openclaw gateway crashes repeatedly with Unhandled promise rejection: CIAO ANNOUNCEMENT CANCELLED every ~34 seconds. The gateway reaches ready state but never stabilizes.

Root Cause (two parts)

  1. Stuck mDNS announcement: The CIAO mDNS announcement gets stuck in announcing state indefinitely (never transitions to announced). Likely caused by CIAO iterating over too many macOS network interfaces (19 on a typical M-series Mac — anpi, awdl, utun system tunnels, etc.) and failing to complete its multicast loopback confirmation.

  2. Unregistered rejection handler: The watchdog's recreateAdvertiser() calls svc.destroy() on the stuck service, which causes CIAO to throw ANNOUNCEMENT CANCELLED as an unhandled promise rejection. The handleCiaoUnhandledRejection function in extensions/bonjour/index.js is correctly written to suppress this, but the plugin entry point at line 287 only passes { logger: api.logger } to startGatewayBonjourAdvertiser — it never passes registerUnhandledRejectionHandler. So the suppression handler is never registered and the rejection crashes the Node process.

Environment

  • macOS (M-series Mac, 19+ network interfaces)
  • OpenClaw version: latest as of 2026-04-25

Workaround

OPENCLAW_DISABLE_BONJOUR=1

(env var check exists at line 48 of extensions/bonjour/index.js)

Important: Must be set in both .zshrc and the launchd plist EnvironmentVariables dict, since launchd doesn't inherit shell env.

Suggested Fixes

  1. Wire up the handler: Pass registerUnhandledRejectionHandler in the plugin entry call at line 287 of extensions/bonjour/index.js.
  2. Add fallback: Add a direct process.on('unhandledRejection', ...) fallback inside startGatewayBonjourAdvertiser when deps.registerUnhandledRejectionHandler is absent.
  3. Filter interfaces: Investigate filtering out non-physical/non-routable interfaces (utun, awdl, anpi, gif, stf) from CIAO's interface list to address the stuck-announcement root cause.

extent analysis

TL;DR

The most likely fix is to pass registerUnhandledRejectionHandler in the plugin entry call at line 287 of extensions/bonjour/index.js to prevent the Unhandled promise rejection: CIAO ANNOUNCEMENT CANCELLED error.

Guidance

  • To verify the issue, check the Node process logs for the Unhandled promise rejection: CIAO ANNOUNCEMENT CANCELLED error and confirm that the handleCiaoUnhandledRejection function is not being called.
  • To mitigate the issue, set the OPENCLAW_DISABLE_BONJOUR=1 environment variable in both .zshrc and the launchd plist EnvironmentVariables dict.
  • Investigate filtering out non-physical/non-routable interfaces from CIAO's interface list to address the stuck-announcement root cause.
  • Consider adding a direct process.on('unhandledRejection', ...) fallback inside startGatewayBonjourAdvertiser when deps.registerUnhandledRejectionHandler is absent.

Example

// In extensions/bonjour/index.js, line 287
startGatewayBonjourAdvertiser({
  logger: api.logger,
  registerUnhandledRejectionHandler: handleCiaoUnhandledRejection
});

Notes

The provided workaround using OPENCLAW_DISABLE_BONJOUR=1 may not be a permanent solution and should be used temporarily until the root cause is addressed.

Recommendation

Apply the workaround by setting OPENCLAW_DISABLE_BONJOUR=1 in both .zshrc and the launchd plist EnvironmentVariables dict, as this is a straightforward and effective way to mitigate the issue until a more permanent fix can be implemented.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING