Illegal Argument Exception in Watcher Email Service

Hi all,

I am having a bit of trouble with the email action. Here's my .yml config

xpack.notification.email.account: outlook_account: profile: outlook smtp: auth: true starttls.enable: true host: smtp-mail.outlook.com port: 587 user: user@domain password: *****

Here is my code in watcher

{
  "trigger": {
    "schedule": {
      "interval": "10s"
    }
  },
  "input": {
    "search": {
      "request": {
        "search_type": "query_then_fetch",
        "indices": [
          "myindex"
        ],
        "types": [],
        "body": {
          "size": 0,
          "query": {
            "query_string": {
              "query": "Date:[* TO now-7d]"
            }
          }
        }
      }
    }
  },
  "condition": {
    "compare": {
      "ctx.payload.hits.total": {
        "gte": 0
      }
    }
  },
  "actions": {
    "send_email": {
      "email": {
        "account": "outlook_account",
        "profile": "outlook",
        "to": [
          "Name <user@domain>"
        ],
        "subject": "Possible Malfunctioning Codes",
        "body": {
          "text": "There are {{ctx.payload.hits.total}} codes that have not checked in in the last 7 days."
        }
      }
    }
  }
}

And here is the error I have

"id": "send_email",
          "type": "email",
          "status": "failure",
          "reason": "IllegalArgumentException[no account found for name: [outlook_account]]"

I saw this thread: Automated Report Failing and it has the exact same issue as I do but I can not replicate his success with the same steps. I am worried I am somehow doing something wrong in the .yml. Please help!

Thanks!

can you put the exact YAML configuration (including indentation) somewhere in a gist?

xpack.notification.email.account:
    outlook_account:
        profile: outlook
        smpt:
            auth: true
            starttls: true
            host: smpt-mail.outlook.com
            port: 587
            user: User@Domain
            password: *****

Sorry, here is the part with indentation

Have you put this configuration on all your nodes? Can you run the following commands?

GET _cat/nodes

GET _nodes?filter_path=**.xpack.notification

and paste the output here?

--Alex

GET _cat/nodes
      127.0.0.1 59 46 10    mdi * K70q9fd


GET _nodes?filter_path=**.xpack.notification
      {}

Am I missing something?

hey,

first, did you restart the node after you changed the settings?
second, which Elasticsearch version is this?

--Alex

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