elasticsearch.exceptions.RequestError [illegal_argument_exception]

I am getting this exception after a while when i try to append JSON document under same ID in the Elasticsearch index

How my data is getting appended.

Index_name
id : 1234
JSON{}
JSON{}
.
.
JSON{}

My code snippet:
es.update(index=NEW_INDEX, id=source_id, body={"script": {
"lang": "painless",
"inline": "ctx._source.{}.CNT += params.CNT".format(StudentID),
"params": {
"CNT": 1
}
}})

My exception :

Traceback (most recent call last):
File "consumer.py", line 139, in
"uuid": packet_dict
File "/home/machine/Desktop/PyDir/lib/python3.6/site-packages/elasticsearch/client/utils.py", line 84, in _wrapped
return func(*args, params=params, **kwargs)
File "/home/machine/Desktop/PyDir/lib/python3.6/site-packages/elasticsearch/client/init.py", line 664, in update
"POST", _make_path(index, doc_type, id, "_update"), params=params, body=body
File "/home/machine/Desktop/PyDir/lib/python3.6/site-packages/elasticsearch/transport.py", line 353, in perform_request
timeout=timeout,
File "/home/machine/Desktop/PyDir/lib/python3.6/site-packages/elasticsearch/connection/http_urllib3.py", line 251, in perform_request
self._raise_error(response.status, raw_data)
File "/home/machine/Desktop/PyDir/lib/python3.6/site-packages/elasticsearch/connection/base.py", line 178, in _raise_error
status_code, error_message, additional_info
elasticsearch.exceptions.RequestError: RequestError(400, 'illegal_argument_exception', '[localhost.localdomain][10.0.3.15:9300][indices:data/write/update[s]]')

Code seems to work for sometime then produces the above exception.

do you have a full exception?

You can also add parameters to get a full exception. See https://www.elastic.co/guide/en/elasticsearch/reference/7.1/common-options.html#common-options-error-options

Also, a fully fledged example using curl or the console tools syntax would help a lot, as this would allow far more people to reproduce it.

Thank you!

I have found the actual issue in Elastic search log. It's total fields limit in index has exceeded 1000.
Is there a way to update my index with new limit ? I am currently using elastic search python api

And you guys set the limit for a reason. I would like know the reason behind it. Thanks

Hey,

see https://www.elastic.co/guide/en/elasticsearch/reference/master/mapping.html#mapping-limit-settings

If you have further questions, please go ahead :slight_smile:

--Alex

Thanks Alex. It's clear now.

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