Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Alias must_exist field is unknown #62642

Closed
aaron-nimocks opened this issue Sep 18, 2020 · 5 comments · Fixed by #65141
Closed

Remove Alias must_exist field is unknown #62642

aaron-nimocks opened this issue Sep 18, 2020 · 5 comments · Fixed by #65141
Assignees
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team

Comments

@aaron-nimocks
Copy link

aaron-nimocks commented Sep 18, 2020

Elasticsearch version : 7.9

Description of the problem including expected versus actual behavior:

The PR for this feature.

When adding a must_exist field to a remove index alias API call it does not recognize the field. Also does not show up in autocomplete in Kibana.

Initially reported - https://discuss.elastic.co/t/must-exist/249009

Steps to reproduce:

POST /_aliases
{
  "actions": [
    {
      "remove": {
        "index": "doesntmatter",
        "alias": "aliasname",
        "must_exist": true
      }
    }
  ]
}

Returns Error

{
  "error" : {
    "root_cause" : [
      {
        "type" : "x_content_parse_exception",
        "reason" : "[7:9] [remove] unknown field [must_exist]"
      }
    ],
    "type" : "x_content_parse_exception",
    "reason" : "[7:23] [aliases] failed to parse field [actions]",
    "caused_by" : {
      "type" : "x_content_parse_exception",
      "reason" : "[7:23] [alias_action] failed to parse field [remove]",
      "caused_by" : {
        "type" : "x_content_parse_exception",
        "reason" : "[7:9] [remove] unknown field [must_exist]"
      }
    }
  },
  "status" : 400
}

Verified the field is present
https://github.com/elastic/elasticsearch/blob/7.9/server/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequest.java#L101

Verified the error handing works if you change type to add
https://github.com/elastic/elasticsearch/blob/7.9/server/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequest.java#L477

Possible reason is that the field is not in XContentBuilder
https://github.com/elastic/elasticsearch/blob/7.9/server/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequest.java#L521

@aaron-nimocks aaron-nimocks added >bug needs:triage Requires assignment of a team area label labels Sep 18, 2020
@jimczi jimczi added :Search Foundations/Mapping Index mappings, including merging and defining field types and removed needs:triage Requires assignment of a team area label labels Sep 18, 2020
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Sep 18, 2020
@jimczi jimczi added :Data Management/Indices APIs APIs to create and manage indices and templates and removed :Search Foundations/Mapping Index mappings, including merging and defining field types labels Sep 18, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Indices APIs)

@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Sep 18, 2020
@jimczi jimczi removed the Team:Search Meta label for search team label Sep 18, 2020
@elastic elastic deleted a comment from elasticmachine Sep 18, 2020
@prernablr92
Copy link

Hi @jimczi @aaron-nimocks
I wish to take this up.
Kindly confirm if I can start working on this.

@aaron-nimocks
Copy link
Author

Hi @jimczi @aaron-nimocks
I wish to take this up.
Kindly confirm if I can start working on this.

I'm just reporting and have no intentions of working on this.

@rihadik
Copy link

rihadik commented Nov 1, 2020

Bumping just in case it has been forgotten )

@rudolf
Copy link
Contributor

rudolf commented Nov 17, 2020

This is currently blocking elastic/kibana#75780 which is targeted for 7.11

@henningandersen henningandersen self-assigned this Nov 17, 2020
henningandersen added a commit to henningandersen/elasticsearch that referenced this issue Nov 17, 2020
Remove alias now parses the must_exist flag and results in a 404
(not found), if the index does not have the alias.

Closes elastic#62642
Relates elastic#58100

Co-Authored-By: Luca Cavanna <javanna@users.noreply.github.com>
henningandersen added a commit that referenced this issue Nov 18, 2020
Remove alias now parses the must_exist flag and results in a 404
(not found), if the index does not have the alias.

Closes #62642
Relates #58100

Co-Authored-By: Luca Cavanna <javanna@users.noreply.github.com>
henningandersen added a commit to henningandersen/elasticsearch that referenced this issue Nov 18, 2020
Remove alias now parses the must_exist flag and results in a 404
(not found), if the index does not have the alias.

Closes elastic#62642
Relates elastic#58100

Co-Authored-By: Luca Cavanna <javanna@users.noreply.github.com>
henningandersen added a commit that referenced this issue Nov 18, 2020
Remove alias now parses the must_exist flag and results in a 404
(not found), if the index does not have the alias.

Closes #62642
Relates #58100

Co-Authored-By: Luca Cavanna <javanna@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants