Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] chia daemon listens only on IPv4 socket #11397

Closed
cross opened this issue May 2, 2022 · 3 comments
Closed

[Bug] chia daemon listens only on IPv4 socket #11397

cross opened this issue May 2, 2022 · 3 comments
Assignees
Labels
bug Something isn't working daemon

Comments

@cross
Copy link
Contributor

cross commented May 2, 2022

What happened?

This is related, and/or root cause, of bug #11390 . Something about the aiohttp ws_connect method will perform a connection to "::1" if given a wss://localhost:55400 URI, at least on some of my hosts that have no IPv4 connectivity. 127.0.0.1 is on the system, and the daemon is listening on it. But, chia never can tell it's there because chia is trying IPv6.

Unrelated to the problem caused, however, the more correct fix here is to have the main daemon, like farmer and other pieces, listen on IPv6 as well as IPv4 when on a machine with IPv6 addresses. I'm not sure where this is in the code, or if it's purely within aiohttp somewhere. But I feel it should be addressed.

Version

1.3.4

What platform are you using?

Linux

What ui mode are you using?

CLI

Relevant log output

No response

@cross cross added the bug Something isn't working label May 2, 2022
@wallentx wallentx added the daemon label May 5, 2022
@github-actions
Copy link
Contributor

This issue has not been updated in 14 days and is now flagged as stale. If this issue is still affecting you and in need of further review, please comment on it with an update to keep it from auto closing in 7 days.

@github-actions github-actions bot added the stale-issue flagged as stale and will be closed in 7 days if not updated label May 20, 2022
@cross
Copy link
Contributor Author

cross commented May 21, 2022

This should remain open. The daemon should be able to bind to IPv6 and/or both IPv4 and IPv6.

@github-actions github-actions bot removed the stale-issue flagged as stale and will be closed in 7 days if not updated label May 21, 2022
@emlowe emlowe self-assigned this May 24, 2022
@emlowe
Copy link
Contributor

emlowe commented Jan 17, 2023

In doing some research on this, the daemon will listen to both IPv6 and IPv4 without code changes, as long as localhost is mapped to both 127.0.0.1 and ::1 in /etc/hosts (windows tests pending).

On macOS, this is the default and so the daemon listens to both by default.
This is also the default on Rocky 8.
However, on Ubuntu, localhost is only mapped to 127.0.0.1 and a different name (ip6-localhost) to ::1. However, if /etc/hosts is modified to return both for localhost, then the daemon starts listening on both automatically.

Closing issue as it seems that as long as localhost is mapped to both addresses, the daemon does listen and is available on both addresses. This seems some specific aspect of Ubuntu that localhost is not mapped to ::1

@emlowe emlowe closed this as completed Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working daemon
Projects
None yet
Development

No branches or pull requests

3 participants