Missing required email to field – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-8.9

Briefly, this error occurs when the “to” field in the email section of a Watcher action or Alerting action is missing. Elasticsearch requires this field to know where to send the email. To resolve this issue, you can either add the “to” field with a valid email address in the action configuration or, if you’re using a default email, ensure it’s correctly set up in the Elasticsearch settings. Also, check for any syntax errors in your configuration that might be causing the “to” field to be overlooked.

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

Log Context

Log “missing required email [to] field” class name is Account.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 // applying the defaults on missing emails fields
 email = config.defaults.apply(email);  if (email.to == null) {
 throw new SettingsException("missing required email [to] field");
 }  Transport transport = session.getTransport(SMTP_PROTOCOL);  String user = auth != null ? auth.user() : config.smtp.user;