MacOS 10.10.4
Python 3.7
-elasticsearch == 7.7.1
-requests-aws4auth == 0.9
es = elasticsearch.Elasticsearch(
hosts=[
ES_ENDPOINT
],
http_auth=awsauth,
use_ssl=True,
verify_certs=True,
ssl_show_warn=True,
connection_class=elasticsearch.RequestsHttpConnection,
http_compress = True <--- This line causes the error.
)
elasticsearch.exceptions.TransportError: TransportError(500, 'json_parse_exception', 'Illegal character ((CTRL-CHAR, code 31)): only regular white space (\\r, \\n, \\t) is allowed between tokens\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@39998a59; line: 1, column: 2]')
File "/Users/python/venv/lib/python3.7/site-packages/elasticsearch/helpers/actions.py", line 240, in streaming_bulk
**kwargs
File "/Users/python/venv/lib/python3.7/site-packages/elasticsearch/helpers/actions.py", line 126, in _process_bulk_chunk
raise e
File "/Users/python/venv/lib/python3.7/site-packages/elasticsearch/helpers/actions.py", line 122, in _process_bulk_chunk
resp = client.bulk("\n".join(bulk_actions) + "\n", *args, **kwargs)
File "/Users/python/venv/lib/python3.7/site-packages/elasticsearch/client/utils.py", line 92, in _wrapped
return func(*args, params=params, headers=headers, **kwargs)
File "/Users/python/venv/lib/python3.7/site-packages/elasticsearch/client/__init__.py", line 462, in bulk
body=body,
File "/Users/python/venv/lib/python3.7/site-packages/elasticsearch/transport.py", line 362, in perform_request
timeout=timeout,
File "/Users/python/venv/lib/python3.7/site-packages/elasticsearch/connection/http_requests.py", line 179, in perform_request
self._raise_error(response.status_code, raw_data)
File "/Users/python/venv/lib/python3.7/site-packages/elasticsearch/connection/base.py", line 282, in _raise_error
status_code, error_message, additional_info
elasticsearch.exceptions.TransportError: TransportError(500, 'json_parse_exception', 'Illegal character ((CTRL-CHAR, code 31)): only regular white space (\\r, \\n, \\t) is allowed between tokens\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@39998a59; line: 1, column: 2]')