Skip to content

Delete enrich policy fails when 'action.destructive_requires_name' is used #51228

@peterpramb

Description

@peterpramb

Elasticsearch version:
Version: 7.5.1, Build: default/tar/3ae9ac9a93c95bd0cdc054951cf95d88e1e18d96/2019-12-16T22:57:37.835892Z, JVM: 11.0.5

JVM version:
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.5+10, mixed mode)

OS version:
Linux 3.10.0-1062.1.2.el7.x86_64 #1 SMP Mon Sep 16 14:19:51 EDT 2019 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:
Deleting an unused enrich policy while action.destructive_requires_name: true is in effect fails with the following exception:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "Wildcard expressions or all indices are not allowed"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "Wildcard expressions or all indices are not allowed"
  },
  "status" : 400
}

After transiently setting action.destructive_requires_name: false the deletion is successful:

{
  "acknowledged" : true
}

Steps to reproduce:

  1. Create source index:
POST /gh-51228/_doc
{
  "field": "value"
}
  1. Create enrich policy:
PUT /_enrich/policy/gh-51228
{
    "match": {
        "indices": [
            "gh-51228"
        ],
        "match_field": "field",
        "enrich_fields": [
            "field"
        ]
    }
}
  1. Activate enrich policy:
PUT /_enrich/policy/gh-51228/_execute
  1. Disable wildcard deletes:
PUT /_cluster/settings
{
  "transient" : {
    "action" : {
      "destructive_requires_name" : "true"
    }
  }
}
  1. Delete enrich policy:
DELETE /_enrich/policy/gh-51228

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions