Skip to content

[Bug] On a dual-stack network, ping for a single-stack (IPv4 or IPv6 only) service may fail #2211

Closed
@saiarcot895

Description

@saiarcot895

Description

When:

  • homepage has access to a dual-stack network (i.e. has both an IPv4 and IPv6 address),
  • a domain name is used for pinging a service to check to see if it's up,
  • that domain has both an IPv4 and IPv6 address record,
  • the service is only listening on IPv4

Then the ping may fail with a 500 error. This appears to be because Node 18, by default, doesn't enable the Happy Eyeballs algorithm by default (see nodejs/node#41625, implemented in nodejs/node#44731). This means that if a connection over IPv6 fails, then it doesn't automatically fall back to trying with IPv4. It looks like it will be enabled by default in Node 20, but for Node 18, autoSelectFamily: true would need to be set when making the HTTP request.

Steps to reproduce

  1. Have an environment/network setup with both IPv4 and IPv6 configured.
  2. Host a service that's listening on IPv4 only.
  3. Have a DNS entry/domain name with both A (IPv4) and AAAA (IPv6) records.
  4. Use that domain name for pinging from homepage.

homepage version

v0.7.4 (8ec488e, Oct 18, 2023)

Installation method

Docker

Configuration

No response

Container Logs

No response

Browser Logs

No response

Troubleshooting

I did a packet capture to see what was happening with the pings, and saw that only IPv6 was being attempted. The IPv4 connection at the end was me manually using the IPv4 address in a wget test from the homepage container.

image

Other

No response

Before submitting, I have made sure to

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions