# APM Rum error code 400, data decoding error: gzip: invalid header

**URL:** <https://discuss.elastic.co/t/apm-rum-error-code-400-data-decoding-error-gzip-invalid-header/360923>\
**Category:** APM\
**Tags:** rum\
**Created:** [June 6, 2024, 7:00am UTC](https://discuss.elastic.co/t/apm-rum-error-code-400-data-decoding-error-gzip-invalid-header/360923 "2024-06-06T07:00:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Casper\_Thrane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casper_thrane/32/49777_2.png) [@Casper\_Thrane](https://discuss.elastic.co/u/Casper_Thrane)\
**Post date:** [June 6, 2024, 7:00am UTC](https://discuss.elastic.co/t/apm-rum-error-code-400-data-decoding-error-gzip-invalid-header/360923/1 "2024-06-06T07:00:07Z")

</div>

Hi

We are getting "error code 400, data decoding error: gzip: invalid header" when using the Rum agent. We can see the request Content-type header is set to "gzip", but it is not a header we are setting. Are we missing something in the backend, for supporting gzip, or is the client side which is wrong?

The Rum agent configuration is this

```auto
app.use(ApmVuePlugin, {
    router,
    config: {
      serviceName: 'Sagshylden',
      serverUrl: 'https://apm.app-logging.domdev.lan:443',
      environment: 'development',
    },
  })

```

And the client error is this

[Elastic APM] Failed sending events! Error: [https://apm.app-logging.domdev.lan:443/intake/v2/rum/events](https://apm.app-logging.domdev.lan:443/intake/v2/rum/events) HTTP status: 400 data decoding error: gzip: invalid header

/Casper

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [June 6, 2024, 9:14am UTC](https://discuss.elastic.co/t/apm-rum-error-code-400-data-decoding-error-gzip-invalid-header/360923/2 "2024-06-06T09:14:09Z")

</div>

Hi @Casper_Thrane,

Can you confirm which version of the agent you are using? Also can you share the Elastic `npm` imports you are using in the project (both the agent and Vue extension)?

I would double check you're using the [Elastic RUM agent](https://www.elastic.co/guide/en/apm/agent/rum-js/5.x/index.html) and not the [Elastic Node.js APM agent](https://www.elastic.co/guide/en/apm/agent/nodejs/current/index.html). I found a [similar issue here](https://discuss.elastic.co/t/zlib-invalid-header-error-in-node-js-apm-agent/305616) which was down to using the wrong agent in the app.

Let us know!

---

<div class="post-metadata">

**Author:** ![Casper\_Thrane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casper_thrane/32/49777_2.png) [@Casper\_Thrane](https://discuss.elastic.co/u/Casper_Thrane)\
**Post date:** [June 6, 2024, 10:12am UTC](https://discuss.elastic.co/t/apm-rum-error-code-400-data-decoding-error-gzip-invalid-header/360923/3 "2024-06-06T10:12:01Z")

</div>

This is the depedency we are using

"@elastic/apm-rum-vue": "2.1.6"

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [June 6, 2024, 12:36pm UTC](https://discuss.elastic.co/t/apm-rum-error-code-400-data-decoding-error-gzip-invalid-header/360923/4 "2024-06-06T12:36:55Z")

</div>

Ok, which version of Vue are you using it with?

---

<div class="post-metadata">

**Author:** ![Casper\_Thrane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casper_thrane/32/49777_2.png) [@Casper\_Thrane](https://discuss.elastic.co/u/Casper_Thrane)\
**Post date:** [June 6, 2024, 1:48pm UTC](https://discuss.elastic.co/t/apm-rum-error-code-400-data-decoding-error-gzip-invalid-header/360923/5 "2024-06-06T13:48:10Z")

</div>

We are using ver. 3.4

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [June 7, 2024, 8:27am UTC](https://discuss.elastic.co/t/apm-rum-error-code-400-data-decoding-error-gzip-invalid-header/360923/6 "2024-06-07T08:27:28Z")

</div>

Thanks for confirming. I did come across an [old issue](https://github.com/elastic/apm-agent-rum-js/issues/925) from a prior version that showed that Mirage mocks were interfering with the agent. Can you check if you are using that?

If not can you share the request and response headers?

---

<div class="post-metadata">

**Author:** ![Casper\_Thrane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casper_thrane/32/49777_2.png) [@Casper\_Thrane](https://discuss.elastic.co/u/Casper_Thrane)\
**Post date:** [June 7, 2024, 9:16am UTC](https://discuss.elastic.co/t/apm-rum-error-code-400-data-decoding-error-gzip-invalid-header/360923/7 "2024-06-07T09:16:00Z")

</div>

We found the error. Our developer had setup up a gateway, which zipped all content and added to the Content-type: gzip. He has now create a passthrough rule all @elastic/apm-rum-vue calls.
