invalid_index_name_exception on second deploy of Elasticsearch 6.x

Bug #1875812 reported by XiaojueGuan
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
Invalid
Medium
XiaojueGuan
Train
Fix Released
Medium
XiaojueGuan
Ussuri
Fix Released
Medium
XiaojueGuan

Bug Description

(deploy) root@k-node1:~# pip freeze | grep kolla
kolla==9.1.0.dev387
kolla-ansible==9.1.0.dev588

the globals.yml file is https://github.com/albertjone/kolla-config/blob/master/kolla-config/multinode/globals.yml

code in fiel kolla-ansible/ansible/roles/kibana/tasks/post_config.yml
```
- name: Register the kibana index in elasticsearch
  become: true
  kolla_toolbox:
    module_name: uri
    module_args:
      url: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ elasticsearch_port }}/.kibana"
      method: PUT
      body: "{{ kibana_default_index_options | to_json }}"
      body_format: json
      status_code: 200, 201, 400
      validate_certs: "{{ 'no' if enable_self_signed_certificates | bool else 'yes' }}"
  register: result
  failed_when:
    # If the index already exists, Elasticsearch will respond with a 400 error.
    - result.status == 400
    # Format: {"json": {"error": {"type": "index_already_exists_exception"}}}
    - result.get('json', {}).get('error', {}).get('type') != 'index_already_exists_exception'
  run_once: true
```
can not handle all exceptions which will failed if you don't run it successfully at first try.

Changed in kolla-ansible:
assignee: nobody → XiaojueGuan (xiaojuegaun)
Revision history for this message
XiaojueGuan (xiaojuegaun) wrote :

TASK [kibana : Register the kibana index in elasticsearch] ************************************************************************************************************************************
fatal: [10.10.1.201]: FAILED! => {"action": "uri", "changed": false, "connection": "close", "content_length": "369", "content_type": "application/json; charset=UTF-8", "elapsed": 0, "failed_when_result": true, "json": {"error": {"index": ".kibana", "index_uuid": "DoSrTo_eQWqlo00sQXBRjA", "reason": "index [.kibana/DoSrTo_eQWqlo00sQXBRjA] already exists", "root_cause": [{"index": ".kibana", "index_uuid": "DoSrTo_eQWqlo00sQXBRjA", "reason": "index [.kibana/DoSrTo_eQWqlo00sQXBRjA] already exists", "type": "resource_already_exists_exception"}], "type": "resource_already_exists_exception"}, "status": 400}, "msg": "HTTP Error 400: Bad Request", "redirected": false, "status": 400, "url": "https://10.10.1.205:9200/.kibana"}

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (master)

Fix proposed to branch: master
Review: https://review.opendev.org/724460

Changed in kolla-ansible:
status: New → In Progress
Revision history for this message
Mark Goddard (mgoddard) wrote : Re: invalid_index_name_exception

Looks like the change to ES was made here: https://github.com/elastic/elasticsearch/pull/21494

Changed in kolla-ansible:
importance: Undecided → Medium
Mark Goddard (mgoddard)
summary: - invalid_index_name_exception
+ invalid_index_name_exception on second deploy of Elasticsearch 6.x
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/729951

Revision history for this message
XiaojueGuan (xiaojuegaun) wrote :

since this commit
https://github.com/elastic/elasticsearch/commit/a75320f89b396853823c62d2c2d8ab7d485edca6
of upstream es, we should make no changes to the problem?
@Mark Goddard

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on kolla-ansible (master)

Change abandoned by XiaojueGuan (<email address hidden>) on branch: master
Review: https://review.opendev.org/724460

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on kolla-ansible (stable/train)

Change abandoned by XiaojueGuan (<email address hidden>) on branch: stable/train
Review: https://review.opendev.org/729951

Mark Goddard (mgoddard)
Changed in kolla-ansible:
milestone: 10.0.0 → none
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.