[Resolved]ES7.0.1 - Error in elasticsearch 'Failed to parse mapping [_doc]'

Hi Team,

I observed an error in elasticsearch. how to resolve it?

[2019-09-25T14:32:07,690][INFO ][o.e.l.LicenseService     ] [node-1] license [e57e4a0d-4f0a-4e25-8beb-2e6192495d41] mode [trial] - valid
[2019-09-25T14:32:07,704][INFO ][o.e.g.GatewayService     ] [node-1] recovered [21] indices into cluster_state
[2019-09-25T14:32:09,906][INFO ][o.e.h.AbstractHttpServerTransport] [node-1] publish_address {10.59.181.210:9200}, bound_addresses {[::]:9200}
[2019-09-25T14:32:09,907][INFO ][o.e.n.Node               ] [node-1] started
[2019-09-25T14:32:12,890][INFO ][o.e.c.r.a.AllocationService] [node-1] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[.kibana_1][0]] ...]).
[2019-09-25T14:35:41,262][DEBUG][o.e.a.a.i.t.p.TransportPutIndexTemplateAction] [node-1] failed to put template [testcase]
org.elasticsearch.index.mapper.MapperParsingException: Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:  [doc : {dynamic_templates=[{All={mapping={type=text, fields={raw={ignore_above=256, type=keyword}}}, match_mapping_type=*, match=*}}]}]
        at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:394) ~[elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:323) ~[elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.cluster.metadata.MetaDataIndexTemplateService.validateAndAddTemplate(MetaDataIndexTemplateService.java:253) ~[elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.cluster.metadata.MetaDataIndexTemplateService.access$300(MetaDataIndexTemplateService.java:65) ~[elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.cluster.metadata.MetaDataIndexTemplateService$2.execute(MetaDataIndexTemplateService.java:176) ~[elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:47) ~[elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:687) ~[elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:310) ~[elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:210) [elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:142) [elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) [elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) [elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:681) [elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:252) [elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:215) [elasticsearch-7.0.1.jar:7.0.1]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_144]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_144]
        at java.lang.Thread.run(Thread.java:808) [?:1.8.0_144]
Caused by: org.elasticsearch.index.mapper.MapperParsingException: Root mapping definition has unsupported parameters:  [doc : {dynamic_templates=[{All={mapping={type=text, fields={raw={ignore_above=256, type=keyword}}}, match_mapping_type=*, match=*}}]}]
        at org.elasticsearch.index.mapper.DocumentMapperParser.checkNoRemainingFields(DocumentMapperParser.java:152) ~[elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:140) ~[elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:92) ~[elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:392) ~[elasticsearch-7.0.1.jar:7.0.1]
        ... 17 more
[2019-09-25T16:46:04,553][DEBUG][o.e.a.a.i.d.TransportDeleteIndexAction] [node-1] failed to delete indices [[[uba2/3G_Bii7WQhCCvgQkPBiOAQ]]]
org.elasticsearch.cluster.metadata.ProcessClusterEventTimeoutException: failed to process cluster event (delete-index [[uba2/3G_Bii7WQhCCvgQkPBiOAQ]]) within 30s
        at org.elasticsearch.cluster.service.MasterService$Batcher.lambda$onTimeout$0(MasterService.java:134) ~[elasticsearch-7.0.1.jar:7.0.1]
        at java.util.ArrayList.forEach(ArrayList.java:1249) ~[?:1.8.0_144]
        at org.elasticsearch.cluster.service.MasterService$Batcher.lambda$onTimeout$1(MasterService.java:133) ~[elasticsearch-7.0.1.jar:7.0.1]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:681) [elasticsearch-7.0.1.jar:7.0.1]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_144]

your mapping specifies a document type, which is not needed under Elasticsearch 7 anymore. You can use the include_type_name parameter in the request, but the best way would be to omit that type.

See https://www.elastic.co/guide/en/elasticsearch/reference/7.3/removal-of-types.html

2 Likes

@spinscale. Thanks for the solution.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.