listmonk icon indicating copy to clipboard operation
listmonk copied to clipboard

"broken pipe" with Docker and AWS

Open tricoos opened this issue 2 years ago • 1 comments

Version:

  • listmonk: 2.4.0
  • OS: Docker

Description of the bug and steps to reproduce: New issue from https://github.com/knadh/listmonk/issues/81

When sending opt-in mails using the :subscriberId/optin endpoint the sending only logs "2023/05/11 13:23:44 error sending message 'Confirm subscription': write tcp 172.22.0.3:59026->3.123.183.68:465: write: broken pipe" without any tcp messages logged by wireshark (tshark) at all indicating that the issue is not a network error but probably an internal error that seems to expect an open connection, tries to use it without checking if it's still open and then failing immediately.

However, when it works these TCP messages are logged first: 48 1.991881596 XXX.XXX.XXX.XXX → 185.12.64.2 DNS 108 Standard query 0x1727 AAAA email-smtp.eu-central-1.amazonaws.com OPT 49 1.992384418 XXX.XXX.XXX.XXX → 185.12.64.2 DNS 108 Standard query 0x4f06 A email-smtp.eu-central-1.amazonaws.com OPT 50 1.992644516 185.12.64.2 → XXX.XXX.XXX.XXX DNS 186 Standard query response 0x1727 AAAA email-smtp.eu-central-1.amazonaws.com SOA ns-423.awsdns-52.com OPT 51 1.992759270 185.12.64.2 → XXX.XXX.XXX.XXX DNS 294 Standard query response 0x4f06 A email-smtp.eu-central-1.amazonaws.com A 18.159.193.132 A 52.29.83.250 A 3.123.183.68 NS ns-1944.awsdns-51.co.uk NS ns-423.awsdns-52.com NS ns-1000.awsdns-61.net NS ns-1074.awsdns-06.org OPT

So it initially when the issue occurs it did not even try to resolve the AWS mailserver hostname, it absolutely sent nothing at all. I locked the IP address down to 3.123.183.68 in the hosts file to be able to analyze this better: tshark -i eth0 -p host 3.123.183.6

The result was the same: when an error was logged in listmonk not a single package was sent to that IP, when it worked, it logged a lot of entries. I would assume that if there was a network error it would log the network requests with corresponding errors, but it logs absolutely nothing.

2023/05/11 13:46:42error sending message 'Confirm subscription': write tcp 172.22.0.3:33690->3.123.183.68:465: write: broken pipe

tricoos avatar May 17 '23 06:05 tricoos

Can you try exec'ing into the container and trying to connect to 3.123.183.68 465 with telnet or something when this happens? Want to first make sure that it's not the container itself for some reason.

Also, what is the timeout you've set for the SMTP server in settings?

knadh avatar May 17 '23 12:05 knadh