Skip to content

fix(webhook): don't let a bind failure take down the whole host#2975

Open
wuisabel-gif wants to merge 1 commit into
nanocoai:mainfrom
wuisabel-gif:fix/webhook-bind-error-handler
Open

fix(webhook): don't let a bind failure take down the whole host#2975
wuisabel-gif wants to merge 1 commit into
nanocoai:mainfrom
wuisabel-gif:fix/webhook-bind-error-handler

Conversation

@wuisabel-gif

Copy link
Copy Markdown

The webhook server calls server.listen() with no 'error' handler, so if the port is already in use (a stray process, or a second nanoclaw copy) the EADDRINUSE surfaces as an uncaught exception and the entire host goes down — message polling, delivery and the sweep included, over one busy port.

Handle 'error' instead: log the port and a hint, and keep the host up. The webhook-backed adapters stay dark until the conflict clears, but nothing else has to.

Fixes #2900

Type of Change

  • Feature skill - adds a channel or integration (source code changes + SKILL.md)
  • Utility skill - adds a standalone tool (code files in .claude/skills/<name>/, no source changes)
  • Operational/container skill - adds a workflow or agent skill (SKILL.md only, no source changes)
  • Fix - bug fix or security fix to source code
  • Simplification - reduces or simplifies source code
  • Documentation - docs, README, or CONTRIBUTING changes only

Description

For Skills

  • SKILL.md contains instructions, not inline code (code goes in separate files)
  • SKILL.md is under 500 lines
  • I tested this skill on a fresh clone

The webhook server calls server.listen() with no 'error' handler, so if the
port is already in use (a stray process, or a second nanoclaw copy) the
EADDRINUSE surfaces as an uncaught exception and the entire host goes down —
message polling, delivery and the sweep included, over one busy port.

Handle 'error' instead: log the port and a hint, and keep the host up. The
webhook-backed adapters stay dark until the conflict clears, but nothing
else has to.

Fixes nanocoai#2900
@github-actions github-actions Bot added the follows-guidelines PR was created using the current contributing template label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

follows-guidelines PR was created using the current contributing template

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Webhook server bind failure (EADDRINUSE) crashes the entire host process

1 participant