# Elasticsearch APM agent not pushing to server

**URL:** <https://discuss.elastic.co/t/elasticsearch-apm-agent-not-pushing-to-server/138547>\
**Category:** APM\
**Created:** [July 4, 2018, 11:24am UTC](https://discuss.elastic.co/t/elasticsearch-apm-agent-not-pushing-to-server/138547 "2018-07-04T11:24:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hHelen](https://avatars.discourse-cdn.com/v4/letter/h/7ea924/32.png) [@hHelen](https://discuss.elastic.co/u/hHelen)\
**Post date:** [July 4, 2018, 11:24am UTC](https://discuss.elastic.co/t/elasticsearch-apm-agent-not-pushing-to-server/138547/1 "2018-07-04T11:24:58Z")

</div>

I have a server running on a remote computer and have installed the APM agent on another computer with Flask installed. But for some reason I keep getting this error on the client:

Connection to APM Server timed out (url:[http://134.446.25.12:8200](http://134.446.25.12:8200)'/v1/transactions, timeout: None seconds)  
Failed to submit message: ''

Here is the sample flask code that I'm trying to run:

from flask import Flask  
from elasticapm.contrib.flask import ElasticAPM  
from flask import abort

app = Flask( **name** )  
app.config['ELASTIC\_APM'] = {  
'APP\_NAME': 'mytestamp',  
'SERVICE\_NAME': 'myapp',  
'SERVER\_URL': '[http://134.446.25.12:8200](http://134.446.25.12:8200)'  
}  
apm = ElasticAPM(app)

@app.route('/ok', methods=['GET', 'POST'])  
def ok():  
apm.capture\_message('ok message')  
return 'ok'

The server has no security in place that is stopping the connection so not sure what else to do.

Any help is appreciated.

Helen

---

<div class="post-metadata">

**Author:** ![beniwohli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/beniwohli/32/21256_2.png) [@beniwohli](https://discuss.elastic.co/u/beniwohli)\
**Post date:** [July 4, 2018, 11:45am UTC](https://discuss.elastic.co/t/elasticsearch-apm-agent-not-pushing-to-server/138547/2 "2018-07-04T11:45:52Z")

</div>

Hi Helen

one possible cause is that the apm-server on your other machine isn't bound to listen to external connections. By default, the apm-server only binds to localhost. You can change that by using the `-E apm-server.host` option:

```
./apm-server -e -E apm-server.host=0.0.0.0:8200

```

Note however that this will expose your apm-server to any other machine that can reach that IP address, so we suggest to use https and a secret token to secure your apm-server. See [https://www.elastic.co/guide/en/apm/server/current/security.html](https://www.elastic.co/guide/en/apm/server/current/security.html) for more information.

---

<div class="post-metadata">

**Author:** ![hHelen](https://avatars.discourse-cdn.com/v4/letter/h/7ea924/32.png) [@hHelen](https://discuss.elastic.co/u/hHelen)\
**Post date:** [July 4, 2018, 1:11pm UTC](https://discuss.elastic.co/t/elasticsearch-apm-agent-not-pushing-to-server/138547/3 "2018-07-04T13:11:42Z")

</div>

@beniwohli Thanks, you are correct. Changing the connection to listen to external connections did the trick.

Nice one 🙂

---

<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:** [July 25, 2018, 9:12am UTC](https://discuss.elastic.co/t/elasticsearch-apm-agent-not-pushing-to-server/138547/4 "2018-07-25T09:12:02Z")

</div>

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