Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

[BUG] Policy with CRON transition: [illegal_argument_exception] Unknown schedule type expression #89

@davide-malagoli

Description

@davide-malagoli

Describe the bug
I'm trying to define a policy that deletes an "old" index at midnight.

I'm using Opendistro 1.4 and from the documentation I see it would be possible to use CRON expressions ( Transitions )

But when I try t save it gives me an error

[illegal_argument_exception] Unknown schedule type expression

Other plugins installed
No other plugin installed

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Index Management'
  2. Click on 'Create Policy'
  3. Insert 'delete_at_midnight' in the 'Policy ID' field
  4. Paste the following definition
 {
    "policy": {
        "policy_id": "delete_at_midnight",
        "description": "A simple default policy that deletes old indicies after 1 days.",
        "default_state": "open",
        "states": [
            {
                "name": "open",
                "actions": [
                    {
                        "open": {}
                    }
                ],
                "transitions": [
                    {
                        "state_name": "delete",
                        "conditions": {
                            "cron": {
                                "expression":"1 0 * * *",
                                "timezone":"CET"
                            }
                        }
                    }
                ]
            },
            {
                "name": "delete",
                "actions": [
                    {
                        "delete": {}
                    }
                ],
                "transitions": []
            }
        ]
    }
}

  1. See error

Expected behavior
Kibana saves the policy

Desktop (please complete the following information):

  • OS: Ubuntu 18.04.4 LTS
  • Browser: chrome
  • Version 81.0.4044.92

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions