Skip to content

Use 127.0.0.1 instead of localhost for the runtime inspector address#14086

Merged
dario-piotrowicz merged 1 commit into
mainfrom
dario/14077/ipv6-inspector-address-fix
Jun 1, 2026
Merged

Use 127.0.0.1 instead of localhost for the runtime inspector address#14086
dario-piotrowicz merged 1 commit into
mainfrom
dario/14077/ipv6-inspector-address-fix

Conversation

@dario-piotrowicz

@dario-piotrowicz dario-piotrowicz commented May 28, 2026

Copy link
Copy Markdown
Member

Fixes #14077

On systems where getaddrinfo("localhost") returns ::1 but IPv6 is disabled at the kernel level, workerd fails to bind the inspector socket and silently continues without emitting the listen-inspector event to the control FD. This caused wrangler dev to hang indefinitely at "Starting local server..." with no error output.

Note

Using 127.0.0.1 explicitly is consistent with DEFAULT_HOST, --debug-port, and resolveLocalhost() already in the codebase.


  • Tests
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bugfix

A picture of a cute animal (not mandatory, but encouraged)

Footnotes

  1. Accessing the Wrangler devtools via the [d] hotkey doesn't correctly work (it shows a Debugging connection was closed error modal), but that seems broken in wrangler@latest anyways so it's not an issue caused by this PR

@changeset-bot

changeset-bot Bot commented May 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: daffd98

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
miniflare Patch
@cloudflare/pages-shared Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ask-bonk

ask-bonk Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

The change is clean and correct:

  1. The fix replaces "localhost" with "127.0.0.1" in a single call site — the inspector socket address passed to #getSocketAddress.
  2. This is consistent with the existing resolveLocalhost() function at line 169 which does exactly host === "localhost" ? "127.0.0.1" : undefined, the DEFAULT_HOST constant, and the debugPortAddress at line 2451 which already uses "127.0.0.1:0".
  3. The #getSocketAddress method passes the host through getURLSafeHost() which is a no-op for IPv4 addresses, so no behavior change there.
  4. The changeset is properly scoped to miniflare as a patch.
  5. No other "localhost" usages in this file are affected by the same workerd binding issue — the remaining ones are in maybeGetLocallyAccessibleHost (used for URL construction, not socket binding) and in buildPublicUrl (same).

LGTM

github run

@github-actions

Copy link
Copy Markdown
Contributor

✅ All changesets look good

@pkg-pr-new

pkg-pr-new Bot commented May 28, 2026

Copy link
Copy Markdown
create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14086

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14086

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14086

miniflare

npm i https://pkg.pr.new/miniflare@14086

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14086

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14086

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14086

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14086

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14086

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14086

wrangler

npm i https://pkg.pr.new/wrangler@14086

commit: daffd98

@workers-devprod

workers-devprod commented May 28, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Jun 1, 2026
@dario-piotrowicz dario-piotrowicz merged commit 4ef790b into main Jun 1, 2026
64 of 66 checks passed
@dario-piotrowicz dario-piotrowicz deleted the dario/14077/ipv6-inspector-address-fix branch June 1, 2026 14:53
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

🐛 BUG: Miniflare hangs indefinitely when workerd exits before sending all listen events on control FD

3 participants