Open brunerd opened 1 year ago
Pinging @elastic/elastic-agent (Team:Elastic-Agent)
@cmacknz any thoughts here?
Our error message here can definitely be better, not sure on looking at /etc/hosts for possible causes though. That is a bit beyond what I think agent should be responsible for.
We can definitely make this problem more obvious.
Summary:
If the first entry for
127.0.0.1
within/etc/hosts
if anything exceptlocalhost
then enrollment to fleet will failFor confirmed bugs, please report:
/etc/hosts
127.0.0.1 kibana.local localhost
--url
and--enrollment-token
arguments to enroll to a Fleet server/etc/hosts
file will cause enrollment (but not installation) to fail.Notes:
Enrollment to Fleet can be thwarted by /etc/hosts if (mis)-configured. While the Agent binaries install OK but then enrollment just wouldn't happened and when you looked at the log it would be this ambiguous error:
The user mentioned network issues running Elasticsearch locally and needing to specify
127.0.0.1
instead oflocalhost
in their browser. I looked in their /etc/hosts and this was the first line:This was preventing enrollment, once switched to
127.0.0.1 localhost kibana.local
it was fine. As long as the first entry for 127.0.0.1 islocalhost
then all is well, anything else and it'll fail.Should/could elastic-agent be able work around this issue? Or at the very least detect this issue and log a more descriptive warning about it? Original Slack here