guardian.py crashes in docker when trying to send email

NEW
Unassigned

Status

4 months ago
4 months ago

People

(Reporter: mcote, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 months ago
I haven't looked into this enough to figure out if it's a docker config problem or a general problem when email isn't configured, but sometimes there's a race condition in the docker setup in which guardian.py starts up before RabbitMQ is available.  It then tries to send an error-notification email but then entirely crashes:

pulseguardian-guardian_1_eba18d162560 | [Startup] PulseGuardian started.
pulseguardian-guardian_1_eba18d162560 | [Other] Guard loop starting.
pulseguardian-guardian_1_eba18d162560 | [Other] Could not connect to Pulse
pulseguardian-guardian_1_eba18d162560 | Traceback (most recent call last):
pulseguardian-guardian_1_eba18d162560 |   File "pulseguardian/guardian.py", line 465, in <module>
pulseguardian-guardian_1_eba18d162560 |     pulse_guardian.guard()
pulseguardian-guardian_1_eba18d162560 |   File "pulseguardian/guardian.py", line 436, in guard
pulseguardian-guardian_1_eba18d162560 |     self.notify_connection_error()
pulseguardian-guardian_1_eba18d162560 |   File "pulseguardian/guardian.py", line 356, in notify_connection_error
pulseguardian-guardian_1_eba18d162560 |     subject=subject, to_users=admins, text_data=errmsg)
pulseguardian-guardian_1_eba18d162560 |   File "pulseguardian/guardian.py", line 68, in _sendemail
pulseguardian-guardian_1_eba18d162560 |     use_ssl=config.email_ssl)
pulseguardian-guardian_1_eba18d162560 |   File "/code/pulseguardian/sendemail.py", line 54, in sendemail
pulseguardian-guardian_1_eba18d162560 |     server = smtplib.SMTP(server, port)
pulseguardian-guardian_1_eba18d162560 |   File "/usr/local/lib/python2.7/smtplib.py", line 256, in __init__
pulseguardian-guardian_1_eba18d162560 |     (code, msg) = self.connect(host, port)
pulseguardian-guardian_1_eba18d162560 |   File "/usr/local/lib/python2.7/smtplib.py", line 317, in connect
pulseguardian-guardian_1_eba18d162560 |     self.sock = self._get_socket(host, port, self.timeout)
pulseguardian-guardian_1_eba18d162560 |   File "/usr/local/lib/python2.7/smtplib.py", line 292, in _get_socket
pulseguardian-guardian_1_eba18d162560 |     return socket.create_connection((host, port), timeout)
pulseguardian-guardian_1_eba18d162560 |   File "/usr/local/lib/python2.7/socket.py", line 575, in create_connection
pulseguardian-guardian_1_eba18d162560 |     raise err
pulseguardian-guardian_1_eba18d162560 | socket.error: [Errno 111] Connection refused

The problem is either that it's trying to send email when it's not configured, which it shouldn't, or that the docker environment is somehow configured with invalid email settings.
You need to log in before you can comment on or make changes to this bug.