My ILM policy is configured to downsample metrics. The policy does work, and I have metrics being downsampled, but a few indices are stuck with lifecycle errors.
Specifically several .ds-metrics-docker.memory-default...
indices.
Index lifecycle error
mapper_parsing_exception: Failed to parse mapping: Field [scaling_factor] is required
The Elasticsearch logs are not much help, I get an error message and a stack trace, but neither tell me anything about which field is missing the scaling_factor
.
Here are some fields from the logs I found in Kibana:
elasticsearch.server.error.message:
Failed to parse mapping: Field [scaling_factor] is required
elasticsearch.server.error.stack_trace:
org.elasticsearch.index.mapper.MapperParsingException: Failed to parse mapping: Field [scaling_factor] is required
at org.elasticsearch.server@8.10.3/org.elasticsearch.index.mapper.MapperService.parseMapping(MapperService.java:400)
at org.elasticsearch.server@8.10.3/org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:376)
at org.elasticsearch.xpack.downsample.TransportDownsampleAction.createDownsampleIndexMapping(TransportDownsampleAction.java:534)
at org.elasticsearch.xpack.downsample.TransportDownsampleAction.lambda$masterOperation$6(TransportDownsampleAction.java:315)
at org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListener$2.onResponse(ActionListener.java:177)
at org.elasticsearch.server@8.10.3/org.elasticsearch.action.support.ContextPreservingActionListener.onResponse(ContextPreservingActionListener.java:32)
at org.elasticsearch.server@8.10.3/org.elasticsearch.client.internal.node.NodeClient$SafelyWrappedActionListener.onResponse(NodeClient.java:161)
at org.elasticsearch.server@8.10.3/org.elasticsearch.tasks.TaskManager$1.onResponse(TaskManager.java:205)
at org.elasticsearch.server@8.10.3/org.elasticsearch.tasks.TaskManager$1.onResponse(TaskManager.java:199)
at org.elasticsearch.server@8.10.3/org.elasticsearch.action.support.ContextPreservingActionListener.onResponse(ContextPreservingActionListener.java:32)
at org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListenerImplementations$MappedActionListener.onResponse(ActionListenerImplementations.java:95)
at org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListenerImplementations$RunBeforeActionListener.onResponse(ActionListenerImplementations.java:298)
at org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionListenerImplementations$DelegatingResponseActionListener.onResponse(ActionListenerImplementations.java:182)
at org.elasticsearch.server@8.10.3/org.elasticsearch.action.admin.indices.mapping.get.TransportGetMappingsAction.doMasterOperation(TransportGetMappingsAction.java:73)
at org.elasticsearch.server@8.10.3/org.elasticsearch.action.admin.indices.mapping.get.TransportGetMappingsAction.doMasterOperation(TransportGetMappingsAction.java:30)
at org.elasticsearch.server@8.10.3/org.elasticsearch.action.support.master.info.TransportClusterInfoAction.masterOperation(TransportClusterInfoAction.java:64)
at org.elasticsearch.server@8.10.3/org.elasticsearch.action.support.master.info.TransportClusterInfoAction.masterOperation(TransportClusterInfoAction.java:24)
at org.elasticsearch.server@8.10.3/org.elasticsearch.action.support.master.TransportMasterNodeAction.executeMasterOperation(TransportMasterNodeAction.java:124)
at org.elasticsearch.server@8.10.3/org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction.lambda$doStart$3(TransportMasterNodeAction.java:235)
at org.elasticsearch.server@8.10.3/org.elasticsearch.action.ActionRunnable$3.doRun(ActionRunnable.java:73)
at org.elasticsearch.server@8.10.3/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:983)
at org.elasticsearch.server@8.10.3/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.IllegalArgumentException: Field [scaling_factor] is required
at org.elasticsearch.mapper.extras@8.10.3/org.elasticsearch.index.mapper.extras.ScaledFloatFieldMapper$Builder.lambda$new$5(ScaledFloatFieldMapper.java:99)
at org.elasticsearch.server@8.10.3/org.elasticsearch.index.mapper.FieldMapper$Parameter.validate(FieldMapper.java:775)
at org.elasticsearch.server@8.10.3/org.elasticsearch.index.mapper.FieldMapper$Builder.validate(FieldMapper.java:1203)
at org.elasticsearch.server@8.10.3/org.elasticsearch.index.mapper.FieldMapper$Builder.parse(FieldMapper.java:1358)
at org.elasticsearch.server@8.10.3/org.elasticsearch.index.mapper.FieldMapper$TypeParser.parse(FieldMapper.java:1432)
at org.elasticsearch.server@8.10.3/org.elasticsearch.index.mapper.FieldMapper$TypeParser.parse(FieldMapper.java:1389)
at org.elasticsearch.server@8.10.3/org.elasticsearch.index.mapper.ObjectMapper$TypeParser.parseProperties(ObjectMapper.java:325)
at org.elasticsearch.server@8.10.3/org.elasticsearch.index.mapper.ObjectMapper$TypeParser.parseObjectOrDocumentTypeProperties(ObjectMapper.java:235)
at org.elasticsearch.server@8.10.3/org.elasticsearch.index.mapper.RootObjectMapper.parse(RootObjectMapper.java:411)
at org.elasticsearch.server@8.10.3/org.elasticsearch.index.mapper.MappingParser.parse(MappingParser.java:103)
at org.elasticsearch.server@8.10.3/org.elasticsearch.index.mapper.MappingParser.parse(MappingParser.java:97)
at org.elasticsearch.server@8.10.3/org.elasticsearch.index.mapper.MapperService.parseMapping(MapperService.java:398)
... 24 more
elasticsearch.server.error.type:
org.elasticsearch.index.mapper.MapperParsingException
message:
policy [metrics] for index [.ds-metrics-docker.memory-default-2023.10.19-000004] failed on step [{"phase":"warm","action":"downsample","name":"rollup"}]. Moving to ERROR step
I do have a script that runs occasionally to copy all the index templates, make a couple settings changes, and then save them with a higher priority than what Elastic Agent sets. But I do not touch any of mappings, just a couple settings. So I'm not 100% sure that my settings aren't the cause, but I do think it unlikely.
What would help is if there was a way to figure out which field is causing the ILM error. Anyone know a way?
Anyone have any other suggestions on how to resolve this?