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

More descriptive error message when reading /etc/hosts file #4

Open
hurufu opened this issue Nov 11, 2023 · 2 comments
Open

More descriptive error message when reading /etc/hosts file #4

hurufu opened this issue Nov 11, 2023 · 2 comments

Comments

@hurufu
Copy link

hurufu commented Nov 11, 2023

Hello, thanks for writing and maintaining s6 suite of tools.

I had quite a head-scratcher recently, because it was hard to deduce why s6-tcpclient failed with error:

s6-tcpclient: fatal: unable to init DNS: Invalid or incomplete multi-byte or wide character

I had to resort to reading sources... The problem was that I had some strange entries in /etc/hosts file:

fe80::1%lo0 localhost
0.0.0.0 0.0.0.0

Is it possible to extend error messages to inform that at least it was an error related to /etc/hosts file parsing? Or maybe ignore erroneous lines, because this file is commonly managed manually, so it is possible that it will contain some errors in it.

@skarnet
Copy link
Owner

skarnet commented Nov 11, 2023

Yeah, that problem was also reported to me from another source. The problem is twofold:

  • indeed /etc/hosts parsing should warn on unrecognized entries and go to the next line instead of failing altogether. I'll work on this for the next version of s6-dns.
  • Also, s6-tcpclient should not unconditionally load /etc/hosts, I'll add an option to do that on demand. I'll add this to the next version of s6-networking.

Sorry I don't have a quick fix, apart from commenting the entries with expanded syntax in /etc/hosts.

@hurufu
Copy link
Author

hurufu commented Nov 11, 2023

I don't need a quick fix, if it will be available in the next release – that's good enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants