Watcher failed to send e-mail( via kibana)

Hello!
well, i'm new to elasticsearch, and i'm trying to configure elasticsearch to receive alerts, so for that i use the configuration below, but I couldn't send a test email, and everytime the following msg is displayed: error to send e-mail (via watcher)

i note also that i have already inserted the e-mail address i use in the whitelist by following the steps mentioned here : https://www.elastic.co/guide/en/cloud/current/ec-watcher.html#ec-watcher

/etc/elasticsearch/elasticsearch.yml

#Section Index

xpack.notification.email.account

gmail_account:

    profile: gmail

    smtp:

        auth: true

        starttls.enable: true

        host: [smtp.gmail.com](http://smtp.gmail.com/)

        port: 587

Please check the attached screenshot.

3

Please refrain from using screenshots for showing configuration items, this is really hard to read.

this is hard to tell without any error message. Any more information available.

I do not see a username configured and also you need to store the SMTP password in the keystore, see https://www.elastic.co/guide/en/elasticsearch/reference/7.4/actions-email.html#gmail

hello!

Here is the configuration used::
/etc/elasticsearch/elasticsearch.yml

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

root@test-ubuntu:/etc/elasticsearch# /usr/share/elasticsearch/bin/elasticsearch-keystore add xpack.notification.email.account.gmail_account.smtp.secure_password
Enter value for xpack.notification.email.account.gmail_account.smtp.secure_password:

root@test-ubuntu:/etc/elasticsearch# sudo systemctl start elasticsearch

so the following error is displayed

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

systemctl edit elasticsearch
Editing "/etc/systemd/system/elasticsearch.service.d/override.conf" canceled: temporary file is empty.
root@test-ubuntu:/etc/elasticsearch# sudo systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; ve
Active: failed (Result: timeout) since Thu 2019-11-21 12:05:50 +01; 9min a
Docs: http://www.elastic.co
Main PID: 2500 (code=exited, status=143)

nov. 21 12:04:16 test-ubuntu systemd[1]: Starting Elasticsearch...
nov. 21 12:04:55 test-ubuntu elasticsearch[2500]: OpenJDK 64-Bit Server VM w
nov. 21 12:05:46 test-ubuntu systemd[1]: elasticsearch.service: Start operat
nov. 21 12:05:50 test-ubuntu systemd[1]: elasticsearch.service: Failed with
nov. 21 12:05:50 test-ubuntu systemd[1]: Failed to start Elasticsearch.
lines 1-11/11 (END)

can you check the elasticsearch logfiles or the journalctl output. See https://www.elastic.co/guide/en/elasticsearch/reference/7.4/starting-elasticsearch.html#start-es-deb-systemd

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