Email Sending Issue with WebSocket Protocol Error

Encountering a problem when attempting to send 5000 emails.

The error message received is:
`Error: WebSocket protocol error: Connection reset without closing handshake

Caused by:
Connection reset without closing handshake`

Debugging command used: “/opt/kumomta/sbin/kcli trace-smtp-server”

Hey there @kindhearted-deer, thanks for posting. Please read the “Troubleshooting” and “How to Ask for Help” buttons below. If you would like a 1:1 support session from the KumoMTA team, details are at the “Book a Support Session” button below.

My guess is that you have a “WebSocket protocol error”

Without more detail it is difficult to assist

pls check the lua file
https://gist.github.com/arunkvinam/0ca8c099945ac0a9769d837a64aa41a8

Also share the command you were trying when you encountered the error.

And look at Troubleshooting KumoMTA - KumoMTA Docs to see all the areas you can look for information on the error.

command used : “/opt/kumomta/sbin/kcli trace-smtp-server”

The same issue I am also getting below is the journal logs
Mar 14 18:30:17 ip-10-4-1-101.ap-south-1.compute.internal kumod[7179]: 2024-03-14T13:00:17.864929Z ERROR localset-0 kumod::http_server::admin_trace_smtp_server_v1: error in websocket: channel lagged by 24
Mar 14 18:37:36 ip-10-4-1-101.ap-south-1.compute.internal kumod[7179]: 2024-03-14T13:07:36.531995Z ERROR localset-0 kumod::http_server::admin_trace_smtp_server_v1: error in websocket: channel lagged by 41
Mar 14 22:47:42 ip-10-4-1-101.ap-south-1.compute.internal kumod[7179]: 2024-03-14T17:17:42.464917Z ERROR localset-0 kumod::http_server::admin_trace_smtp_server_v1: error in websocket: channel lagged by 337

This looks like an error kcli not actually kumod
I’ll try to do some testing today

@youthful-zorse how many were you sending in this test? Did you see this immediately or after thousands of messages?

i tried for atleast 10k and when I on the trace it shows me error in between

Although it’s not impacting my delivery but it is very useful at the when I am sending approximately 1lakh mail for testing

I am curious about your use case, why would you find it necessary to SMTP Trace thousands of messages? What are you trying to achieve when watching that many SMTP conversations in realtime?

the tracing functionality is not intended to handle what essentially amounts to a full copy + more of every incoming SMTP connection, all multiplexed onto a single websocket connection that outputs to a terminal display with limited display throughput (and thus, high back-pressure), all in realtime. You should consider using at least the --source option to limit the source addresses and reduce the amount of bandwidth needed for the trace

this error arrise for 200 emails as well

So, this means when I going to use --source option then I the websocket error won’t arrive? please correct me if my understanding is wrong

if you use --source it will only include mail coming into the MTA from a specific IP or CIDR block; the idea is that you specify the minimal scope for what you want to trace in realtime to something that is realistic. The trace session is not going to be able to handle high speed, high throughput, high concurrency tracing.

ok thanks I have now understand your point.