elastic index mapping error
ERROR:sync_session:Failed elasticsearch client initialisation - RequestError(400, 'mapper_parsing_exception', 'Failed to parse object: expecting token of type [START_OBJECT] but found [VALUE_STRING]')
Traceback (most recent call last):
File "/mirror-clients/mirror_clients/sync_session.py", line 199, in main
await sync_session(args)
File "/usr/local/lib/python3.9/site-packages/tenacity/_asyncio.py", line 86, in async_wrapped
return await fn(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/tenacity/_asyncio.py", line 48, in __call__
do = self.iter(retry_state=retry_state)
File "/usr/local/lib/python3.9/site-packages/tenacity/__init__.py", line 349, in iter
return fut.result()
File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 438, in result
return self.__get_result()
File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result
raise self._exception
File "/usr/local/lib/python3.9/site-packages/tenacity/_asyncio.py", line 51, in __call__
result = await fn(*args, **kwargs)
File "/mirror-clients/mirror_clients/sync_session.py", line 191, in sync_session
if await task:
File "/mirror-clients/mirror_clients/sync_session.py", line 157, in sync
await processing(ws, client)
File "/mirror-clients/mirror_clients/sync_session.py", line 101, in processing
result = await operation_mapping[op_type](**data)
File "/mirror-clients/mirror_clients/utils.py", line 39, in _impl
result = await method(self, *method_args, **method_kwargs)
File "/mirror-clients/mirror_clients/clients/elasticsearch_client.py", line 127, in upsert
await self.db.index(index=index, id=_id, body=data)
File "/usr/local/lib/python3.9/site-packages/elasticsearch/_async/client/__init__.py", line 400, in index
return await self.transport.perform_request(
File "/usr/local/lib/python3.9/site-packages/elasticsearch/_async/transport.py", line 329, in perform_request
raise e
File "/usr/local/lib/python3.9/site-packages/elasticsearch/_async/transport.py", line 296, in perform_request
status, headers, data = await connection.perform_request(
File "/usr/local/lib/python3.9/site-packages/elasticsearch/_async/http_aiohttp.py", line 329, in perform_request
self._raise_error(response.status, raw_data)
File "/usr/local/lib/python3.9/site-packages/elasticsearch/connection/base.py", line 322, in _raise_error
raise HTTP_EXCEPTIONS.get(status_code, TransportError)(
elasticsearch.exceptions.RequestError: RequestError(400, 'mapper_parsing_exception', 'Failed to parse object: expecting token of type [START_OBJECT] but found [VALUE_STRING]')
INFO:application_wrapper:Shutdown aiohttp app
INFO:application_wrapper:Shutting down coroutine
в частном случае произошло изза полного изменения структуры поля
было
"representativeCertificateNumber": "№ свідоцтва про право на провадження діяльності арбітражного керуючого",
"representativeCertificateDate": "2022-01-19T08:48:08.000000Z sad"
а потом стало
"representativeCertificateDate": {
"uk_UA": "Інформація про Організатора аукціону"
},
"representativeCertificateNumber": {
"uk_UA": "№ свідоцтва про право на провадження діяльності арбітражного керуючого"
}