Rigth configuration to send mail (gmail)

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*

    xpack.notification.email.account:
    gmail_account:
    profile: gmail
    smtp:
    auth: true
    starttls.enable: true
    host: smtp.gmail.com
    port: 587
    user: mymail@gmail.com

  • Acctions: Management > Watcher > Make Test Mail

  • Error: "Failed to send email to 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*

    xpack.notification.email.account:
    gmail_account:
    profile: gmail
    smtp:
    auth: true
    starttls.enable: true
    host: smtp.gmail.com
    port: 587
    user: mymail@gmail.com
    password: password_text_plain**

  • 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
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:

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.

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

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