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

**URL:** <https://discuss.elastic.co/t/elastic-agent-fail-to-enroll-status-code-404/255772>\
**Category:** Elastic Security\
**Tags:** elastic-agent\
**Created:** [November 18, 2020, 2:15am UTC](https://discuss.elastic.co/t/elastic-agent-fail-to-enroll-status-code-404/255772 "2020-11-18T02:15:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ismyhairnice](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ismyhairnice/32/68353_2.png) [@ismyhairnice](https://discuss.elastic.co/u/ismyhairnice)\
**Post date:** [November 18, 2020, 2:15am UTC](https://discuss.elastic.co/t/elastic-agent-fail-to-enroll-status-code-404/255772/1 "2020-11-18T02:15:04Z")

</div>

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`

```auto
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?

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [November 18, 2020, 12:26pm UTC](https://discuss.elastic.co/t/elastic-agent-fail-to-enroll-status-code-404/255772/2 "2020-11-18T12:26:32Z")

</div>

What version of Elastic Agent and Kibana are you using?

---

<div class="post-metadata">

**Author:** ![Mikel\_U](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikel_u/32/79306_2.png) [@Mikel\_U](https://discuss.elastic.co/u/Mikel_U)\
**Post date:** [November 23, 2020, 12:26pm UTC](https://discuss.elastic.co/t/elastic-agent-fail-to-enroll-status-code-404/255772/4 "2020-11-23T12:26:02Z")

</div>

I have the same problem.

```auto
# ./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

---

<div class="post-metadata">

**Author:** ![Elastic-Noob](https://avatars.discourse-cdn.com/v4/letter/e/96bed5/32.png) [@Elastic-Noob](https://discuss.elastic.co/u/Elastic-Noob)\
**Post date:** [November 23, 2020, 8:43pm UTC](https://discuss.elastic.co/t/elastic-agent-fail-to-enroll-status-code-404/255772/5 "2020-11-23T20:43:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [November 24, 2020, 8:50am UTC](https://discuss.elastic.co/t/elastic-agent-fail-to-enroll-status-code-404/255772/6 "2020-11-24T08:50:42Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Mikel\_U](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikel_u/32/79306_2.png) [@Mikel\_U](https://discuss.elastic.co/u/Mikel_U)\
**Post date:** [November 24, 2020, 9:02am UTC](https://discuss.elastic.co/t/elastic-agent-fail-to-enroll-status-code-404/255772/7 "2020-11-24T09:02:08Z")

</div>

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 .

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 8:17am UTC](https://discuss.elastic.co/t/elastic-agent-fail-to-enroll-status-code-404/255772/8 "2022-11-04T08:17:52Z")

</div>


