Missing watcher index templates – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.17-8.9

Briefly, this error occurs when Elasticsearch cannot find the necessary index templates for the Watcher feature, which is used for alerting and monitoring. This could be due to a misconfiguration or an unsuccessful initialization. To resolve this issue, you can try restarting Elasticsearch, as this will force the system to reinitialize and recreate the missing templates. Alternatively, you can manually add the missing templates if you have them. Lastly, ensure that the Watcher feature is properly installed and enabled in your Elasticsearch setup.

This guide will help you check for common problems that cause the log ” missing watcher index templates ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, index.

Log Context

Log “missing watcher index templates” classname is WatcherService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

     * @param state cluster state; which is needed to find out about local shards
     */
    void reload(ClusterState state; String reason) {
        boolean hasValidWatcherTemplates = WatcherIndexTemplateRegistry.validate(state);
        if (hasValidWatcherTemplates == false) {
            logger.warn("missing watcher index templates");
        }
        // this method contains the only async code block; being called by the cluster state listener
        // the reason for this is that loading the watches is done in a sync manner and thus cannot be done on the cluster state listener
        // thread
        //

 

 [ratemypost]