Skip to content

[BUG] Listing snapshot-management policies fails when the ism index is not yet created #1055

@aggarwalShivani

Description

@aggarwalShivani

What is the bug?
Index-management plugin is installed in Opensearch. No policies are created yet, so the index .opendistro-ism-config does not exist yet.

Listing ism policies does not fail, and prints an empty list.

$ curl 127.0.0.1:9200/_plugins/_ism/policies
{"policies":[],"total_policies":0}

However, listing snapshot-management policies throws an exception due to absence of the index.

curl 127.0.0.1:9200/_plugins/_sm/policies
{"error":{"root_cause":[{"type":"status_exception","reason":"Snapshot management config index not found"}],"type":"status_exception","reason":"Snapshot management config index not found"},"status":404}

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Install Opensearch with index-management plugin
  2. After the cluster is ready (healthy), run the above mentioned GET cmds to list ism and sm policies.
  3. See error while listing sm policies.

What is the expected behavior?
Like ism policies, even the sm api could respond with an empty list, instead of an exception.

What is your host/environment?

  • OS: Windows 10
  • Version 2.8 (latest branch)
  • Plugins

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