Force_execute email action for simulated watches not working

alerting

(Joshua Coward) #1

Hi, having an issue with simulated watches. We have previously used this feature when developing new ones. In particular, the force_execute for the email watch action has been useful to verify the format of the message. Since upgrading to 6.3.2 it has been observed that this does not work like it used to. The following error is seen:

"reason": "no accounts of type [email] configured. Please set up an account using the [xpack.notification.email] settings"

This error message is incorrect since we do have an account configured and regularly triggered watches that are not simulated are still working correctly and delivering the emails successfully when executed. I also tried explicitly setting the account name in the action definition but the error message said that the account could not be found.

I would appreciate any input on this.

Thanks


(Alexander Reelsen) #2

Hey, can you share the watch you tried this with along with your email setup for reproduction?


(Joshua Coward) #3

Hi, Thanks for the reply. I should say that it is not just one watch. This happens with every watch which is about ~75 at this point. Here is the simplest one. This watch executes successfully when it triggers on its 30m schedule.

  "trigger": {
    "schedule": {
      "interval": "30m"
    }
  },
  "input": {
    "none": {}
  },
  "condition": {
    "always": {}
  },
  "actions": {
    "smtp": {
      "email": {
        "profile": "standard",
        "to": [
          "gbu_cn_alerts_frmwrk_grp@oracle.com"
        ],
        "subject": "ALERT!! Test mail to check email connectivity",
        "body": {
          "html": "<h1>This is an alert to check email connectivity</h1><br><br><b>AlertType:</b> {{ctx.metadata._cne-alertType}}<br><b>AlertSeverity: </b>{{ctx.metadata._cne-alertSeverity}}<br><p>This alert is sent every 30 mins to check end to end email connectivity.</p>"
        }
      }
    }
  },
  "metadata": {
    "_cne-alertType": "monitoring",
    "_cne-envType": "dev",
    "_cne-alertSeverity": "info",
    "_cne_alertSeverity": "info",
    "_cne_stackName": "cndev",
    "_cne_alertType": "monitoring",
    "_cne-stackName": "cndev",
    "_cne_envType": "dev",
    "_cne_costCenter": "cne",
    "_cne-project": "cne-logging",
    "_cne-costCenter": "cne",
    "comment": "Alert to be triggered every 30 minutes to ensure end to end email connectivity",
    "_cne_project": "cne-logging"
  }
}

Here is my response from the Kibana simulate watch UI:

  "watch_id": "_inlined_",
  "node": "uzFUBKI9RhuqP-Ztg0WAZA",
  "state": "executed",
  "status": {
    "state": {
      "active": true,
      "timestamp": "2018-10-16T15:04:59.263Z"
    },
    "last_checked": "2018-10-16T15:04:59.263Z",
    "last_met_condition": "2018-10-16T15:04:59.263Z",
    "actions": {
      "smtp": {
        "ack": {
          "timestamp": "2018-10-16T15:04:59.263Z",
          "state": "awaits_successful_execution"
        },
        "last_execution": {
          "timestamp": "2018-10-16T15:04:59.263Z",
          "successful": false,
          "reason": ""
        }
      }
    },
    "execution_state": "executed",
    "version": -1
  },
  "trigger_event": {
    "type": "manual",
    "triggered_time": "2018-10-16T15:04:59.263Z",
    "manual": {
      "schedule": {
        "scheduled_time": "2018-10-16T15:04:59.263Z"
      }
    }
  },
  "input": {
    "none": {}
  },
  "condition": {
    "always": {}
  },
  "metadata": {
    "_cne-alertType": "monitoring",
    "_cne-envType": "dev",
    "_cne-alertSeverity": "info",
    "_cne_alertSeverity": "info",
    "_cne_stackName": "cndev",
    "_cne_alertType": "monitoring",
    "_cne-stackName": "cndev",
    "_cne_envType": "dev",
    "_cne_costCenter": "cne",
    "_cne-project": "cne-logging",
    "name": "PeriodicAlert",
    "_cne-costCenter": "cne",
    "comment": "Alert to be triggered every 30 minutes to ensure end to end email connectivity",
    "xpack": {
      "type": "json"
    },
    "_cne_project": "cne-logging"
  },
  "result": {
    "execution_time": "2018-10-16T15:04:59.263Z",
    "execution_duration": 3,
    "input": {
      "type": "none",
      "status": "success",
      "payload": {}
    },
    "condition": {
      "type": "always",
      "status": "success",
      "met": true
    },
    "actions": [
      {
        "id": "smtp",
        "type": "email",
        "status": "failure",
        "error": {
          "root_cause": [
            {
              "type": "illegal_argument_exception",
              "reason": "no accounts of type [email] configured. Please set up an account using the [xpack.notification.email] settings"
            }
          ],
          "type": "illegal_argument_exception",
          "reason": "no accounts of type [email] configured. Please set up an account using the [xpack.notification.email] settings"
        }
      }
    ]
  },
  "messages": []
}

Here is our configuration of the email account:

notification.email:
        account:
            alert_account:
                smtp:
                    auth: false
                    starttls.enable: false
                    starttls.required: false
                    host: smtp-relay
                    port: 2501
                email_defaults:
                  to: gbu_cn_logging_alerts_grp@oracle.com
                  reply_to: no-reply@oraclecne
                  subject: Central Logging Service Email Alert
        html.sanitization:
            disallow: _links, img:all

(Alexander Reelsen) #4

I assume this is a typo in the first line and you forgot the xpack prefix?

Also, are those settings configured on all nodes of your cluster and not just the master node?

One last ask: As indendation plays a role here. Can you put your configuration in a gist, so that the indentation does not accidentally get lost?

--Alex


(system) #5

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