# Fleet-server failed: context canceled

**URL:** <https://discuss.elastic.co/t/fleet-server-failed-context-canceled/302348>\
**Category:** Kibana\
**Tags:** elastic-stack-monitoring, elastic-stack-security, elastic-stack-alerting, fleet, elastic-agent\
**Created:** [April 13, 2022, 2:30pm UTC](https://discuss.elastic.co/t/fleet-server-failed-context-canceled/302348 "2022-04-13T14:30:09Z")\
**Posts on this page:** 4\
**Page:** 1

<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 13, 2022, 2:30pm UTC](https://discuss.elastic.co/t/fleet-server-failed-context-canceled/302348/1 "2022-04-13T14:30:09Z")

</div>

Hi  
Having trouble enrolling fleet server  
Elasticsearch kibana and elastic agent versions 7.17.2

command I used is

```auto
.\elastic-agent.exe install --url=https://fleet server ip:8220 --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

```

I get this error

```auto
Elastic Agent will be installed at C:\Program Files\Elastic\Agent and will run as a service. Do you want to continue? [Y/n]:y
2022-04-13T14:15:24.609Z INFO cmd/enroll_cmd.go:386 Generating self-signed certificate for Fleet Server
2022-04-13T14:15:26.477Z INFO cmd/enroll_cmd.go:743 Waiting for Elastic Agent to start Fleet Server
2022-04-13T14:15:41.389Z INFO cmd/enroll_cmd.go:776 Fleet Server - Starting
Error: fleet-server failed: context canceled
For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/7.17/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/7.17/fleet-troubleshooting.html

```

Could anyone please help.  
Thank You.

---

<div class="post-metadata">

**Author:** ![Edoardo\_Tenani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/edoardo_tenani/32/94302_2.png) [@Edoardo\_Tenani](https://discuss.elastic.co/u/Edoardo_Tenani)\
**Post date:** [April 14, 2022, 11:01am UTC](https://discuss.elastic.co/t/fleet-server-failed-context-canceled/302348/2 "2022-04-14T11:01:00Z")

</div>

Hi @spo, can you enable debug log levels, retry and provide them?

My hypothesis is either is a bug or the enrolment fails (is the fleet server instance reachable?)

---

<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 14, 2022, 3:00pm UTC](https://discuss.elastic.co/t/fleet-server-failed-context-canceled/302348/3 "2022-04-14T15:00:01Z")

</div>

I figured the issue here.  
I did not give correct file format when I copied the certs from the ubuntu ELK server where I generated them to the Wndows server where I was trying to run fleet.  
Once the file format was corrected .I was able to enroll the fleet server.

Thanks

---

<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 12, 2022, 3:00pm UTC](https://discuss.elastic.co/t/fleet-server-failed-context-canceled/302348/4 "2022-05-12T15:00:03Z")

</div>

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