# Elastic agent is unable to enroll to fleet

**URL:** <https://discuss.elastic.co/t/elastic-agent-is-unable-to-enroll-to-fleet/301679>\
**Category:** Beats\
**Tags:** fleet, beats-module, elastic-agent\
**Created:** [April 5, 2022, 9:58pm UTC](https://discuss.elastic.co/t/elastic-agent-is-unable-to-enroll-to-fleet/301679 "2022-04-05T21:58:37Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![zx8086](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zx8086/32/94917_2.png) [@zx8086](https://discuss.elastic.co/u/zx8086)\
**Post date:** [April 12, 2022, 2:32pm UTC](https://discuss.elastic.co/t/elastic-agent-is-unable-to-enroll-to-fleet/301679/22 "2022-04-12T14:32:29Z")

</div>

What os are you using ? Also maybe putting them in quotes?

Also what happens if you remove that entry ?

---

<div class="post-metadata">

**Author:** ![spo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spo/32/78055_2.png) [@spo](https://discuss.elastic.co/u/spo)\
**Post date:** [April 12, 2022, 2:59pm UTC](https://discuss.elastic.co/t/elastic-agent-is-unable-to-enroll-to-fleet/301679/23 "2022-04-12T14:59:21Z")

</div>

so the absolute path error does not come up if I give space after =  
`--certificate-authorities= /usr/share/elasticsearch/ca/ca.crt`

but I am getting a different error now

ran this command

```auto
.\elastic-agent.exe install --url=https://fleet server ip:8220 -f --fleet-server-es=https://elasticsearch ip:9200 --fleet-server-service-token= *******--fleet-server-policy=******** --certificate-authorities= /usr/share/elasticsearch/ca/ca.crt --fleet-server-es-ca= /usr/share/elasticsearch/elastic-stack-ca.p12 --fleet-server-cert= /etc/elasticsearch/fleet-server.crt --fleet-server-cert-key= /etc/elasticsearch/fleet-server.key

```

output

```auto
{"log.level":"info","@timestamp":"2022-04-12T14:52:39.217Z","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":387},"message":"Generating self-signed certificate for Fleet Server","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-12T14:52:40.996Z","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":727},"message":"Waiting for Elastic Agent to start","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-12T14:52:47.037Z","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":777},"message":"Fleet Server - Starting","ecs.version":"1.6.0"}
Error: fleet-server failed: context canceled
For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/8.1/fleet-troubleshooting.html
Error: enroll command failed with exit code: 1
For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/8.1/fleet-troubleshooting.html

```

---

<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:** [May 10, 2022, 5:00pm UTC](https://discuss.elastic.co/t/elastic-agent-is-unable-to-enroll-to-fleet/301679/24 "2022-05-10T17:00:13Z")

</div>

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

[Previous page](https://discuss.elastic.co/t/elastic-agent-is-unable-to-enroll-to-fleet/301679.md?page=1)
