haraka / Haraka

A fast, highly extensible, and event driven SMTP server
https://haraka.github.io
MIT License
5.11k stars 660 forks source link

Queue Error: ENOENT: no such file or directory #3386

Open gamalan opened 4 months ago

gamalan commented 4 months ago

Describe the bug

Transient queue error, possible because IO problem or timing problem. Similar message produce no error, it happen 1 out of 10 possible connection.

Jul 31 15:40:04 host haraka[30720]: [ERROR] [-] [core] [outbound] Unable to rename tmp file!: Error: ENOENT: no such file or directory, rename '/opt/smtp/haraka/queue/__tmp__.1722415204383_1722415204383_0_30720_L27Ues_69_host' -> '/opt/smtp/haraka/queue/1722415204383_1722415204383_0_30720_L27Ues_69_host'
Jul 31 15:40:04 host haraka[30720]: [ERROR] [1A88804D-1176-4F3E-A8FA-B4CC9D0FE9B1.1] [outbound] Queue error
Jul 31 15:40:04 host haraka[30720]: [ERROR] [1A88804D-1176-4F3E-A8FA-B4CC9D0FE9B1.1] [core] Unrecognized response from outbound layer: 903 : Queue error
Jul 31 15:40:04 host haraka[30720]: [NOTICE] [1A88804D-1176-4F3E-A8FA-B4CC9D0FE9B1.1] [core] disconnect ip=192.168.1.1 rdns=host helo=host relay=N early=N esmtp=N tls=N pipe=N errors=0 txns=1 rcpts=1/0/0 msgs=0/0/1 bytes=25224 lr="550 Queue error" time=0.584

Expected behavior

Assuming it's because io, timing or anything temporary, it should return 4xx code rather than 5xx code. Because it will treated as hard block/deny for 5xx. With 4xx code, the client will know they can retry it again later.

Observed behavior

Currently returning 550 Queue error.

Steps To Reproduce

Hard to reproduce, sometimes it happens, sometimes it not. It especially happen when same sender and recipient are being processed in bulk in short timeframe(1-2s).

System Info

Haraka Haraka.js — Version: 3.0.2
Node v16.20.2
OS Linux host 5.10.0-26-amd64 #1 SMP Debian 5.10.197-1 (2023-09-29) x86_64 GNU/Linux
openssl OpenSSL 1.1.1w 11 Sep 2023