Skip to content

find_node_ip() returns None on loopback-only hosts, which is not a valid MASTER_ADDR #302

Closed

Description

@li-lizhe

find_node_ip() ends with return main_ip or virtual_ip, so it returns None when no interface other than loopback exposes an IPv4 address (for example a process started with docker run --network none, or a container whose only NIC is not up yet).

RayHelper stores the result into MASTER_ADDR:

env_vars['MASTER_ADDR'] = ip

None is not a valid environment variable value, so instead of a clear "could not determine node address" the job fails inside Ray's env_vars validation.

Reproduction (pure Python, no Ray needed) — load src/twinkle/utils/network.py, stub psutil.net_if_addrs() to return only lo:

find_node_ip() -> None
MASTER_ADDR    -> None   # invalid env var value

Proposed fix: keep the current preference order (non-virtual interface, then virtual interface) but make the final fallback 127.0.0.1 instead of None.

I have a PR with the fix plus a regression test: #301

Activity

  1. li-lizhe commented on Oct 11, 2026

    @li-lizhe
    ContributorAuthor

    Fix opened as #301 (sets the fallback to 127.0.0.1).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions