# "Error: fleet-server failed: context canceled" error when trying to "Install Fleet Server to a centralized host"

**URL:** <https://discuss.elastic.co/t/error-fleet-server-failed-context-canceled-error-when-trying-to-install-fleet-server-to-a-centralized-host/326112>\
**Category:** Kibana\
**Tags:** fleet\
**Created:** [February 22, 2023, 1:09am UTC](https://discuss.elastic.co/t/error-fleet-server-failed-context-canceled-error-when-trying-to-install-fleet-server-to-a-centralized-host/326112 "2023-02-22T01:09:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Johnston](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matt_johnston/32/117427_2.png) [@Matt\_Johnston](https://discuss.elastic.co/u/Matt_Johnston)\
**Post date:** [February 22, 2023, 1:09am UTC](https://discuss.elastic.co/t/error-fleet-server-failed-context-canceled-error-when-trying-to-install-fleet-server-to-a-centralized-host/326112/1 "2023-02-22T01:09:01Z")

</div>

I am trying to "Add a Fleet Server" but am getting an error when I try to install the Elastic Agent.

 ![Screen Shot 2023-02-21 at 9.08.18 PM](https://us1.discourse-cdn.com/elastic/original/3X/d/8/d8e3725b3864a2ea8d4193a790935d85c942b4d2.png)

After running the following command as instructed:

```auto
curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-8.6.2-darwin-x86_64.tar.gz
tar xzvf elastic-agent-8.6.2-darwin-x86_64.tar.gz
cd elastic-agent-8.6.2-darwin-x86_64
sudo ./elastic-agent install \
  --fleet-server-es=http://localhost:9200 \
  --fleet-server-service-token=AAEAAWVsYXN0aWMvZmxlZXQtc2VydmVyL3Rva2VuLTE2NzcwMjczMDA3NTE6a2FaSWlfX2tSck83Yllwblc2QnNMUQ \
  --fleet-server-policy=fleet-server-policy

```

It seems to be working fine and I get the following prompt from the console:

```auto
Elastic Agent will be installed at /Library/Elastic/Agent and will run as a service. Do you want to continue? [Y/n]:Y

```

After replying with a `Y`, the following is logged to the console:

```auto
{"log.level":"info","@timestamp":"2023-02-21T20:46:33.214-0400","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":407},"message":"Generating self-signed certificate for Fleet Server","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2023-02-21T20:46:35.874-0400","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":803},"message":"Fleet Server - Starting: spawned pid '65719'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2023-02-21T20:46:39.876-0400","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":803},"message":"Fleet Server - Error - EOF","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.6/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.6/fleet-troubleshooting.html

```

I'm not sure why I'm getting the errors mentioned in the last four lines.

---

<div class="post-metadata">

**Author:** ![nchaulet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nchaulet/32/77896_2.png) [@nchaulet](https://discuss.elastic.co/u/nchaulet)\
**Post date:** [February 22, 2023, 1:53am UTC](https://discuss.elastic.co/t/error-fleet-server-failed-context-canceled-error-when-trying-to-install-fleet-server-to-a-centralized-host/326112/2 "2023-02-22T01:53:40Z")

</div>

Hi @Matt_Johnston

the EOF could means that Fleet server is not able to communicate with Elasticsearch if your elasticsearch is not `http://localhost:9200` I suggest you edit the default output to the Elasticsearch URL.

---

<div class="post-metadata">

**Author:** ![Matt\_Johnston](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matt_johnston/32/117427_2.png) [@Matt\_Johnston](https://discuss.elastic.co/u/Matt_Johnston)\
**Post date:** [February 22, 2023, 1:38pm UTC](https://discuss.elastic.co/t/error-fleet-server-failed-context-canceled-error-when-trying-to-install-fleet-server-to-a-centralized-host/326112/3 "2023-02-22T13:38:52Z")

</div>

Thank you for the response.

I'm quite new to all of this. I'm not sure how to edit the default output to the Elasticsearch URL. Could you please provide more details on how to do this? Thanks!

---

<div class="post-metadata">

**Author:** ![nchaulet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nchaulet/32/77896_2.png) [@nchaulet](https://discuss.elastic.co/u/nchaulet)\
**Post date:** [February 22, 2023, 6:51pm UTC](https://discuss.elastic.co/t/error-fleet-server-failed-context-canceled-error-when-trying-to-install-fleet-server-to-a-centralized-host/326112/4 "2023-02-22T18:51:52Z")

</div>

This can be done from the Fleet plugin in the `Settings` tab here

 ![Screenshot 2023-02-22 at 1.51.12 PM](https://us1.discourse-cdn.com/elastic/original/3X/9/3/93dccdd45c6476299d387a24a7f87927ab9549c4.png)

---

<div class="post-metadata">

**Author:** ![Matt\_Johnston](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matt_johnston/32/117427_2.png) [@Matt\_Johnston](https://discuss.elastic.co/u/Matt_Johnston)\
**Post date:** [February 22, 2023, 9:30pm UTC](https://discuss.elastic.co/t/error-fleet-server-failed-context-canceled-error-when-trying-to-install-fleet-server-to-a-centralized-host/326112/5 "2023-02-22T21:30:09Z")

</div>

Okay, so I'm not actually sure what I should be using as the elasticsearch URL. I think it might be `https://localhost:9200` instead of `http://localhost:9200`. When I try to install the Elastic Agent with `https`, I get the following output and error:

```auto
{"log.level":"info","@timestamp":"2023-02-22T17:24:53.774-0400","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":407},"message":"Generating self-signed certificate for Fleet Server","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2023-02-22T17:24:56.819-0400","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":803},"message":"Fleet Server - Starting: spawned pid '9975'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2023-02-22T17:25:00.820-0400","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":803},"message":"Fleet Server - Error - x509: “es01” certificate is not standards compliant","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.6/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.6/fleet-troubleshooting.html

```

It's saying that `"es01" certificate is not standards compliant`. I'm not sure what this means or what I have to do to fix it.

---

<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:** [March 22, 2023, 9:31pm UTC](https://discuss.elastic.co/t/error-fleet-server-failed-context-canceled-error-when-trying-to-install-fleet-server-to-a-centralized-host/326112/7 "2023-03-22T21:31:03Z")

</div>

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