I have an index my-idx-09-2022
. I made a ingest pipeline so that all the updates from now of my-idx-09-2022
will go to a new index i.e my-idx-new-09-2023
.
Python code:
def create_write_redirect_pipeline(source_client, pipeline_name, new_index):
source_client.ingest.put_pipeline(
id=pipeline_name,
body={
"processors": [
{
"set": {
"field": "_index",
"value": new_index
}
}
]
}
)
def associate_pipeline_with_index(source_client, source_index, pipeline_name):
source_client.indices.put_settings(
index=source_index,
body={
"index": {
"default_pipeline": pipeline_name
}
}
)
Now when I am trying to reindex this new index my-idx-new-09-2023
to an existing index in cluster2 i.e let say restored_idx
I am getting this error.
HTTP_EXCEPTIONS.get(meta.status, ApiError)(
elasticsearch.BadRequestError: BadRequestError(400, "{'took': 9, 'timed_out': False, 'total': 10, 'updated': 0, 'created': 0, 'deleted': 0, 'batches': 1, 'version_conflicts': 0, 'noops': 0, 'retries': {'bulk': 0, 'search': 0}, 'throttled_millis': 0, 'requests_per_second': -1.0, 'throttled_until_millis': 0, 'failures': [{'index': 'restored_idx', 'type': '_doc', 'id': 'AVeRNIkBgj9Doa2aiWL2', 'cause': {'type': 'illegal_argument_exception', 'reason': 'pipeline with id [write_redirect_pipeline] does not exist'}, 'status': 400}, {'index': 'restored_idx', 'type': '_doc', 'id': 'AleRNIkBgj9Doa2aimIj', 'cause': {'type': 'illegal_argument_exception', 'reason': 'pipeline with id [write_redirect_pipeline] does not exist'}, 'status': 400}, {'index': 'restored_idx', 'type': '_doc', 'id': 'A1eRNIkBgj9Doa2aimIx', 'cause': {'type': 'illegal_argument_exception', 'reason': 'pipeline with id [write_redirect_pipeline] does not exist'}, 'status': 400}, {'index': 'restored_idx', 'type': '_doc', 'id': 'BFeRNIkBgj9Doa2aimI-', 'cause': {'type': 'illegal_argument_exception', 'reason': 'pipeline with id [write_redirect_pipeline] does not exist'}, 'status': 400}, {'index': 'restored_idx', 'type': '_doc', 'id': 'BVeRNIkBgj9Doa2aimJO', 'cause': {'type': 'illegal_argument_exception', 'reason': 'pipeline with id [write_redirect_pipeline] does not exist'}, 'status': 400}, {'index': 'restored_idx', 'type': '_doc', 'id': 'BleRNIkBgj9Doa2aimJd', 'cause': {'type': 'illegal_argument_exception', 'reason': 'pipeline with id [write_redirect_pipeline] does not exist'}, 'status': 400}, {'index': 'restored_idx', 'type': '_doc', 'id': 'B1eRNIkBgj9Doa2aimJn', 'cause': {'type': 'illegal_argument_exception', 'reason': 'pipeline with id [write_redirect_pipeline] does not exist'}, 'status': 400}, {'index': 'restored_idx', 'type': '_doc', 'id': 'CFeRNIkBgj9Doa2aimJ1', 'cause': {'type': 'illegal_argument_exception', 'reason': 'pipeline with id [write_redirect_pipeline] does not exist'}, 'status': 400}, {'index': 'restored_idx', 'type': '_doc', 'id': 'CVeRNIkBgj9Doa2aimKA', 'cause': {'type': 'illegal_argument_exception', 'reason': 'pipeline with id [write_redirect_pipeline] does not exist'}, 'status': 400}, {'index': 'restored_idx', 'type': '_doc', 'id': 'CleRNIkBgj9Doa2aimKO', 'cause': {'type': 'illegal_argument_exception', 'reason': 'pipeline with id [write_redirect_pipeline] does not exist'}, 'status': 400}]}")
Reindexing is working when I am using any other new index than this restored_idx. Am I missing something here ?