question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR:root:Error while running alert email: Error connecting to SMTP host: [Errno 111] Connection refused

See original GitHub issue

Hi everyone, I have finished elastalert-create-index and got the status created. But when I started to add log into elasticsearch, elastalert can’t send out email to alert me.

ERROR:root:Error while running alert email: Error connecting to SMTP host: [Errno 111] Connection refused
INFO:elastalert:Ignoring match for silenced rule Example rule
INFO:elastalert:Ignoring match for silenced rule Example rule
INFO:elastalert:Ignoring match for silenced rule Example rule
INFO:elastalert:Ignoring match for silenced rule Example rule
INFO:elastalert:Ignoring match for silenced rule Example rule
INFO:elastalert:Ran Example rule from 2016-07-11 17:34 UTC to 2016-07-11 17:37 UTC: 543 query hits, 108 matches, 0 alerts sent
INFO:elastalert:Sleeping for 59 seconds

I have checked the previous post (https://github.com/Yelp/elastalert/issues/256) and set my example_rules/example_frequency.yaml file as following

# (Required)
# The alert is use when a match is found
alert:
- "email"

# (required, email specific)
# a list of email addresses to send alerts to
email:
#- "elastalert@example.com"
- "--my email--"
from_addr: "--my email--"

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
ShaneC-C-Ycommented, Jul 11, 2016

hi Quentin Long, thank you very much. Now I can receive the email. My setting is the following:

email:
#- "elastalert@example.com"
- "chienyuc@elementaltechnologies.com"
smtp_host: "smtp.gmail.com"
smtp_port: 465
smtp_ssl: true
from_addr: "chienyuc@elementaltechnologies.com"
smtp_auth_file: '/opt/elastalert/smtp_auth_file.yaml'

if I keep port 587, the error message is like this:

ERROR:root:Error while running alert email: Error connecting to SMTP host: [Errno 1] _ssl.c:510: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

BTW, I received this error message if I didn’t create I new password

ERROR:root:Error while running alert email: Error connecting to SMTP host: (534, '5.7.9 Application-specific password required. Learn more at\n5.7.9  https://support.google.com/accounts/answer/185833 i187sm5150287pfc.62 - gsmtp')

So we need to create another password to use, steps are here: (https://support.google.com/accounts/answer/185833)

Hope it can help others, thank you again!

3reactions
ShaneC-C-Ycommented, Jul 11, 2016

Thank for your help, sorry I am not familiar how to use SMTP server. This is my setting:

# (required, email specific)
# a list of email addresses to send alerts to
email:
#- "elastalert@example.com"
- "chienyuc@elementaltechnologies.com"
smtp_host: "smtp.gmail.com"
smtp_port: 587
smtp:ssl: true
from_addr: "chienyuc@elementaltechnologies.com"
smtp_auth_file: '/opt/elastalert/smtp_auth_file.yaml'

and the smtp_auth_file.yaml is

---
user: ---my-full-email---
password: ---my-email-login-password
...

but it still doesn’t work

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve "Error connecting to SMTP host: [Errno 10061 ...
I get an error as: ERROR:root: Error while running alert email: Error connecting to SMTP host: [Errno 10061] No connection could be ...
Read more >
ElastAlert 2 Documentation
ERROR:root:Error while running alert email : Error connecting to SMTP host: [Errno 61]␣. ˓→Connection refused.
Read more >
VMware Communities : Discussion List - vCenter™ Server
My vSphere Client suddenly can't connect to vCenter Server. Use command to login, but receive a "Error in service module” error message.
Read more >
bitsensor
Created 3 years ago in bitsensor/elastalert-kibana-plugin with 26 comments. ... ERROR:root:Could not load rule & Error connecting to SMTP host: [Errno 111] ...
Read more >
python get exception message Code Example
import logging as log # Output: ERROR:root:Error message log.error("Error message")
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found