# Elastic agent enroll fail : Error: fail to enroll: fail to execute request to fleet-server: Forbidden

**URL:** https://discuss.elastic.co/t/elastic-agent-enroll-fail-error-fail-to-enroll-fail-to-execute-request-to-fleet-server-forbidden/376893
**Category:** Elasticsearch
**Tags:** fleet
**Created:** [April 8, 2025, 5:24am UTC](https://discuss.elastic.co/t/elastic-agent-enroll-fail-error-fail-to-enroll-fail-to-execute-request-to-fleet-server-forbidden/376893 "2025-04-08T05:24:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Priyanka\_chauhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/priyanka_chauhan/32/86146_2.png) [@Priyanka\_chauhan](https://discuss.elastic.co/u/Priyanka_chauhan)
#### Post date: [April 8, 2025, 5:24am UTC](https://discuss.elastic.co/t/elastic-agent-enroll-fail-error-fail-to-enroll-fail-to-execute-request-to-fleet-server-forbidden/376893/1 "2025-04-08T05:24:27Z")

</div>

{"log.level":"info","@timestamp":"2025-04-08T10:39:28.316+0530","log.origin":{"function":"[github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(\*enrollCmd).enrollWithBackoff","file.name":"cmd/enroll\_cmd.go","file.line":526},"message":"1st](http://github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).enrollWithBackoff%22,%22file.name%22:%22cmd/enroll_cmd.go%22,%22file.line%22:526%7D,%22message%22:%221st) enrollment attempt failed, retrying enrolling to URL: [https://1.1.1.1:8220/](https://1.1.1.1:8220/) with exponential backoff (init 1s, max 10s)","ecs.version":"1.6.0"}  
Error: fail to enroll: fail to execute request to fleet-server: Forbidden.

---

<div class="post-metadata">

### Author: ![MichelLaterman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michellaterman/32/110221_2.png) [@MichelLaterman](https://discuss.elastic.co/u/MichelLaterman)
#### Post date: [April 23, 2025, 4:28pm UTC](https://discuss.elastic.co/t/elastic-agent-enroll-fail-error-fail-to-enroll-fail-to-execute-request-to-fleet-server-forbidden/376893/2 "2025-04-23T16:28:35Z")

</div>

This is likely caused by an invalid enrollment key
