# Error: fail to enroll: fail to execute request to fleet-server: status code: 400

**URL:** <https://discuss.elastic.co/t/error-fail-to-enroll-fail-to-execute-request-to-fleet-server-status-code-400/284406>\
**Category:** Beats\
**Tags:** fleet, elastic-agent\
**Created:** [September 16, 2021, 1:23pm UTC](https://discuss.elastic.co/t/error-fail-to-enroll-fail-to-execute-request-to-fleet-server-status-code-400/284406 "2021-09-16T13:23:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![b0r1s](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/b0r1s/32/85475_2.png) [@b0r1s](https://discuss.elastic.co/u/b0r1s)\
**Post date:** [September 16, 2021, 1:23pm UTC](https://discuss.elastic.co/t/error-fail-to-enroll-fail-to-execute-request-to-fleet-server-status-code-400/284406/1 "2021-09-16T13:23:49Z")

</div>

I'm trying to install Elastic Agent 7.14.1 on Fleet Server 7.14.1 with the following commands:  
On Windows 10:  
`.\elastic-agent.exe install -f --url=https://myfleetserver:8220 --enrollment-token=longapitoken --insecure`

On CentOS:  
`sudo ./elastic-agent install -f --url=https://myfleetserver:8220 --enrollment-token=longapitoken --insecure `

And I get the result:

```auto
Error: fail to enroll: fail to execute request to fleet-server: status code: 400, fleet-server returned an error: BadRequest
Error: enroll command failed with exit code: 1

```

For Linux I tried with yum install and downloading the elastic-agent-7.14.1-linux-x86\_64.tar.gz from web. I also tried it with the enroll command instead of install. In any case the error is the same. I don't know what can I do. I looked here and Google, but I can't solve this yet. Any help will be appreciate!

---

<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:** [October 14, 2021, 3:24pm UTC](https://discuss.elastic.co/t/error-fail-to-enroll-fail-to-execute-request-to-fleet-server-status-code-400/284406/2 "2021-10-14T15:24:07Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
