# APM agent not able to connect apm server

**URL:** <https://discuss.elastic.co/t/apm-agent-not-able-to-connect-apm-server/214874>\
**Category:** APM\
**Created:** [January 13, 2020, 4:36pm UTC](https://discuss.elastic.co/t/apm-agent-not-able-to-connect-apm-server/214874 "2020-01-13T16:36:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sattishv](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sattishv](https://discuss.elastic.co/u/sattishv)\
**Post date:** [January 13, 2020, 4:36pm UTC](https://discuss.elastic.co/t/apm-agent-not-able-to-connect-apm-server/214874/1 "2020-01-13T16:36:22Z")

</div>

Hi Team,

We were able to install elastic search, kibana and apm server successfully on MacOS and apm agent was hooked with the application deployed in ubuntu but not able to connect to apm server.

**Kibana version** :  
7.5.1  
**Elasticsearch version** :  
7.5.1  
**APM Server version** :  
7.5.1  
**APM Agent language and version** :  
Java 7.5.1

**Fresh install or upgraded from other version?**  
Fresh install

\*\*Description of the problem including expected versus actual behavior. Please include screenshots config used:  
-javaagent:/elasticapmagent/elastic-apm-agent-1.12.0.jar

-Delastic.apm.service\_name=sampleserv

-Delastic.apm.server\_url=http://apm-serveripaddress:8200

-Delastic.apm.log\_level=DEBUG

**Steps to reproduce** :  
1.  
2.  
3.

**Provide logs and/or server output (if relevant)**:  
INFO | jvm 1 | 2020/01/13 08:32:24 | java.net.SocketTimeoutException: connect timed out  
INFO | jvm 1 | 2020/01/13 08:32:24 | at java.net.PlainSocketImpl.socketConnect(Native Method)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at java.net.Socket.connect(Socket.java:589)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at sun.net.NetworkClient.doConnect(NetworkClient.java:175)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at sun.net.www.http.HttpClient.(HttpClient.java:242)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at sun.net.www.http.HttpClient.New(HttpClient.java:339)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at sun.net.www.http.HttpClient.New(HttpClient.java:357)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at co.elastic.apm.agent.report.IntakeV2ReportingEventHandler.startRequest(IntakeV2ReportingEventHandler.java:200)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at co.elastic.apm.agent.report.IntakeV2ReportingEventHandler.handleEvent(IntakeV2ReportingEventHandler.java:138)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at co.elastic.apm.agent.report.IntakeV2ReportingEventHandler.onEvent(IntakeV2ReportingEventHandler.java:116)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at co.elastic.apm.agent.report.IntakeV2ReportingEventHandler.onEvent(IntakeV2ReportingEventHandler.java:50)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at co.elastic.apm.agent.shaded.lmax.disruptor.BatchEventProcessor.processEvents(BatchEventProcessor.java:168)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at co.elastic.apm.agent.shaded.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:125)  
INFO | jvm 1 | 2020/01/13 08:32:24 | at java.lang.Thread.run(Thread.java:748)  
INFO | jvm 1 | 2020/01/13 08:32:24 | 2020-01-13 08:32:24.872 [apm-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 36 seconds (+/-10%)

INFO | jvm 1 | 2020/01/13 08:31:21 | 2020-01-13 08:31:20.991 [apm-remote-config-poller] DEBUG co.elastic.apm.agent.configuration.ApmServerConfigurationSource - Reloading configuration from APM Server [http://10.229.100.178:8200/config/v1/agents](http://10.229.100.178:8200/config/v1/agents)  
INFO | jvm 1 | 2020/01/13 08:31:26 | 2020-01-13 08:31:25.992 [apm-remote-config-poller] DEBUG co.elastic.apm.agent.report.ApmServerClient - Exception while interacting with APM Server, trying next one.  
INFO | jvm 1 | 2020/01/13 08:31:31 | 2020-01-13 08:31:30.997 [apm-remote-config-poller] ERROR co.elastic.apm.agent.report.HttpUtils - Exception when closing input stream of HttpURLConnection.  
INFO | jvm 1 | 2020/01/13 08:31:31 | 2020-01-13 08:31:30.997 [apm-remote-config-poller] ERROR co.elastic.apm.agent.configuration.ApmServerConfigurationSource - connect timed out  
INFO | jvm 1 | 2020/01/13 08:31:31 | 2020-01-13 08:31:30.997 [apm-remote-config-poller] DEBUG co.elastic.apm.agent.configuration.ApmServerConfigurationSource - Scheduling next remote configuration reload in 300s  
INFO | jvm 1 | 2020/01/13 08:31:40 | 2020-01-13 08:31:40.632 [apm-reporter] DEBUG co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Receiving METRICS event (sequence 25)  
INFO | jvm 1 | 2020/01/13 08:31:40 | 2020-01-13 08:31:40.633 [apm-reporter] DEBUG co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Starting new request to [http://10.229.100.178:8200/intake/v2/events](http://10.229.100.178:8200/intake/v2/events)  
INFO | jvm 1 | 2020/01/13 08:31:45 | 2020-01-13 08:31:45.638 [apm-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Failed to handle event of type METRICS with this error: connect timed out  
INFO | jvm 1 | 2020/01/13 08:31:45 | 2020-01-13 08:31:45.638 [apm-reporter] DEBUG co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Event handling failure  
INFO | jvm 1 | 2020/01/13 08:31:45 | java.net.SocketTimeoutException: connect timed out  
INFO | jvm 1 | 2020/01/13 08:31:45 | at java.net.PlainSocketImpl.socketConnect(Native Method)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at java.net.Socket.connect(Socket.java:589)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at sun.net.NetworkClient.doConnect(NetworkClient.java:175)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at sun.net.www.http.HttpClient.(HttpClient.java:242)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at sun.net.www.http.HttpClient.New(HttpClient.java:339)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at sun.net.www.http.HttpClient.New(HttpClient.java:357)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at co.elastic.apm.agent.report.IntakeV2ReportingEventHandler.startRequest(IntakeV2ReportingEventHandler.java:200)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at co.elastic.apm.agent.report.IntakeV2ReportingEventHandler.handleEvent(IntakeV2ReportingEventHandler.java:138)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at co.elastic.apm.agent.report.IntakeV2ReportingEventHandler.onEvent(IntakeV2ReportingEventHandler.java:116)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at co.elastic.apm.agent.report.IntakeV2ReportingEventHandler.onEvent(IntakeV2ReportingEventHandler.java:50)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at co.elastic.apm.agent.shaded.lmax.disruptor.BatchEventProcessor.processEvents(BatchEventProcessor.java:168)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at co.elastic.apm.agent.shaded.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:125)  
INFO | jvm 1 | 2020/01/13 08:31:45 | at java.lang.Thread.run(Thread.java:748)  
INFO | jvm 1 | 2020/01/13 08:31:45 | 2020-01-13 08:31:45.639 [apm-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 36 seconds (+/-10%)  
INFO | jvm 1 | 2020/01/13 08:32:19 | 2020-01-13 08:32:19.869 [apm-reporter] DEBUG co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Receiving METRICS event (sequence 26)  
INFO | jvm 1 | 2020/01/13 08:32:19 | 2020-01-13 08:32:19.869 [apm-reporter] DEBUG co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Starting new request to [http://10.229.100.178:8200/intake/v2/events](http://10.229.100.178:8200/intake/v2/events)  
INFO | jvm 1 | 2020/01/13 08:32:24 | 2020-01-13 08:32:24.872 [apm-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Failed to handle event of type METRICS with this error: connect timed out  
INFO | jvm 1 | 2020/01/13 08:32:24 | 2020-01-13 08:32:24.872 [apm-reporter] DEBUG co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Event handling failure

---

<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:** [January 13, 2020, 5:05pm UTC](https://discuss.elastic.co/t/apm-agent-not-able-to-connect-apm-server/214874/2 "2020-01-13T17:05:04Z")

</div>

Hi and thanks for you question. Check out this part of the troubleshooting guide: [https://www.elastic.co/guide/en/apm/agent/java/current/trouble-shooting.html#trouble-shooting-no-data](https://www.elastic.co/guide/en/apm/agent/java/current/trouble-shooting.html#trouble-shooting-no-data)

---

<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, 2020, 1:05pm UTC](https://discuss.elastic.co/t/apm-agent-not-able-to-connect-apm-server/214874/3 "2020-02-03T13:05:04Z")

</div>

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