# Encoded bytes are incorrect length issue

**URL:** <https://discuss.elastic.co/t/encoded-bytes-are-incorrect-length-issue/260228>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [January 5, 2021, 3:42pm UTC](https://discuss.elastic.co/t/encoded-bytes-are-incorrect-length-issue/260228 "2021-01-05T15:42:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akaren](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@Akaren](https://discuss.elastic.co/u/Akaren)\
**Post date:** [January 5, 2021, 3:42pm UTC](https://discuss.elastic.co/t/encoded-bytes-are-incorrect-length-issue/260228/1 "2021-01-05T15:42:00Z")

</div>

Hi, my elasticsearch 7.7.1 sometimes returns `encoded bytes are incorrect length` error with 400. It's only sometimes, can you tell me the meaning? What can be couse of it?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 5, 2021, 10:36pm UTC](https://discuss.elastic.co/t/encoded-bytes-are-incorrect-length-issue/260228/2 "2021-01-05T22:36:31Z")

</div>

Can you provide a bit more information please.  
What is the full error? Is there anything in the Elasticsearch logs? What client is receiving this error?

---

<div class="post-metadata">

**Author:** ![Akaren](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@Akaren](https://discuss.elastic.co/u/Akaren)\
**Post date:** [January 6, 2021, 10:01am UTC](https://discuss.elastic.co/t/encoded-bytes-are-incorrect-length-issue/260228/3 "2021-01-06T10:01:49Z")

</div>

Elastic log doesn't how anything. I am using elasticsearch-js client and that returns

```
Error: [illegal_argument_exception] encoded bytes are of incorrect length
Jan 6 01:55:35: at respond (/node_modules/elasticsearch/src/lib/transport.js:308:15)
Jan 6 01:55:35: at checkRespForFailure (/node_modules/elasticsearch/src/lib/transport.js:267:7)
Jan 6 01:55:35: at HttpConnector.<anonymous> (/node_modules/elasticsearch/src/lib/connectors/http.js:166:7)
Jan 6 01:55:35: at IncomingMessage.wrapper (/node_modules/lodash/lodash.js:4929:19)
Jan 6 01:55:35: at emitNone (events.js:111:20)
Jan 6 01:55:35: at IncomingMessage.emit (events.js:208:7)
Jan 6 01:55:35: at endReadableNT (_stream_readable.js:1055:12)
Jan 6 01:55:35: at _combinedTickCallback (internal/process/next_tick.js:138:11)
Jan 6 01:55:35: at process._tickCallback (internal/process/next_tick.js:180:9)
```

---

<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:** [February 3, 2021, 10:01am UTC](https://discuss.elastic.co/t/encoded-bytes-are-incorrect-length-issue/260228/4 "2021-02-03T10:01:55Z")

</div>

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