Failed to submit message: 'Connection to APM Server timed out (url: http://localhost:8200/intake/v2/events, timeout: 5 seconds)'

Kibana version:8.3.2

Elasticsearch version: elastic-apm==6.10.1 (Django==4.0.5)

APM Server version:8.3.2

APM Agent language and version:Django==4.0.5

Browser version:Chrome

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):
on ./manage.py elasticapm check

HTTP error while fetching server information: HTTPConnectionPool(host='localhost', port=8200): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fc4ea8b5a90>: Failed to establish a new connection: [Errno 111] Connection refused'))
Failed to submit message: 'Connection to APM Server timed out (url: http://localhost:8200/intake/v2/events, timeout: 5 seconds)

on ./manage.py elasticapm test

Oops. That didn't work. The following error occured:
HTTP error while fetching server information: HTTPConnectionPool(host='localhost', port=8200): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5ce7652d60>: Failed to establish a new connection: [Errno 111] Connection refused'))
Failed to submit message: 'Connection to APM Server timed out (url: http://localhost:8200/intake/v2/events, timeout: 5 seconds)'

on django container getting

Failed to submit message: 'Connection to APM Server timed out (url: http://localhost:8200/intake/v2/events, timeout: 5 seconds)'

configured using Django support | APM Python Agent Reference [6.x] | Elastic. documentation.

Hi Shaheen,

Are you able to reach APM-Server by any process or agent? One possible cause might be that the host configuration on APM-Server is not configured to listen on localhost.

If the above doesn't help please share your APM-Server configuration and APM-Server logs so we can look further.

these issue fixed by adding

ELASTIC_APM_SERVER_URL: http://apm-server:8200

this on .env
but

Failed to submit message: "Unable to reach APM Server: HTTPConnectionPool(host='apm-server', port=8200): Read timed out. (read timeout=5) (url: http://apm-server:8200/intake/v2/events)"

this error is still on django logs

How/where are you running your APM-Server and django container? From our above correspondence, I suspect you are running them in docker.

If this is the case, I suspect that you are running apm-server in a separate docker network. You can try to connect your django container with the apm-server network by using docker network connect <network_name> <container_name> (full ref). You can get the list of network using docker network ls.

1 Like

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