# Error "illegal base64 data at input byte 56" when enroll elastic-agent

**URL:** <https://discuss.elastic.co/t/error-illegal-base64-data-at-input-byte-56-when-enroll-elastic-agent/343553>\
**Category:** Elastic Agent\
**Tags:** fleet\
**Created:** [September 21, 2023, 2:23pm UTC](https://discuss.elastic.co/t/error-illegal-base64-data-at-input-byte-56-when-enroll-elastic-agent/343553 "2023-09-21T14:23:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![neva-ops](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/neva-ops/32/125899_2.png) [@neva-ops](https://discuss.elastic.co/u/neva-ops)\
**Post date:** [September 21, 2023, 2:23pm UTC](https://discuss.elastic.co/t/error-illegal-base64-data-at-input-byte-56-when-enroll-elastic-agent/343553/1 "2023-09-21T14:23:30Z")

</div>

Can't enroll elastic-agent in Fleet.  
When I run elastic-agent with docker compose then I get this errors:  
`{"log.level":"info","@timestamp":"2023-09-21T14:02:42.544Z","message":"HTTP request error","component":{"binary":"fleet-server","dataset":"elastic_agent.fleet_server","id":"fleet-server-default","type":"fleet-server"},"log":{"source":"fleet-server-default"},"service.name":"fleet-server","server.address":"","error.message":"illegal base64 data at input byte 56","ecs.version":"1.6.0","event.duration":42553,"http.request.id":"01HAW0SMF970DGRRMVNF02R28V","http.response.status_code":500,"ecs.version":"1.6.0"}`  
...

```auto

Error: fail to enroll: fail to execute request to fleet-server: status code: 500, fleet-server returned an error: BadRequest, message: illegal base64 data at input byte 56

```

What can I try to resolve the error?

---

<div class="post-metadata">

**Author:** ![neva-ops](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/neva-ops/32/125899_2.png) [@neva-ops](https://discuss.elastic.co/u/neva-ops)\
**Post date:** [September 25, 2023, 8:12am UTC](https://discuss.elastic.co/t/error-illegal-base64-data-at-input-byte-56-when-enroll-elastic-agent/343553/2 "2023-09-25T08:12:45Z")

</div>

Resolved.  
The reason for the erro was that I didn't copy last 2 characters '==' in an enrollment token.

---

<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 23, 2023, 8:13am UTC](https://discuss.elastic.co/t/error-illegal-base64-data-at-input-byte-56-when-enroll-elastic-agent/343553/3 "2023-10-23T08:13:02Z")

</div>

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