Skip to content

ValueError, Can't set ELASTIC_APM_SERVER_URL as "url:port" with aiohttp since new update of python yarl librairy #2141

Open

Description

Describe the bug:
Can't use ELASTIC_APM_SERVER_URL = "url:port" when building elastic apm instance from aiohttp app since new url control have been added on Yarl dependent library.

To Reproduce

  1. Intall dependencies
  2. configure aiohttp web app with global variable ELASTIC_APM_SERVER_URL = "url:port"
  3. build ElasticAPM(app) instance app as a aiohttp web app.
  4. raises a ValueError from yarl python library because of the format "url:port" not allowed (since yarl 1.13)

Environment (please complete the following information)

  • OS: linux
  • Python version: 3.12.7
  • aiohttp : "3.10.5"
  • elastic-apm = "6.23.0"

Additional context
Error:
File "/home/nonroot/venv/lib/python3.12/site-packages/yarl/_url.py", line 1607, in _host_validate\n raise ValueError(\nValueError: Host 'X.X.X.X:8080' cannot contain ':' (at position 11)"

When downgrading yarl to 1.12.1, it's now working again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions