Reception webhook delay

https://gist.github.com/maratgaliev/e75a054debf7f816562dd9946002c27c
Hi team, somehow I’m getting delays for Reception webhooks, and its kinda random.
Meaning in 80% or 90% I’m getting them with delay.

  • Usually it’s like last reception hook, ie if I have 3 subscribers, I have 2 Reception immediate, like Delivery, but last one always delayed
  • Sometime it’s ok, I’m receiving Reception at the same time as Delivery, no changes, no delays, but in 90% I would say it’s delay
    Any thoughts? Please let me know if you want to see my config files.
    In my log you can see - first Reception I’m getting Feb 24 20:08:56 and last one at Feb 24 20:14:01, so after 6 minutes.
    Thank you and appreciate your time.

Apologies I just realized I didn’t post my kumoMTA config file https://gist.github.com/maratgaliev/d2f645778173a094596f58da26b32699

You may want to look at your local logs and filter for “webhook” to see if there might be a connection delay.

Hi @faithful-ostrich , sorry you mean my EC2 logs? Because the gist I posted in my original message is from my EC2 instance, basically it’s a log of KumoMTA execution, so it’s local.

No I mean /var/log/kumomta/

What you posted looks like a journal trace

Ho sorry I see this:
https://gist.github.com/maratgaliev/740362a4b3b1a11322ccfa5c8be3af41

You have a couple of different errors there you may want to compensate for.

  1. “error in deliver_message: sender:send method failed: error converting Lua nil to String”. You will probably want to add some code to convert nils to “”. That may be in headers or meta you are including
    headers = { 'Subject', 'From', 'Message-Id', 'Campaign-Id', 'Campaign' },
    meta = { 'tenant_name', 'direction', 'domain_name', 'campaign_id', 'campaign' }
  1. “failed to connect to any candidate hosts: only one connection attempt per session”
    I don’t see any shaping config that would restrict you to 1 connection, but you may want to add a connection limit that is higher - the default is 32.

Also, you may want to change this to type JSON
:header('Content-Type', 'application/x-www-form-urlencoded')

You may be able to get better debugging if you print the disposision on error as well

        return disposition
      end
-- ADD THIS:
print ("Webhook failed: ",disposition)

      kumo.reject(500, disposition)
    end```