{"record":{"id":"b6a6f989c74af963","repo":"jaegertracing/jaeger","slug":"ilm-ism-policy-s-doesn-t-exist-please-create-it","errorCode":null,"errorMessage":"ILM/ISM policy %s doesn't exist. Please create it and re-run init","messagePattern":"ILM/ISM policy (.+?) doesn't exist\\. Please create it and re-run init","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/es-rollover/app/init/action.go","lineNumber":33,"sourceCode":"// Action holds the configuration and clients for init action\ntype Action struct {\n\tConfig        Config\n\tIndicesClient esclient.IndexAPI\n\tILMClient     esclient.IndexManagementLifecycleAPI\n}\n\n// Do the init action\nfunc (c Action) Do() error {\n\tctx := context.TODO()\n\tif c.Config.UseILM {\n\t\t// Every supported backend provides lifecycle management (ILM on\n\t\t// Elasticsearch, ISM on OpenSearch), so no capability check is needed.\n\t\tpolicyExist, err := c.ILMClient.Exists(ctx, c.Config.ILMPolicyName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !policyExist {\n\t\t\treturn fmt.Errorf(\"ILM/ISM policy %s doesn't exist. Please create it and re-run init\", c.Config.ILMPolicyName)\n\t\t}\n\t}\n\trolloverIndices := app.RolloverIndices(c.Config.Archive, c.Config.SkipDependencies, c.Config.AdaptiveSampling, c.Config.Config.IndexPrefix)\n\tfor _, indexName := range rolloverIndices {\n\t\tif err := c.init(ctx, indexName); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc createIndexIfNotExist(ctx context.Context, c esclient.IndexAPI, index string) error {\n\texists, err := c.IndexExists(ctx, index)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif exists {\n\t\treturn nil","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/es-rollover/app/init/action.go#L15-L51","documentation":"The rollover init action verifies that the configured ILM (Elasticsearch) or ISM (OpenSearch) policy exists before creating rollover aliases and indices. If the policy lookup succeeds but reports the policy missing, this actionable error is returned. Unlike other errors it is not wrapping a transport failure — it is a deliberate existence check.","triggerScenarios":"Running `es-rollover init` when the ILM/ISM policy named by --ilm-policy-name (or default jaeger-ilm-policy / jaeger-ism-policy) was never created in the cluster, or Exists() returns false because the caller lacks permission to see it.","commonSituations":"Fresh Elasticsearch cluster where the separate `jaeger init` step that installs the policy was skipped; policy name mismatch between the flag and what was created; OpenSearch cluster still on a path where the policy was never provisioned; restricted user who cannot read the policy.","solutions":["Run the Jaeger init command (e.g. `es-rollover init` counterpart that installs the policy / `jaeger-elasticsearch-init`) to create the policy first.","Check the policy name flag matches an existing policy (GET _ilm/policy or _plugins/_ism/policies).","Verify the credentials allow reading ILM/ISM policies.","Re-run `es-rollover init` after the policy exists, as the message instructs."],"exampleFix":"// before\n./es-rollover init $ES_URL   # policy jaeger-ilm-policy absent\n// after\ncurl -X PUT $ES_URL/_ilm/policy/jaeger-ilm-policy -d @policy.json\n./es-rollover init $ES_URL","handlingStrategy":"validation","validationCode":"policy := \"jaeger-ilm-policy\"\nresp, err := http.Get(esURL + \"/_ilm/policy/\" + policy)\nif err != nil || resp.StatusCode == 404 {\n    return fmt.Errorf(\"policy %s missing; run init first\", policy)\n}\nresp.Body.Close()","typeGuard":null,"tryCatchPattern":"if err := action.Do(); err != nil {\n    if strings.Contains(err.Error(), \"doesn't exist\") {\n        // provision the ILM/ISM policy, then re-run init\n    }\n    return err\n}","preventionTips":["Always run the Jaeger init step on a fresh Elasticsearch cluster.","Keep the ILM policy name flag consistent across deployments.","Verify policy existence with GET _ilm/policy (or ISM equivalent) in CI.","Ensure the ES user can read ILM/ISM policies."],"tags":["elasticsearch","ilm","setup"],"backgroundTag":"ilm-policy-missing","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}