Elastic-agent - Fail to enroll, Status code: 404

Hi all

I was trying to enroll an elastic-agent by following the instructions that are shown in Kibana.

elastic-agent enroll https://<KIBANA IP>:5601 ENROLLMENT_KEY

2020-11-18T10:07:23.249+0800    DEBUG   kibana/client.go:170    Request method: POST, path: /api/fleet/agents/enroll
Error: fail to enroll: fail to execute request to Kibana: Status code: 404, Kibana returned an error: Not Found, message: Not Found

Is there anything that i should look out for or check on?

What version of Elastic Agent and Kibana are you using?

I have the same problem.

# ./elastic-agent enroll https://<IP>:5601 ENROLLMENT_KEY --insecure
The Elastic Agent is currently in BETA and should not be used in production

2020-11-23T13:23:43.090+0100    DEBUG   kibana/client.go:170    Request method: POST, path: /api/fleet/agents/enroll
2020-11-23T13:23:43.090+0100    WARN    [tls]   tlscommon/tls_config.go:93      SSL/TLS verifications disabled.
Error: fail to enroll: fail to execute request to Kibana: Status code: 404, Kibana returned an error: Not Found, message: Not Found

My kibana version is "v 7.9.3"
elastic-agent-7.10.0-linux-x86_64

We had similar issue as well. So we were able to enroll with 7.9.3 agent.

The version of the Elastic Agent must <= Kibana version. So you need Kibana 7.10 if you want to enroll a 7.10 Agent.

The error above is pretty bad and I think is related to one of the API path changes we made. We will fix this in the future.

@Mikel_U Can you update Kibana and try again?

I have change the Agent to 7.9.3 and I have enrolled successfully.
Then, I had to add elastic-agent as a service in /etc/systemd/system .