Elasticsearch Python Client's LicenseClient.post fails


We have upgrade from 7.17.1 to 8.6.2. We are using the Elasticsearch Python Client. We are using LicenseClient.post which was working in 7.17.1 but now is failing with 8.6.2.

I get this error from the client
ApiError(500, 'null_pointer_exception', 'Cannot invoke "String.toLowerCase(java.util.Locale)" because "name" is null')

Is this a bug in the client? When I use a curl command it is successful.

This is how we use it

from elasticsearch import Elasticsearch
from elasticsearch import client as es_client

es_cluster= Elasticsearch([es_addr + es_path],
                          http_auth=(es_user, es_password),
                          verify_certs=(pem_crt_file_full_path is not None) and do_verify_certs,

connected = es_config.ping()


license_client = es_client.LicenseClient(es_cluster)

with open(license_file_full_path, 'r') as license_fd:
    payload = license_fd.read()
    license_return = license_client.post(license=payload)

Client info from es_config.info()

{'name': 'mon-elasticsearch-client-0', 'cluster_name': 'mon-elasticsearch', 'cluster_uuid': 'P9OOQqnyQ223_BkW351vsg', 'version': {'number': '8.6.2', 'build_flavor': 'default', 'build_type': 'docker', 'build_hash': '2d58d0f136141f03239816a4e360a8d17b6d8f29', 'build_date': '2023-02-13T09:35:20.314882762Z', 'build_snapshot': False, 'lucene_version': '9.4.2', 'minimum_wire_compatibility_version': '7.17.0', 'minimum_index_compatibility_version': '7.0.0'}, 'tagline': 'You Know, for Search'}


I've had a quick scan in the documentation and I don't see anything obviously wrong with the usage. Can you raise a potential bug as a GitHub issue on the client?

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