# Sending payload to APM server failed

**URL:** <https://discuss.elastic.co/t/sending-payload-to-apm-server-failed/250912>\
**Category:** APM\
**Tags:** java\
**Created:** [October 5, 2020, 1:19am UTC](https://discuss.elastic.co/t/sending-payload-to-apm-server-failed/250912 "2020-10-05T01:19:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [October 5, 2020, 5:41am UTC](https://discuss.elastic.co/t/sending-payload-to-apm-server-failed/250912/2 "2020-10-05T05:41:41Z")

</div>

Hi,

Others have experienced a similar error(like [here](https://discuss.elastic.co/t/apm-java-agent-exception-at-startup/250208)) and the solution was that the error is not an error and will be demoted to a debug message in later releases.

The real error seems to be this:

> [@Dawn\_Okem](#):
>
> ```auto
> 2020-10-05 02:34:03,919 [elastic-apm-server-reporter] DEBUG co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Sending payload to APM server failed
> java.io.IOException: Error writing request body to server
> at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:3597) ~[?:1.8.0_262]
> at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3580) ~[?:1.8.0_262]
> at java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:253) ~[?:1.8.0_262]
> at java.util.zip.DeflaterOutputStream.finish(DeflaterOutputStream.java:226) ~[?:1.8.0_262]
> at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:238) ~[?:1.8.0_262]
> at co.elastic.apm.agent.report.AbstractIntakeApiHandler.endRequest(AbstractIntakeApiHandler.java:156) [?:?]
> at co.elastic.apm.agent.report.IntakeV2ReportingEventHandler.endRequest(IntakeV2ReportingEventHandler.java:172) [?:?]
> at co.elastic.apm.agent.report.IntakeV2ReportingEventHandler.handleEvent(IntakeV2ReportingEventHandler.java:85) [?:?]
> at co.elastic.apm.agent.report.IntakeV2ReportingEventHandler.onEvent(IntakeV2ReportingEventHandler.java:73) [?:?]
> at co.elastic.apm.agent.report.IntakeV2ReportingEventHandler.onEvent(IntakeV2ReportingEventHandler.java:44) [?:?]
> at co.elastic.apm.agent.shaded.lmax.disruptor.BatchEventProcessor.processEvents(BatchEventProcessor.java:168) [?:?]
> at co.elastic.apm.agent.shaded.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:125) [?:?]
> at java.lang.Thread.run(Thread.java:748) [?:1.8.0_262]
> 
> ```

Did you have a look in the logs on the APM server?  
Do you have a firewall in between(although you already said that the agent can connect for healthchecks)?

Best regards  
Wolfram

---

_[View the full topic](https://discuss.elastic.co/t/sending-payload-to-apm-server-failed/250912)._
