Skip to content

server run --host fails on a host with IPv6 disabled #8

Closed

Description

@max-sixty

server run --host NAME records the dual-stack wildcard :: as the bind and selects the dual-stack server class, whose address family is AF_INET6. On a host with IPv6 disabled the socket constructor raises an unsupported-address-family error and the server exits without serving.

The recorded :: persists in access.json, so a later bare server run fails the same way until that file is deleted.

Expected: --host binds every interface, which is what it asks for, in whatever family the kernel has.

Smallest repro: on a Linux host with IPv6 disabled, run server run --host with any name.

This matters more than an ordinary platform gap, because --host is the only remedy the skill documents for a derived address the reader cannot reach — and the case that most needs it is a headless host, where the derived address is loopback and no browser is local. So the one escape hatch fails exactly where it is wanted.

A fallback to the IPv4 wildcard 0.0.0.0 when AF_INET6 is unavailable would say the same thing — every interface — in the family that is left. The record could keep ::, since what a restart has to reproduce is the URL, and that states the host and the port rather than the bind.

Seen on leaf d929d4e.

This was written by Claude Code on behalf of max-sixty

Activity

  1. added
    bug
    on Aug 19, 2026
  2. leaf-agent commented on Aug 19, 2026

    @leaf-agent
    Collaborator

    Reproduced and fixed in #9.

    The exit is one step earlier than a bind failure: DualStackHTTPServer sets address_family = AF_INET6, and socketserver opens the socket in __init__, so EAFNOSUPPORT arrives before server_bind runs. The except OSError in cmd_serve only continues on EADDRINUSE, so the error surfaces as the recorded-address message — whose two remedies are deleting access.json and re-running with --host, which is exactly what the reader just did.

    The fix takes the shape you described: server_at restates the wildcard as 0.0.0.0 when AF_INET6 is refused, and the record keeps ::. Only the wildcard is restated — a literal v6 address keeps its refusal, since answering it with every interface would widen the exposure that record chose.

    Verification

    test_the_stated_host_wildcard_binds_what_a_kernel_without_ipv6_has fakes the kernel rather than the product: socket.socket raises EAFNOSUPPORT for AF_INET6, and the test then asserts the wildcard comes up on an AF_INET socket bound to 0.0.0.0 and answers a real request. With the fallback deleted it fails with OSError: [Errno 97] Address family not supported by protocol — this issue's own error.

    The two suite tests that need a real IPv6 stack are unchanged and still need one: their fixture asks for the dual-stack socket on purpose and asserts [::1] reachability, so the note in CLAUDE.md about the cloud container still stands.

  3. added a commit that references this issue on Aug 20, 2026
    9dff504
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions