Skip to content

Async connection ignores url_prefix parameter #1351

Closed
@tjeerdbakker38

Description

@tjeerdbakker38

Elasticsearch version (bin/elasticsearch --version): 7.8.1

elasticsearch-py version (elasticsearch.__versionstr__): 7.8.1

Please make sure the major version matches the Elasticsearch server you are running.

Description of the problem including expected versus actual behavior:
I'm using AsyncElasticsearch. If I try to query a server with a url_prefix in the address, I get a 404 Not Found in the logs. The logs also mention the URL that the library tries to connect to, and the url prefix is missing from the URL. Expected behaviour is of course a reply to the query.

Steps to reproduce:

client = AsyncElasticsearch('https://es.example.com/prefix')
resp = await client.search(index='index', body={ 'query': { 'match': { 'field': 'value' } } } )

The issue seems to be in elasticsearch/_async/http_aiohttp.py, in perform_request(). It builds a URL using yarl without taking the url_prefix into account. This is still the case in the master branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions