# Rigth configuration to send mail (gmail)

**URL:** <https://discuss.elastic.co/t/rigth-configuration-to-send-mail-gmail/211031>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [December 8, 2019, 10:11pm UTC](https://discuss.elastic.co/t/rigth-configuration-to-send-mail-gmail/211031 "2019-12-08T22:11:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![carmezsa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carmezsa/32/59443_2.png) [@carmezsa](https://discuss.elastic.co/u/carmezsa)\
**Post date:** [December 8, 2019, 10:11pm UTC](https://discuss.elastic.co/t/rigth-configuration-to-send-mail-gmail/211031/1 "2019-12-08T22:11:52Z")

</div>

Hi,  
I sorry but I don`t understand where is the error to send mail with guiward watcher test.  
Elasticsearch version: 7.5  
OS: ubuntu 19.10

**My configuration. Check 1** :

- File: /etc/elasticsearch.yml

- Information  
xpack.watcher.enabled : true  
action.auto\_create\_index: .watches,.triggered\_watches,.watcher-history\*

- Acctions: Management \> Watcher \> Make Test Mail

- Error: "Failed to send email to [mail.out.demo.test@gmail.com](mailto:mail.out.demo.test@gmail.com). "

- Logs Elasticsearch:  
--- Begin logs ---  
[2019-12-08T22:58:03,022][ERROR][o.e.x.w.a.e.ExecutableEmailAction] [ubuntuserver] failed to execute action [_inlined_/email\_1]  
javax.mail.MessagingException: failed to send email with subject [Correo OUT : Watch [Creando\_threshold\_alert] 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:72) ~[?:?]  
at org.elasticsearch.xpack.core.watcher.actions.ActionWrapper.execute(ActionWrapper.java:164) [x-pack-core-7.5.0.jar:7.5.0]  
at org.elasticsearch.xpack.watcher.execution.ExecutionService.executeInner(ExecutionService.java:534) [x-pack-watcher-7.5.0.jar:7.5.0]  
at org.elasticsearch.xpack.watcher.execution.ExecutionService.execute(ExecutionService.java:320) [x-pack-watcher-7.5.0.jar:7.5.0]  
at org.elasticsearch.xpack.watcher.transport.actions.execute.TransportExecuteWatchAction$1.doRun(TransportExecuteWatchAction.java:159) [x-pack-watcher-7.5.0.jar:7.5.0]  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.xpack.watcher.execution.ExecutionService$WatchExecutionTask.run(ExecutionService.java:627) [x-pack-watcher-7.5.0.jar:7.5.0]  
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:703) [elasticsearch-7.5.0.jar:7.5.0]  
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) ~[?:?]

--- end logs ---

**My configuration. Check 2** :

- File: /etc/elasticsearch.yml

- Information  
xpack.watcher.enabled : true  
action.auto\_create\_index: .watches,.triggered\_watches,.watcher-history\*

- Acctions: systemctl restart elasticsearch

- Error:  
Job for elasticsearch.service failed because the control process exited with error code.  
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.

- Logs Elasticsearch: "root@ubuntuserver:/etc# tail -n 100 /var/log/elasticsearch/elasticsearch.log "  
--- Begin logs ---  
java.lang.IllegalArgumentException: unknown setting [xpack.notification.email.account.gmail\_account.smtp.password] please check that any required plugins are installed, or check the breaking changes documentation for removed settings  
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:530) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:475) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:446) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:417) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.common.settings.SettingsModule.(SettingsModule.java:149) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.node.Node.(Node.java:352) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.node.Node.(Node.java:253) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:221) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:221) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) [elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) [elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) [elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125) [elasticsearch-cli-7.5.0.jar:7.5.0]  
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-7.5.0.jar:7.5.0]  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) [elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-7.5.0.jar:7.5.0]  
[2019-12-08T23:05:04,145][WARN][o.e.b.ElasticsearchUncaughtExceptionHandler] [ubuntuserver] uncaught exception in thread [main]  
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown setting [xpack.notification.email.account.gmail\_account.smtp.password] please check that any required plugins are installed, or check the breaking changes documentation for removed settings  
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125) ~[elasticsearch-cli-7.5.0.jar:7.5.0]  
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.5.0.jar:7.5.0]  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.5.0.jar:7.5.0]  
Caused by: java.lang.IllegalArgumentException: unknown setting [xpack.notification.email.account.gmail\_account.smtp.password] please check that any required plugins are installed, or check the breaking changes documentation for removed settings  
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:530) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:475) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:446) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:417) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.common.settings.SettingsModule.(SettingsModule.java:149) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.node.Node.(Node.java:352) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.node.Node.(Node.java:253) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:221) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:221) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) ~[elasticsearch-7.5.0.jar:7.5.0]  
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.5.0.jar:7.5.0]  
... 6 more  
--- end logs ---

--- Begin logs ---  
root@ubuntuserver:/etc# systemctl status elasticsearch.service  
● elasticsearch.service - Elasticsearch  
Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)  
Active: failed (Result: exit-code) since Sun 2019-12-08 23:05:04 CET; 1min 23s ago  
Docs: [http://www.elastic.co](http://www.elastic.co)  
Process: 32262 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID\_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)  
Main PID: 32262 (code=exited, status=1/FAILURE)

Dec 08 23:04:51 ubuntuserver systemd[1]: Starting Elasticsearch...  
Dec 08 23:04:52 ubuntuserver elasticsearch[32262]: OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.  
Dec 08 23:05:04 ubuntuserver systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE  
Dec 08 23:05:04 ubuntuserver systemd[1]: elasticsearch.service: Failed with result 'exit-code'.  
Dec 08 23:05:04 ubuntuserver systemd[1]: Failed to start Elasticsearch.  
--- end logs ---

I dont know why Elasticsearch can't run.

Some reference to configure EL7.5:

- [https://www.elastic.co/guide/en/x-pack/5.4/actions-email.html#gmail](https://www.elastic.co/guide/en/x-pack/5.4/actions-email.html#gmail)

**Tip** : If I run the next command the result is wrong.  
root@ubuntuserver:/etc# bin/elasticsearch-keystore add xpack.notification.email.account.gmail\_account.smtp.secure\_password  
bash: bin/elasticsearch-keystore: No such file or directory

Please, can you help me?  
Thanks.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 9, 2019, 1:32pm UTC](https://discuss.elastic.co/t/rigth-configuration-to-send-mail-gmail/211031/2 "2019-12-09T13:32:46Z")

</div>

please take the time to properly format your snippets. This is impossible to read.

`bin/elasticsearch-keystore` in the docs is just a pointer, when installing elasticsearch via tar.gz archive and you are in that installed directory. When you use a package you can find those commands in `/usr/share/elasticsearch/bin`

---

<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:** [January 6, 2020, 1:32pm UTC](https://discuss.elastic.co/t/rigth-configuration-to-send-mail-gmail/211031/3 "2020-01-06T13:32:53Z")

</div>

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