# \[Django Python\] SERVER\_TIMEOUT

**URL:** <https://discuss.elastic.co/t/django-python-server-timeout/171855>\
**Category:** APM\
**Created:** [March 12, 2019, 3:54am UTC](https://discuss.elastic.co/t/django-python-server-timeout/171855 "2019-03-12T03:54:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabriel\_tessier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gabriel_tessier/32/27911_2.png) [@gabriel\_tessier](https://discuss.elastic.co/u/gabriel_tessier)\
**Post date:** [March 12, 2019, 3:54am UTC](https://discuss.elastic.co/t/django-python-server-timeout/171855/1 "2019-03-12T03:54:51Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

**Kibana version** :  
Version: 6.5.4  
**Elasticsearch version** :  
"version" : {  
"number" : "6.5.4",  
....  
**APM Server version** :  
apm-server version 6.5.4 (amd64), libbeat 6.5.4 [fd4f1ac006d8896e4957b6c01fb1e9b9ff04afd7 built 2018-12-17 20:15:18 +0000 UTC]  
**APM Agent language and version** :  
Python django elastic-apm==3.0.1  
**Browser version** :  
Firefox / Chrome  
**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:  
yum \<--- follow the instruction on the kibana "setup instruction" page  
**Fresh install or upgraded from other version?**  
Fresh install  
**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.  
All default setup.  
**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

The context:  
I installed from a couple of time on my local without problem now I want to set it on production, there's maybe something I mess I check and recheck the documentation and run all the tests and check but can't figure out the problem.

The environment:  
AWS all EC2 instance  
n servers with client agent and my app  
APM server (installed on one of the elastic instance)  
3 servers with elastic

security group are open to allow the client agent to communicate with APM server and APM server can access elastic as it run on the same server, access via localhost:9200

I follow the instruction on the "setup instructions" in Kibana. Select "RPM" click click and  
click on "Check APM server status" return "You have correctly setup APM Server"

First step completed! 🥳  
I change nothing all default as elastic is running on same server than APM server.

Second step APM Agents:

Choose Django  
As the conf was already done for my dev plateform I keep as it only change the server ip for production .  
Then click on Check agent status that return "Data successfully received from one or more agents"

Wait a couple of second then click on "Launch APM", (Did exactly same on dev [all on the same server]) get No services were found.

So there I start to read the doc 😊 on apm server I run  
sudo service apm-server status \<--- server was correctly running from a couple of minutes nothing in the logs.

According to the doc:

> **[Common problems | APM Server Reference \[7.15\] | Elastic](https://www.elastic.co/guide/en/apm/server/current/common-problems.html)**

I run this:  
`sudo apm-server test config` return "Config OK"

`sudo apm-server test output`

> elasticsearch: [http://localhost:9200](http://localhost:9200)...  
> parse url... OK  
> connection...  
> parse host... OK  
> dns lookup... OK  
> addresses: 127.0.0.1  
> dial up... OK  
> TLS... WARN secure connection disabled  
> talk to server... OK  
> version: 6.5.4

Server look fine.

Next step check the client and doc troubleshooting:

> **[Django support | APM Python Agent Reference \[6.x\] | Elastic](https://www.elastic.co/guide/en/apm/agent/python/current/django-support.html#django-troubleshooting)**

run `python manage.py elasticapm check`

> Service name is set, good job!
> 
> - optional SECRET\_TOKEN not set
> 
> SERVER\_URL http://#.#.#.#:8200 looks fine \<--- this line was edited to hide the ip
> 
> DEBUG mode is disabled! Looking good!
> 
> Looks like everything should be ready!

`python manage.py elasticapm test`

```
Trying to send a test error to APM Server using these settings:

SERVICE_NAME:	MyProject
SECRET_TOKEN:	
SERVER: http://#.#.#.#:8200

Success! We tracked the error successfully! You should be able to see it in a few seconds at the above URL
PID 23638: ElasticAPM is attempting to send 1 pending messages
Waiting up to 10 seconds, press Ctrl-C to quit.
PID 23638: done, took 9.90 seconds to complete.

```

On another I have:

```
Success! We tracked the error successfully! You should be able to see it in a few seconds at the above URL
ERROR Connection to APM Server timed out (url: http://#.#.#.#:8200/v1/errors, timeout: None seconds) 
ERROR Failed to submit message: '<no message value>' 

```

Not clean if it success or not.

According to the documentation:

> **[Configuration | APM Python Agent Reference \[6.x\] | Elastic](https://www.elastic.co/guide/en/apm/agent/python/current/configuration.html#config-server-timeout)**

Add `'SERVER_TIMEOUT': '15s',`

But get this error and crash my server 😰:

```
File "/home/ec2-user/.virtualenvs/my_project/local/lib64/python3.5/site-packages/elasticapm/conf/ __init__.py", line 47, in __set__
    value = self.type(value)
ValueError: could not convert string to float: '15s'

```

What is the correct syntax? is the problem from timeout only or there's some missing configuration as all the checks return "OK".

**Steps to reproduce** :

1. Follow the installation step
2. Go on kibana
3. click on the APM link
4. follow the step detailed before

**Errors in browser console (if relevant)**:

**Provide logs and/or server output (if relevant)**:

Sorry for the long message.

---

<div class="post-metadata">

**Author:** ![gabriel\_tessier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gabriel_tessier/32/27911_2.png) [@gabriel\_tessier](https://discuss.elastic.co/u/gabriel_tessier)\
**Post date:** [March 12, 2019, 5:58am UTC](https://discuss.elastic.co/t/django-python-server-timeout/171855/2 "2019-03-12T05:58:14Z")

</div>

ok found the problem was here:

> [@Elasticsearch APM agent not pushing to server](https://discuss.elastic.co/t/elasticsearch-apm-agent-not-pushing-to-server/138547):
>
> 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.con…

I think check tools are not checking correctly adding a "pong" from the server will be more useful to figure out this kind of problem.

> **[PING](https://redis.io/commands/ping/)**
>
> Returns the server's liveliness response.

---

<div class="post-metadata">

**Author:** ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)\
**Post date:** [March 12, 2019, 9:52am UTC](https://discuss.elastic.co/t/django-python-server-timeout/171855/3 "2019-03-12T09:52:01Z")

</div>

Happy to hear you could resolve the issue!  
One additional note, you mentioned you are using the `3.0.1` version of the python agent. This is not the latest release. If you want to view documentation for that, you have to change from `current` to `3.x` in the docs: [https://www.elastic.co/guide/en/apm/agent/python/3.x/index.html](https://www.elastic.co/guide/en/apm/agent/python/3.x/index.html)

---

<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:** [April 2, 2019, 5:52am UTC](https://discuss.elastic.co/t/django-python-server-timeout/171855/4 "2019-04-02T05:52:04Z")

</div>

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