# ERROR co.elastic.apm.agent.configuration.ApmServerConfigurationSource - access denied ("java.net.SocketPermission" "localhost:8200" "connect,resolve")

**URL:** <https://discuss.elastic.co/t/error-co-elastic-apm-agent-configuration-apmserverconfigurationsource-access-denied-java-net-socketpermission-localhost-8200-connect-resolve/280650>\
**Category:** APM\
**Tags:** java\
**Created:** [August 6, 2021, 1:28pm UTC](https://discuss.elastic.co/t/error-co-elastic-apm-agent-configuration-apmserverconfigurationsource-access-denied-java-net-socketpermission-localhost-8200-connect-resolve/280650 "2021-08-06T13:28:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajdeep\_Sahoo](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@Rajdeep\_Sahoo](https://discuss.elastic.co/u/Rajdeep_Sahoo)\
**Post date:** [August 6, 2021, 1:28pm UTC](https://discuss.elastic.co/t/error-co-elastic-apm-agent-configuration-apmserverconfigurationsource-access-denied-java-net-socketpermission-localhost-8200-connect-resolve/280650/1 "2021-08-06T13:28:33Z")

</div>

Hi team,  
I am trying to set up elastic APM for **elastic search application monitoring** , and I am getting the below error  
[elastic-apm-server-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 36 seconds (+/-10%)  
2021-08-06 18:44:54,273 [elastic-apm-remote-config-poller] ERROR co.elastic.apm.agent.configuration.ApmServerConfigurationSource - access denied ("java.net.SocketPermission" "localhost:8200" "connect,resolve")

Does the elastic APM allow us to monitor the elastic search Application ?  
I have configured the java agent in the elastic version 6.8 for monitoring access logs .  
I have used the below JVM args

-javaagent:C:\Users\HP\Downloads\elasticsearch-6.8.0\elasticsearch-6.8.0\agent\elastic-apm-agent-1.25.0.jar  
-Delastic.apm.service\_name=my-cool-service1  
-Delastic.apm.application\_packages=org.elasticsearch,org.apache  
-Delastic.apm.server\_url=http://localhost:8200

**Kibana version** :"7.14.0"

**Elasticsearch version** :"7.14.0"

**APM Server version** :7.14.0"

**APM Agent language and version** :JAVA , 1.25.0

**Browser version** : Chrome 92.0.4515.107

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: Followed the steps mentioned in the elastic site for windows

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [August 8, 2021, 5:17pm UTC](https://discuss.elastic.co/t/error-co-elastic-apm-agent-configuration-apmserverconfigurationsource-access-denied-java-net-socketpermission-localhost-8200-connect-resolve/280650/2 "2021-08-08T17:17:29Z")

</div>

> [@Rajdeep\_Sahoo](#):
>
> I am trying to set up elastic APM for **Elasticsearch application monitoring**

If you are trying to attach an APM agent to Elasticsearch, this is not supported.  
Client operations writing-to or reading-from Elasticsearch will be traced through APM agents if you set up an agent on the service using the client.

The best way to monitor the Elasticsearch cluster is not through APM, but through the [Elastic Stack monitoring](https://www.elastic.co/guide/en/elasticsearch/reference/7.14/monitor-elasticsearch-cluster.html#monitor-elasticsearch-cluster) capabilities.

> [@Rajdeep\_Sahoo](#):
>
> access denied ("java.net.SocketPermission" "localhost:8200" "connect,resolve")

This is coming from the security manager. It is probably related to the above. If not, let us know and we'll guide you what to set in your policy file.

---

<div class="post-metadata">

**Author:** ![Rajdeep\_Sahoo](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@Rajdeep\_Sahoo](https://discuss.elastic.co/u/Rajdeep_Sahoo)\
**Post date:** [August 9, 2021, 8:17am UTC](https://discuss.elastic.co/t/error-co-elastic-apm-agent-configuration-apmserverconfigurationsource-access-denied-java-net-socketpermission-localhost-8200-connect-resolve/280650/3 "2021-08-09T08:17:27Z")

</div>

Not sure about the reason of this error, you can help us in setting policy file.

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [August 9, 2021, 9:30am UTC](https://discuss.elastic.co/t/error-co-elastic-apm-agent-configuration-apmserverconfigurationsource-access-denied-java-net-socketpermission-localhost-8200-connect-resolve/280650/4 "2021-08-09T09:30:53Z")

</div>

Are trying to attach an APM agent to Elasticsearch process?

---

<div class="post-metadata">

**Author:** ![Rajdeep\_Sahoo](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@Rajdeep\_Sahoo](https://discuss.elastic.co/u/Rajdeep_Sahoo)\
**Post date:** [August 10, 2021, 1:30pm UTC](https://discuss.elastic.co/t/error-co-elastic-apm-agent-configuration-apmserverconfigurationsource-access-denied-java-net-socketpermission-localhost-8200-connect-resolve/280650/5 "2021-08-10T13:30:00Z")

</div>

Yes..I am attaching apm agent to elastic process.

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [August 10, 2021, 2:00pm UTC](https://discuss.elastic.co/t/error-co-elastic-apm-agent-configuration-apmserverconfigurationsource-access-denied-java-net-socketpermission-localhost-8200-connect-resolve/280650/6 "2021-08-10T14:00:40Z")

</div>

Then, as mentioned above, this is not supported and not recommended.  
Adding to the policy will not help.  
See above recommended ways to monitor Elasticsearch.

---

<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 31, 2021, 10:00am UTC](https://discuss.elastic.co/t/error-co-elastic-apm-agent-configuration-apmserverconfigurationsource-access-denied-java-net-socketpermission-localhost-8200-connect-resolve/280650/7 "2021-08-31T10:00:56Z")

</div>

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