# Cant send mail alert through watcher

**URL:** <https://discuss.elastic.co/t/cant-send-mail-alert-through-watcher/229011>\
**Category:** Elasticsearch\
**Created:** [April 21, 2020, 10:19am UTC](https://discuss.elastic.co/t/cant-send-mail-alert-through-watcher/229011 "2020-04-21T10:19:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rakeshraagu2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakeshraagu2/32/66283_2.png) [@rakeshraagu2](https://discuss.elastic.co/u/rakeshraagu2)\
**Post date:** [April 21, 2020, 10:19am UTC](https://discuss.elastic.co/t/cant-send-mail-alert-through-watcher/229011/1 "2020-04-21T10:19:36Z")

</div>

Hi,

When I testing my mail alert using watcher it is showing an error that mail send failed.

In my cluster log file I saw below given line. Can anyoone help.

][ERROR][o.e.x.w.a.e.ExecutableEmailAction] [elk-master] failed to execute action [_inlined_/email\_1]  
javax.mail.MessagingException: failed to send email with subject [Watch [filebeat] has exceeded the threshold] via account [gmail\_account]

---

<div class="post-metadata">

**Author:** ![rakeshraagu2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakeshraagu2/32/66283_2.png) [@rakeshraagu2](https://discuss.elastic.co/u/rakeshraagu2)\
**Post date:** [April 21, 2020, 10:22am UTC](https://discuss.elastic.co/t/cant-send-mail-alert-through-watcher/229011/2 "2020-04-21T10:22:48Z")

</div>

Full error message

[2020-04-21T15:43:55,727][ERROR][o.e.x.w.a.e.ExecutableEmailAction] [elk-master] failed to execute action [_inlined_/email\_1]  
javax.mail.MessagingException: failed to send email with subject [Watch [filebeat] has exceeded the threshold] via account [gmail\_account]  
at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:171) ~[?:?]  
at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:163) ~[?:?]  
at org.elasticsearch.xpack.watcher.actions.email.ExecutableEmailAction.execute(ExecutableEmailAction.java:76) ~[?:?]  
at org.elasticsearch.xpack.core.watcher.actions.ActionWrapper.execute(ActionWrapper.java:164) [x-pack-core-7.6.2.jar:7.6.2]  
at org.elasticsearch.xpack.watcher.execution.ExecutionService.executeInner(ExecutionService.java:534) [x-pack-watcher-7.6.2.jar:7.6.2]  
at org.elasticsearch.xpack.watcher.execution.ExecutionService.execute(ExecutionService.java:320) [x-pack-watcher-7.6.2.jar:7.6.2]  
at org.elasticsearch.xpack.watcher.transport.actions.execute.TransportExecuteWatchAction$1.doRun(TransportExecuteWatchAction.java:159) [x-pack-watcher-7.6.2.jar:7.6.2]  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-7.6.2.jar:7.6.2]  
at org.elasticsearch.xpack.watcher.execution.ExecutionService$WatchExecutionTask.run(ExecutionService.java:627) [x-pack-watcher-7.6.2.jar:7.6.2]  
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:633) [elasticsearch-7.6.2.jar:7.6.2]  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]  
at java.lang.Thread.run(Thread.java:830) [?:?]  
Caused by: javax.mail.AuthenticationFailedException: failed to connect, no password specified?  
at javax.mail.Service.connect(Service.java:376) ~[?:?]  
at org.elasticsearch.xpack.watcher.notification.email.Account.lambda$executeConnect$2(Account.java:161) ~[?:?]  
at java.security.AccessController.doPrivileged(AccessController.java:554) ~[?:?]  
at org.elasticsearch.xpack.watcher.notification.email.Account.executeConnect(Account.java:160) ~[?:?]  
at org.elasticsearch.xpack.watcher.notification.email.Account.send(Account.java:119) ~[?:?]  
at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:169) ~[?:?]  
... 12 more

---

<div class="post-metadata">

**Author:** ![rakeshraagu2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakeshraagu2/32/66283_2.png) [@rakeshraagu2](https://discuss.elastic.co/u/rakeshraagu2)\
**Post date:** [April 21, 2020, 10:23am UTC](https://discuss.elastic.co/t/cant-send-mail-alert-through-watcher/229011/3 "2020-04-21T10:23:56Z")

</div>

elasticseacrh.yml entry

xpack.notification.email.account:  
gmail\_account:  
profile: gmail  
smtp:  
auth: true  
starttls.enable: true  
host: [smtp.gmail.com](http://smtp.gmail.com)  
port: 587  
user:

---

<div class="post-metadata">

**Author:** ![rakeshraagu2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakeshraagu2/32/66283_2.png) [@rakeshraagu2](https://discuss.elastic.co/u/rakeshraagu2)\
**Post date:** [April 21, 2020, 10:25am UTC](https://discuss.elastic.co/t/cant-send-mail-alert-through-watcher/229011/4 "2020-04-21T10:25:27Z")

</div>

Ketstore value addes using this command,

sudo /usr/share/elasticsearch/bin/elasticsearch-keystore add xpack.notification.email.account.my-gmail-user-id.smtp.secure\_password

---

<div class="post-metadata">

**Author:** ![rakeshraagu2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakeshraagu2/32/66283_2.png) [@rakeshraagu2](https://discuss.elastic.co/u/rakeshraagu2)\
**Post date:** [April 21, 2020, 11:42am UTC](https://discuss.elastic.co/t/cant-send-mail-alert-through-watcher/229011/5 "2020-04-21T11:42:54Z")

</div>

Isnt anyone here who can help?...

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 21, 2020, 10:00pm UTC](https://discuss.elastic.co/t/cant-send-mail-alert-through-watcher/229011/6 "2020-04-21T22:00:18Z")

</div>

> [@rakeshraagu2](#):
>
> Caused by: javax.mail.AuthenticationFailedException: failed to connect, no password specified?

That would appear to be why, you may want to check your config.

---

<div class="post-metadata">

**Author:** ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)\
**Post date:** [May 5, 2020, 8:59pm UTC](https://discuss.elastic.co/t/cant-send-mail-alert-through-watcher/229011/7 "2020-05-05T20:59:35Z")

</div>

Same issue here....Warklom, doesn't running the keystore command specify the password?

> [@rakeshraagu2](#):
>
> Ketstore value addes using this command,
> 
> sudo /usr/share/elasticsearch/bin/elasticsearch-keystore add xpack.notification.email.account.my-gmail-user-id.smtp.secure\_password

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 2, 2020, 8:59pm UTC](https://discuss.elastic.co/t/cant-send-mail-alert-through-watcher/229011/8 "2020-06-02T20:59:59Z")

</div>

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