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.