ElasticHQ / elasticsearch-HQ

Monitoring and Management Web Application for ElasticSearch instances and clusters.
http://www.elastichq.org
Other
4.97k stars 532 forks source link

Reindex Copy mapping only without data got an error (Types cannot be provided in put mapping requests, unless the include_type_name) #510

Open hellracer opened 4 years ago

hellracer commented 4 years ago

General information

Issue Description

I try to copy one of my index to another index without the data in the GUI the error just said oooppss something bad happen but on the docker console reveal something

Source Code / Logs


2019-12-24 08:28:58,052          DEBUG   urllib3.util.retry      retry.from_int:200      Converted retries value: False -> Retry(total=False, connect=None, read=None, redirect=0, status=None)
2019-12-24 08:28:58,057          INFO    elasticsearch   base.log_request_success:83     GET http://192.168.132.250:9200/data/_mapping [status:200 request:0.004s]
2019-12-24 08:28:58,057          DEBUG   elasticsearch   base.log_request_success:85     > None
2019-12-24 08:28:58,058          DEBUG   elasticsearch   base.log_request_success:86     < {"data":{"mappings":{}}}
2019-12-24 08:28:58,058          DEBUG   urllib3.util.retry      retry.from_int:200      Converted retries value: False -> Retry(total=False, connect=None, read=None, redirect=0, status=None)
2019-12-24 08:28:58,061          INFO    elasticsearch   base.log_request_success:83     GET http://192.168.132.250:9200/product/_mapping [status:200 request:0.003s]
2019-12-24 08:28:58,062          DEBUG   elasticsearch   base.log_request_success:85     > None
2019-12-24 08:28:58,062          DEBUG   elasticsearch   base.log_request_success:86     < {"product":{"mappings":{"properties":{"product_brand":{"type":"keyword"},"product_description":{"type":"text","fields":{"complete":{"type":"text","analyzer":"autocomplete_analyzer","search_analyzer":"autocomplete_search_analyzer"}},"analyzer":"synonym_analyzer"},"product_name":{"type":"text","fields":{"complete":{"type":"text","analyzer":"autocomplete_analyzer","search_analyzer":"autocomplete_search_analyzer"}},"analyzer":"synonym_analyzer"},"product_ranking":{"type":"float"},"product_sku":{"type":"keyword"},"product_type":{"type":"keyword"},"product_variation":{"type":"nested","properties":{"varation_price":{"type":"long"},"variation_color":{"type":"text"},"variation_price":{"type":"double"},"variation_size":{"type":"text"}}}}}}}
2019-12-24 08:28:58,062          DEBUG   urllib3.util.retry      retry.from_int:200      Converted retries value: False -> Retry(total=False, connect=None, read=None, redirect=0, status=None)
2019-12-24 08:28:58,065          WARNING         elasticsearch   base.log_request_fail:97        PUT http://192.168.132.250:9200/data/_mapping/properties [status:400 request:0.003s]
2019-12-24 08:28:58,066          DEBUG   elasticsearch   base.log_request_fail:105       > {"product_brand":{"type":"keyword"},"product_description":{"type":"text","fields":{"complete":{"type":"text","analyzer":"autocomplete_analyzer","search_analyzer":"autocomplete_search_analyzer"}},"analyzer":"synonym_analyzer"},"product_name":{"type":"text","fields":{"complete":{"type":"text","analyzer":"autocomplete_analyzer","search_analyzer":"autocomplete_search_analyzer"}},"analyzer":"synonym_analyzer"},"product_ranking":{"type":"float"},"product_sku":{"type":"keyword"},"product_type":{"type":"keyword"},"product_variation":{"type":"nested","properties":{"varation_price":{"type":"long"},"variation_color":{"type":"text"},"variation_price":{"type":"double"},"variation_size":{"type":"text"}}}}
2019-12-24 08:28:58,066          DEBUG   elasticsearch   base.log_request_fail:110       < {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."}],"type":"illegal_argument_exception","reason":"Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."},"status":400}
[2019-12-24 08:28:58,066] ERROR in exceptions: Oops! Something bad happened.
Traceback (most recent call last):
  File "/src/elastichq/common/exceptions.py", line 29, in _request_wrapper
    return functor(*args, **kwargs)
  File "/src/elastichq/api/indices.py", line 288, in post
    IndicesService().copy_mapping(cluster_name, from_index=source_index, to_index=destination_index)
  File "/src/elastichq/service/IndicesService.py", line 167, in copy_mapping
    return connection.indices.put_mapping(doc_type=doc_type, body=mapping_body, index=to_index)
  File "/src/elastichq/vendor/elasticsearch/client/utils.py", line 76, in _wrapped
    return func(*args, params=params, **kwargs)
  File "/src/elastichq/vendor/elasticsearch/client/indices.py", line 271, in put_mapping
    '_mapping', doc_type), params=params, body=body)
  File "/src/elastichq/vendor/elasticsearch/transport.py", line 314, in perform_request
    status, headers_response, data = connection.perform_request(method, url, params, body, headers=headers, ignore=ignore, timeout=timeout)
  File "/src/elastichq/vendor/elasticsearch/connection/http_urllib3.py", line 163, in perform_request
    self._raise_error(response.status, raw_data)
  File "/src/elastichq/vendor/elasticsearch/connection/base.py", line 125, in _raise_error
    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
elastichq.vendor.elasticsearch.exceptions.RequestError: TransportError(400, 'illegal_argument_exception', 'Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true.')
hellracer commented 4 years ago

in ES7 include_type_name is now set to "false" by default i think this is the reason it bails out