Hi everybody,
After updating our stack to version 7.13.2 we have been experiencing problems when trying to enroll agents to Fleet.
Since fleet-server was introduced we added it to our stack and behind our reverse proxy (Caddy server) in order to access it with fleet.ourdomain.com and let Caddy handle the TLS.
When we try to enroll a new agent (on a Windows machine) with the following command :
.\elastic-agent.exe install -f --url=https://fleet.ourdomain.com:443 --enrollment-token=TOKEN
every seems to be good at first, command line says agent has enrolled, it appears in Kibana but it stays in "updating" state forever.
When looking into the logs provided by the agent we get the following:
{"log.level":"error","@timestamp":"2021-07-03T11:26:59.026+0200","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":205},"message":"Could not communicate with fleet-server Checking API will retry, error: status code: 400, fleet-server returned an error: BadRequest","ecs.version":"1.6.0"}
After trying out several solutions we found the following one:
Instead of using the install command when used the enroll command:
.\elastic-agent.exe enroll -f --url=https://fleet.ourdomain.com:443 --enrollment-token=TOKEN
So far we get exactly the same result. Agent enrolls by stays on "Updating". So next we actually install the agent by simply calling .\elastic-agent install
however when the question about fleet comes, we answer that we don't want to enroll it as we did so previously.
After following those two steps agent show up correctly as "Healthy" as work correctly.
Why isn't the "automatic" process not working correctly. Are we doing something wrong here ?
Thanks for your help !