[Django Python] SERVER_TIMEOUT

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 :slight_smile:

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! :partying_face:
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 :blush: 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:
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...
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:

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:
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 :cold_sweat::

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.

ok found the problem was here:

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.

https://redis.io/commands/ping

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

1 Like

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