# IntakeV2ReportingEventHandler - Failed to handle event of type METRICS with this error: access denied

**URL:** <https://discuss.elastic.co/t/intakev2reportingeventhandler-failed-to-handle-event-of-type-metrics-with-this-error-access-denied/241762>\
**Category:** APM\
**Tags:** java\
**Created:** [July 18, 2020, 8:37pm UTC](https://discuss.elastic.co/t/intakev2reportingeventhandler-failed-to-handle-event-of-type-metrics-with-this-error-access-denied/241762 "2020-07-18T20:37:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgantyala](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@rgantyala](https://discuss.elastic.co/u/rgantyala)\
**Post date:** [July 18, 2020, 8:37pm UTC](https://discuss.elastic.co/t/intakev2reportingeventhandler-failed-to-handle-event-of-type-metrics-with-this-error-access-denied/241762/1 "2020-07-18T20:37:55Z")

</div>

Installed Elastic, APM Server, and Kibana 7.8 version on Mac. Using all default configurations for APM Server. APM Server is listening on 8200 port. The curl [http://localhost:8200](http://localhost:8200) is returning successfully.  
curl 127.0.0.1:8200

```auto
{
  "build_date": "2020-06-14T17:07:44Z",
  "build_sha": "06c58bf4e5b675d04314bf44961ffd6b0e13f544",
  "version": "7.8.0"
}

```

However, APM Agent is unable to connect to APM Server and throwing the following error. Please help me in resolving this error.

```auto
2020-07-18 16:30:54,479 [elastic-apm-server-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Failed to handle event of type METRICS with this error: access denied ("java.net.SocketPermission" "127.0.0.1:8200" "connect,resolve")
2020-07-18 16:30:54,480 [elastic-apm-server-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 36 seconds (+/-10%)'

```

Startup Log:

```auto
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
2020-07-19 15:44:12,072 [main] INFO co.elastic.apm.agent.util.JmxUtils - Found JVM-specific OperatingSystemMXBean interface: com.sun.management.OperatingSystemMXBean
2020-07-19 15:44:12,920 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - Starting Elastic APM 1.17.0 as elastic on Java 13.0.1 (Oracle Corporation) Mac OS X 10.15.4
2020-07-19 15:44:12,954 [main] INFO co.elastic.apm.agent.impl.ElasticApmTracer - Tracer switched to RUNNING state
2020-07-19 15:44:13,105 [elastic-apm-server-healthcheck] INFO co.elastic.apm.agent.report.ApmServerHealthChecker - Elastic APM server is available: { "build_date": "2020-06-14T17:07:44Z", "build_sha": "06c58bf4e5b675d04314bf44961ffd6b0e13f544", "version": "7.8.0"}
020-07-19 15:44:15,719 [main] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation javax.net.ssl.SSLContext
java.lang.IllegalStateException: Type not found: java.lang.Throwable
2020-07-19 15:44:18,587 [main] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor
java.lang.IllegalStateException: Type not found: java.lang.Throwable
2020-07-19 15:44:23,678 [main] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation javax.net.SocketFactory
java.lang.IllegalStateException: Type not found: java.lang.Throwable

```

---

<div class="post-metadata">

**Author:** ![miker256](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miker256/32/60563_2.png) [@miker256](https://discuss.elastic.co/u/miker256)\
**Post date:** [July 20, 2020, 12:24am UTC](https://discuss.elastic.co/t/intakev2reportingeventhandler-failed-to-handle-event-of-type-metrics-with-this-error-access-denied/241762/2 "2020-07-20T00:24:47Z")

</div>

This thread may help you out.

> [@\[apm-reporter\] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Error sending data to APM server: cannot retry due to server authentication, in streaming mode, response code is 401](https://discuss.elastic.co/t/apm-reporter-error-co-elastic-apm-agent-report-intakev2reportingeventhandler-error-sending-data-to-apm-server-cannot-retry-due-to-server-authentication-in-streaming-mode-response-code-is-401/217564):
>
> Kibana version : 7.5.2 Elasticsearch version : 7.5.2 APM Server version : 7.5.2 \*\*APM Agent language \*\*: java Original install method : ECK operator 1.0.0 GA I have updated apm-server-quickstart-apm-token secret-token to a known value, but the apm agent is unable to connect to apm server, throwing authentication error. Please let me know which secret should i update for apm server to accept secret-token i have set

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [July 20, 2020, 6:39am UTC](https://discuss.elastic.co/t/intakev2reportingeventhandler-failed-to-handle-event-of-type-metrics-with-this-error-access-denied/241762/3 "2020-07-20T06:39:25Z")

</div>

> [@rgantyala](#):
>
> `access denied ("java.net.SocketPermission" "127.0.0.1:8200" "connect,resolve")`

> [@rgantyala](#):
>
> `Error on transformation org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor`

Hi and welcome to the forum 👋

It seems like your are trying to instrument Elasticsearch with the Java agent. This is currently not supported. You get the access denied error because of the security manager settings of Elasticsearch.

However, when using the Java agent in the applications that make requests to Elasticsearch, it will record the queries.

---

<div class="post-metadata">

**Author:** ![rgantyala](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@rgantyala](https://discuss.elastic.co/u/rgantyala)\
**Post date:** [July 21, 2020, 10:09pm UTC](https://discuss.elastic.co/t/intakev2reportingeventhandler-failed-to-handle-event-of-type-metrics-with-this-error-access-denied/241762/4 "2020-07-21T22:09:55Z")

</div>

Thanks for the response

---

<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:** [August 11, 2020, 6:09pm UTC](https://discuss.elastic.co/t/intakev2reportingeventhandler-failed-to-handle-event-of-type-metrics-with-this-error-access-denied/241762/5 "2020-08-11T18:09:55Z")

</div>

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