# Elasticsearch Python Client's LicenseClient.post fails

**URL:** <https://discuss.elastic.co/t/elasticsearch-python-clients-licenseclient-post-fails/328850>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [March 29, 2023, 4:20pm UTC](https://discuss.elastic.co/t/elasticsearch-python-clients-licenseclient-post-fails/328850 "2023-03-29T16:20:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kbujold\_wr](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@kbujold\_wr](https://discuss.elastic.co/u/kbujold_wr)\
**Post date:** [March 29, 2023, 4:20pm UTC](https://discuss.elastic.co/t/elasticsearch-python-clients-licenseclient-post-fails/328850/1 "2023-03-29T16:20:09Z")

</div>

Hi,

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

```auto
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,
                          ca_certs=pem_file,
                          client_cert=client_crt_file_full_path,
                          client_key=client_key_file_full_path,
                          ssl_show_warn=True)

connected = es_config.ping()

<snip>

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()

```auto
{'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'}

```

Thanks,  
Kris

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [March 30, 2023, 11:33am UTC](https://discuss.elastic.co/t/elasticsearch-python-clients-licenseclient-post-fails/328850/2 "2023-03-30T11:33:32Z")

</div>

> [@kbujold\_wr](#):
>
> 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.

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](https://github.com/elastic/elasticsearch-py/labels/bug) on the client?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 27, 2023, 11:34am UTC](https://discuss.elastic.co/t/elasticsearch-python-clients-licenseclient-post-fails/328850/3 "2023-04-27T11:34:20Z")

</div>

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