elasticsearch-HQ icon indicating copy to clipboard operation
elasticsearch-HQ copied to clipboard

ElasticHQ should constrain the index name to only valid characters and validate

Open danizen opened this issue 4 years ago • 0 comments

General information

OS Platform and Distribution: Windows 10: - never in prodcution ElasticHQ Version: Clone of master, tag v3.5.12 Elasticsearch Version: 7.5.1 Python version (ignore is using docker image): CPython 3.6 Browser Vendor and Version (if applicable): Chrome 79? Don't think its applicable.

Desired Behavior

ElasticHQ should constrain the input to be a valid index name, and validate if it is not. Stretch goal - ElasticHQ should report why a command failed, in some generalized fashion.

Issue Description

  • Go to Indices Summary.
  • Attempt to create index with name "EXAMPLE", 2 shards, 1 replica.
  • GUI says "Index created."
  • Log says "invalid_index_name_exception"

Source Code / Logs

2020-01-17 14:22:57,503          DEBUG   elasticsearch   base.log_request_fail:110       < {"error":{"root_cause":[{"type":"invalid_index_name_exception","reason":"Invalid index name [EXAMPLE], must be lowercase","index_uuid":"_na_","index":"EXAMPLE"}],"type":"invalid_index_name_exception","reason":"Invalid index name [EXAMPLE], must be lowercase","index_uuid":"_na_","index":"EXAMPLE"},"status":400}
2020-01-17 14:22:57,504          ERROR   elastichq       exceptions._request_wrapper:37          Oops! Something bad happened.
Traceback (most recent call last):
  File "C:\Users\davisda4\workspace\elastichq\elastichq\common\exceptions.py", line 29, in _request_wrapper
    return functor(*args, **kwargs)
  File "C:\Users\davisda4\workspace\elastichq\elastichq\api\indices.py", line 110, in post
    settings={'settings': params.get('settings')})
  File "C:\Users\davisda4\workspace\elastichq\elastichq\service\IndicesService.py", line 25, in create_index
    return connection.indices.create(index=index_name, body=settings, request_timeout=REQUEST_TIMEOUT)
  File "C:\Users\davisda4\workspace\elastichq\elastichq\vendor\elasticsearch\client\utils.py", line 76, in _wrapped
    return func(*args, params=params, **kwargs)
  File "C:\Users\davisda4\workspace\elastichq\elastichq\vendor\elasticsearch\client\indices.py", line 91, in create
    params=params, body=body)
  File "C:\Users\davisda4\workspace\elastichq\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 "C:\Users\davisda4\workspace\elastichq\elastichq\vendor\elasticsearch\connection\http_urllib3.py", line 163, in perform_request
    self._raise_error(response.status, raw_data)
  File "C:\Users\davisda4\workspace\elastichq\elastichq\vendor\elasticsearch\connection\base.py", line 125, in _raise_error
    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)

Be Patient

I will - I have a day job, too.

danizen avatar Jan 17 '20 19:01 danizen