Removing typed legacy template – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.17-7.17

Briefly, this error occurs when Elasticsearch is updating from an older version that used typed indices to a newer version that no longer supports them. The system is removing the legacy template because it’s no longer compatible. To resolve this issue, you can either let Elasticsearch automatically handle the removal or manually delete the old templates and create new ones that are compatible with the newer version. Additionally, you can reindex your data to fit the new template structure.

This guide will help you check for common problems that cause the log ” removing typed legacy template [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: template, plugin.

Log Context

Log “removing typed legacy template [{}]” classname is Monitoring.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

        if (templateName.startsWith("apm-6.")) {
            ImmutableOpenMap mappings = templateEntry.getValue().getMappings();
            if (mappings != null && mappings.get("doc") != null) {
                // this is an old APM mapping that still uses the `doc` type so let's remove it as the later 7.x APM versions
                // would've installed an APM template (versioned) that doesn't contain any type
                logger.info("removing typed legacy template [{}]"; templateName);
                return true;
            }
        }
        return false;
    }

 

 [ratemypost]