Latency between worker and redis
ffuzax
HOBBYOP

2 months ago

I am running a infrastructure in the testing environnement that contains:
- DJANGO backend (trakalyze-back)

- Redis database in memory
- DJANGO Worker (trakalyze-backend-worker)

I have an issue while trying to send an email from the worker. My team and me saw that :

  1. the backend send the task to redis,

  2. the task is stored "sometimes" in redis

  3. and "sometimes" the worker get the task instruction and execute it.

    But the email is never sent.

    In localhost, everything works fine, we tried to run it using Coolify infra and everything works fine. I was wondering if you could check in your log if you could see something. Something very strange happens but it was working few month ago.

Solved$10 Bounty

3 Replies

Railway
BOT

2 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


ffuzax
HOBBYOP

2 months ago

Hello ! I have logged my worker and have now an error:

```
[2025-10-16 12:27:41,553: ERROR/MainProcess] trakalyze.tasks.send_email_async[7a65e9ab-ccfd-47d2-a459-f00618eac09b]: Failed to send email: subject='Processus de réinitialisation de mot de passe Trakalyze' to='delponleo@gmail.com'

Traceback (most recent call last):

File "/app/trakalyze/tasks.py", line 32, in send_email_async

smtp_service.send_email(to_email, subject, html_content)

File "/app/trakalyze/services/smtp.py", line 36, in send_email

with smtplib.SMTP(host, port_raw or 587, timeout=15) as server:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/smtplib.py", line 255, in init

(code, msg) = self.connect(host, port)

^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/smtplib.py", line 341, in connect

self.sock = self._get_socket(host, port, self.timeout)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/smtplib.py", line 312, in getsocket

return socket.create_connection((host, port), timeout,

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/socket.py", line 851, in create_connection

raise exceptions[0]

File "/usr/local/lib/python3.11/socket.py", line 836, in create_connection

sock.connect(sa)

TimeoutError: timed out

[2025-10-16 12:27:56,766: ERROR/MainProcess] trakalyze.tasks.send_email_async[7a65e9ab-ccfd-47d2-a459-f00618eac09b]: Failed to send email: subject='Processus de réinitialisation de mot de passe Trakalyze' to='delponleo@gmail.com'

Traceback (most recent call last):

File "/app/trakalyze/tasks.py", line 32, in send_email_async

smtp_service.send_email(to_email, subject, html_content)

File "/app/trakalyze/services/smtp.py", line 36, in send_email

with smtplib.SMTP(host, port_raw or 587, timeout=15) as server:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/smtplib.py", line 255, in init

(code, msg) = self.connect(host, port)

^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/smtplib.py", line 341, in connect

self.sock = self._get_socket(host, port, self.timeout)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/smtplib.py", line 312, in getsocket

return socket.create_connection((host, port), timeout,

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/socket.py", line 851, in create_connection

raise exceptions[0]

File "/usr/local/lib/python3.11/socket.py", line 836, in create_connection

sock.connect(sa)

TimeoutError: timed out

[2025-10-16 12:28:13,959: ERROR/MainProcess] trakalyze.tasks.send_email_async[7a65e9ab-ccfd-47d2-a459-f00618eac09b]: Failed to send email: subject='Processus de réinitialisation de mot de passe Trakalyze' to='delponleo@gmail.com'

Traceback (most recent call last):

File "/app/trakalyze/tasks.py", line 32, in send_email_async

smtp_service.send_email(to_email, subject, html_content)

File "/app/trakalyze/services/smtp.py", line 36, in send_email

with smtplib.SMTP(host, port_raw or 587, timeout=15) as server:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/smtplib.py", line 255, in init

(code, msg) = self.connect(host, port)

^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/smtplib.py", line 341, in connect

self.sock = self._get_socket(host, port, self.timeout)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/smtplib.py", line 312, in getsocket

return socket.create_connection((host, port), timeout,

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/socket.py", line 851, in create_connection

raise exceptions[0]

File "/usr/local/lib/python3.11/socket.py", line 836, in create_connection

sock.connect(sa)

TimeoutError: timed out
```

Do you think railway block SMTP ?


brody
EMPLOYEE

2 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody about 2 months ago


fra
HOBBY

2 months ago

The SMTP Is available only in the pro plan, with the other plans you need to use a third part service via http


Status changed to Solved samgordon about 1 month ago


Loading...