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

Reporting index managed by ILM policy got exception when rollover action is added in the default policy kibana-reporting #123384

Open
hubbleview opened this issue Jan 19, 2022 · 4 comments
Labels
bug Fixes for quality problems that affect the customer experience Feature:Reporting:Framework Reporting issues pertaining to the overall framework old Used to help sort old issues on GH Projects which don't support the Created search term. Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)

Comments

@hubbleview
Copy link

Kibana version: 7.16.3

Describe the bug:

Since #100130 and #103850, by default, reporting index will be applied ILM policy kibana-reporting, which has the default policy as below.

{
  "kibana-reporting" : {
    "version" : 1,
    "modified_date" : "2022-01-18T22:20:57.531Z",
    "policy" : {
      "phases" : {
        "hot" : {
          "min_age" : "0ms",
          "actions" : { }
        }
      }
    }
  }
}

And, this ILM policy allows to be customized.

When adding rollover action in the policy, which is common and reasonable request, these reporting indices start to see errors about ILM, like below.

{
  "indices" : {
    ".reporting-2022-01-16" : {
      "index" : ".reporting-2022-01-16",
      "managed" : true,
      "policy" : "kibana-reporting",
      "lifecycle_date_millis" : 1642551663536,
      "age" : "16.46h",
      "phase" : "hot",
      "phase_time_millis" : 1642610052954,
      "action" : "rollover",
      "action_time_millis" : 1642551663599,
      "step" : "ERROR",
      "step_time_millis" : 1642610652848,
      "failed_step" : "check-rollover-ready",
      "is_auto_retryable_error" : true,
      "failed_step_retry_count" : 49,
      "step_info" : {
        "type" : "illegal_argument_exception",
        "reason" : "setting [index.lifecycle.rollover_alias] for index [.reporting-2022-01-16] is empty or not defined",
        "stack_trace" : """java.lang.IllegalArgumentException: setting [index.lifecycle.rollover_alias] for index [.reporting-2022-01-16] is empty or not defined
	at org.elasticsearch.xpack.core.ilm.WaitForRolloverReadyStep.evaluateCondition(WaitForRolloverReadyStep.java:89)
	at org.elasticsearch.xpack.ilm.IndexLifecycleRunner.runPeriodicStep(IndexLifecycleRunner.java:226)
	at org.elasticsearch.xpack.ilm.IndexLifecycleService.triggerPolicies(IndexLifecycleService.java:408)
	at org.elasticsearch.xpack.ilm.IndexLifecycleService.triggered(IndexLifecycleService.java:339)
	at org.elasticsearch.xpack.core.scheduler.SchedulerEngine.notifyListeners(SchedulerEngine.java:186)
	at org.elasticsearch.xpack.core.scheduler.SchedulerEngine$ActiveSchedule.run(SchedulerEngine.java:220)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
"""
      },
      "phase_execution" : {
        "policy" : "kibana-reporting",
        "phase_definition" : {
          "min_age" : "0ms",
          "actions" : {
            "rollover" : {
              "max_primary_shard_size" : "50gb",
              "max_age" : "1d"
            }
          }
        },
        "version" : 3,
        "modified_date_in_millis" : 1642551647174
      }
    }
  }
}

In above ILM explain output, we could see the updated policy kibana-reporting with rollover action.

The exception is because, the default reporting index name is .reporting-${date}, which doesn't match ILM rollover pattern. The initial index name should be like .reporting-${date}-000001 to allow rollover to happen.

Steps to reproduce:

  1. New deployment of 7.16.3 ES/kibana.
  2. Edit kibana-reporting policy to add rollover action.
  3. Wait for rollover action taking place, then check GET .reporting-*/_ilm/explain output.

Expected behavior:

  • Default reporting index name follows the ILM rollover pattern with number at the end.
  • No above error happens when adding rollover action in ILM policy kibana-reporting.
@hubbleview hubbleview added the bug Fixes for quality problems that affect the customer experience label Jan 19, 2022
@botelastic botelastic bot added the needs-team Issues missing a team label label Jan 19, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-reporting-services (Team:Reporting Services)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Jan 19, 2022
@hubbleview
Copy link
Author

Or, migrating reporting index to data stream.

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServicesUx)

@petrklapka petrklapka added (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) and removed Team:AppServicesUx labels Oct 24, 2022
@tsullivan tsullivan added Feature:Reporting:Framework Reporting issues pertaining to the overall framework and removed (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead labels Aug 1, 2024
@tsullivan
Copy link
Member

Or, migrating reporting index to data stream.

@hubbleview Reporting uses a data stream configuration as of #176022 but I'm not sure if it sufficiently takes care of this issue.

@petrklapka petrklapka added the old Used to help sort old issues on GH Projects which don't support the Created search term. label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Reporting:Framework Reporting issues pertaining to the overall framework old Used to help sort old issues on GH Projects which don't support the Created search term. Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)
Projects
None yet
Development

No branches or pull requests

4 participants