openclaw - 💡(How to fix) Fix BlueBubbles webhook route can disappear at runtime and start returning 404 [3 comments, 4 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#49932Fetched 2026-04-08 01:01:08
View on GitHub
Comments
3
Participants
4
Timeline
3
Reactions
0
Author
Timeline (top)
commented ×3

BlueBubbles webhook delivery can start returning 404 Not Found after the gateway has been running for a while, even though OpenClaw still reports that the webhook is listening.

Root Cause

Suspected root cause

Fix Action

Fix / Workaround

  • BlueBubbles logs show Dispatching event to webhook
  • BlueBubbles immediately receives 404 Not Found
  • OpenClaw may still log that BlueBubbles is listening on /bluebubbles-webhook
  • Manual tests may briefly work, then later real message deliveries fail again

Symptoms in plain language

  • BlueBubbles logs show that events are being dispatched to the webhook
  • But OpenClaw’s /bluebubbles-webhook suddenly starts returning 404 Not Found
  • Even more confusingly, OpenClaw may still report that the BlueBubbles webhook is listening
  • Manual tests may sometimes work shortly after startup, but real message delivery fails later

Workaround / patch tested locally

Code Example

curl -X POST 'http://localhost:18789/bluebubbles-webhook?password=REDACTED' \
  -H 'Content-Type: application/json' \
  -d '{}'
RAW_BUFFERClick to expand / collapse

Summary

BlueBubbles webhook delivery can start returning 404 Not Found after the gateway has been running for a while, even though OpenClaw still reports that the webhook is listening.

Version / Environment

  • OpenClaw version: 2026.3.13
  • Channel: stable
  • OS: macOS 15.7.3 (arm64)
  • Node: 22.22.0
  • Channel state: BlueBubbles configured and reported as OK in openclaw status

Symptoms

  • BlueBubbles logs show Dispatching event to webhook
  • BlueBubbles immediately receives 404 Not Found
  • OpenClaw may still log that BlueBubbles is listening on /bluebubbles-webhook
  • Manual tests may briefly work, then later real message deliveries fail again

Expected behavior

/bluebubbles-webhook should remain routable for the lifetime of the gateway process.

Actual behavior

The route appears to disappear at runtime and starts returning 404.

Suspected root cause

From local debugging, this appears related to createGatewayPluginRequestHandler relying on plugin HTTP route registries that can become empty at runtime. Once the active registry no longer matches the route, /bluebubbles-webhook returns 404 even though the plugin itself is still effectively configured.

Reproduction notes

I observed this on a local install where:

  1. BlueBubbles is configured and initially able to hit the webhook.
  2. After the gateway has been running for a short time, real deliveries begin returning 404.
  3. Hitting the webhook manually sometimes works earlier in the process, but later the same route no longer resolves.

A quick validation method is:

curl -X POST 'http://localhost:18789/bluebubbles-webhook?password=REDACTED' \
  -H 'Content-Type: application/json' \
  -d '{}'
  • 404 => route missing
  • 400 => route exists and the dummy payload is just invalid

Additional description (Chinese)

OpenClaw 2026.3.13(stable) 上,我遇到了一个 BlueBubbles webhook 路由会在运行一段时间后失效 的问题。

问题表现

  • BlueBubbles 侧日志显示正在把消息分发到 webhook
  • 但 OpenClaw 的 /bluebubbles-webhook 会突然开始返回 404 Not Found
  • 更诡异的是,OpenClaw 有时仍然显示 BlueBubbles webhook 已在监听
  • 手动测试在刚启动后可能偶尔可用,但运行一段时间后,真实消息投递会失败

问题本质

这看起来不像是 BlueBubbles 配置错误,而更像是 OpenClaw 运行时插件 HTTP 路由注册表丢失或失效,导致 webhook 路由在进程存活期间“消失”。

为什么这个问题麻烦

因为它不是“启动就坏”,而是 刚开始正常,过一会儿变坏,所以排查时很容易误判成偶发网络问题或 BlueBubbles 自身问题。

Additional description (English)

I hit this issue on OpenClaw 2026.3.13 (stable): the BlueBubbles webhook route can disappear after the gateway has been running for a while.

Symptoms in plain language

  • BlueBubbles logs show that events are being dispatched to the webhook
  • But OpenClaw’s /bluebubbles-webhook suddenly starts returning 404 Not Found
  • Even more confusingly, OpenClaw may still report that the BlueBubbles webhook is listening
  • Manual tests may sometimes work shortly after startup, but real message delivery fails later

What this looks like

This does not look like a simple BlueBubbles misconfiguration. It looks more like the runtime plugin HTTP route registry in OpenClaw becomes empty or stops matching, causing the webhook route to effectively disappear while the process is still alive.

Why this is tricky

The route is not broken immediately on startup — it can work at first and then fail later — which makes it easy to misdiagnose as a network issue or a BlueBubbles-side problem.

Workaround / patch tested locally

I tested a minimal fallback patch that:

  • prefers the active plugin registry when it has routes
  • falls back to the startup registry if the active registry cannot match
  • caches the BlueBubbles webhook route once it has matched at least once
  • reuses that cached route if both registries later become empty

Patch + notes: https://gist.github.com/yiqingsir/af36bfe36b332618aec85afb4fcf0f1b

Why I'm filing this as an issue instead of a PR

The patch I have is against built dist files from a local installation, not the source tree, so I don't want to submit a noisy or misleading PR before the maintainers confirm the intended fix path.

If helpful, I can help test a proper source-level fix or provide more logs/repro details.

extent analysis

Fix Plan

To resolve the issue of the BlueBubbles webhook route disappearing after the gateway has been running for a while, we need to modify the createGatewayPluginRequestHandler function to properly handle plugin HTTP route registries.

Here are the steps:

  • Modify the createGatewayPluginRequestHandler function to prefer the active plugin registry when it has routes.
  • Implement a fallback to the startup registry if the active registry cannot match.
  • Cache the BlueBubbles webhook route once it has matched at least once.
  • Reuse the cached route if both registries later become empty.

Example code changes:

// Create a cache for the BlueBubbles webhook route
let cachedWebhookRoute = null;

// Modify the createGatewayPluginRequestHandler function
function createGatewayPluginRequestHandler() {
  // Prefer the active plugin registry when it has routes
  const activeRegistry = getActivePluginRegistry();
  if (activeRegistry && activeRegistry.hasRoutes()) {
    // Cache the BlueBubbles webhook route if it matches
    const webhookRoute = activeRegistry.getRoute('/bluebubbles-webhook');
    if (webhookRoute) {
      cachedWebhookRoute = webhookRoute;
    }
    return activeRegistry.getRequestHandler();
  }

  // Fallback to the startup registry if the active registry cannot match
  const startupRegistry = getStartupPluginRegistry();
  if (startupRegistry && startupRegistry.hasRoutes()) {
    // Cache the BlueBubbles webhook route if it matches
    const webhookRoute = startupRegistry.getRoute('/bluebubbles-webhook');
    if (webhookRoute) {
      cachedWebhookRoute = webhookRoute;
    }
    return startupRegistry.getRequestHandler();
  }

  // Reuse the cached route if both registries later become empty
  if (cachedWebhookRoute) {
    return cachedWebhookRoute.getRequestHandler();
  }

  // Return a 404 handler if no route is found
  return (req, res) => {
    res.status(404).send('Not Found');
  };
}

Verification

To verify that the fix worked, you can use the following curl command to test the BlueBubbles webhook route:

curl -X POST 'http://localhost:18789/bluebubbles-webhook?password=REDACTED' \
  -H 'Content-Type: application/json' \
  -d '{}'

If the fix is successful, the route should no longer return a 404 error.

Extra Tips

To prevent similar issues in the future, it's essential to implement proper caching and fallback mechanisms for plugin HTTP route registries. Additionally, monitoring the gateway's logs and performance can help identify potential issues before they become critical.

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

/bluebubbles-webhook should remain routable for the lifetime of the gateway process.

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 BlueBubbles webhook route can disappear at runtime and start returning 404 [3 comments, 4 participants]