Developer forum

Forum » CMS - Standard features » MergeAndDeliver failed

MergeAndDeliver failed

Tomas Gomez
Reply

Hi,

We have an error sending an Email marketing campaign to 5000+ users. Some mails are sent and some others are not sent.

The task is timed out, and in Monitoring appear and error for each mail not sent:

Url: /Admin/Module/OMC/Emails/Statistics.aspx?OpType=RetryEmail&newsletterID=208
Description[199]: MergeAndDeliver failed. RecipientId: '111159'.
Exception type: ArgumentException
2021-09-01 10:53:38.024: [199]: MergeAndDeliver failed. RecipientId: '111159'.
System.ArgumentException: Value does not fall within the expected range.
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Web.Hosting.IIS7WorkerRequest.SetUnknownResponseHeader(String name, String value, Boolean replace)
at System.Web.Hosting.IIS7WorkerRequest.SetKnownResponseHeader(Int32 index, String value, Boolean replace)
at System.Web.HttpHeaderCollection.Remove(String name)
at Dynamicweb.Controls.Legacy.HttpHelper.SetSecurityHeaders()
at Dynamicweb.Frontend.PageView.SetSecurityHeaders()
at Dynamicweb.Frontend.PageView.Output()
at Dynamicweb.EmailMarketing.Renderer.BuildPageHtml(Int32 intPageID, String template, PageViewContext pageviewContext)
at Dynamicweb.EmailMarketing.EmailContentProvider.GetContent(Message message, Recipient recipient)
at Dynamicweb.Mailing.MessagingHandler.MessageHandler.MergeAndDeliverInternal()
at Dynamicweb.Mailing.MessagingHandler.MessageHandler.MergeAndDeliver(RecipientQueueItem rqi)
at Dynamicweb.Mailing.MessagingHandler.QueueWorker.<>c__DisplayClass7_1.<StartMergeAndDeliver>b__0()
2021-09-01 10:53:38.040: Request headers: [   "Connection",   "Accept",   "Accept-Encoding",   "Accept-Language",   "Cookie",   "Host",   "Referer",   "User-Agent",   "sec-ch-ua",   "sec-ch-ua-mobile",   "upgrade-insecure-requests",   "sec-fetch-site",   "sec-fetch-mode",   "sec-fetch-user",   "sec-fetch-dest" ]
2021-09-01 10:53:38.040: Request item keys: [   "UserManagement.GetUserById.81836",   "UserManagement.GetUserById.81806",   "UserManagement.GetUserById.81816", [... MORE IDS ...] "UserManagement.GetUserById.82983" ]
2021-09-01 10:53:38.040: Request form: []

The only information about this "MergeAndDeliver failed" error inthe forum is at this post, biut it has a different cause (An item with the same key has already been added)  

Does somebody know the cause of this error and how to fix it?

Regards,
Tomas


Replies

 
Tomas Gomez
Reply

Hi,

We sent another newsletter and has the same issue, some mails are sent and some not. There are thousands of errors in the Monitoring log.

Which parameteres or config should I check to search for the cause of this error?

Regards,
Tomas

 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Hi Tomas,

I don't know if this will help with your first question above, but check out the MailRecipient table. The following query is helpful: select * from EmailRecipient order by RecipientSentTime desc

Each send to a user is stored there, including the error message per recipient if there is a failure. That may uncover some clues.

The first error suggests that it's something with generating the email itself (and not the sending of the email). Some field that it needs is probably empty or null or something. If you can narrow it down to a particular user, you can compare that user to a known good one to see if anything stands out as missing.

Scott

 
Tomas Gomez
Reply

Hi Scott,

Thanks for your suggestion.

Searching the DB, the RECIPIENTERRORMESSAGE is empty and the RECIPIENTERRORTIME is null for all the emails. This reinforces your remark that it's something with generating the email itself (and not the sending of the email)

As well, there is not an empty data because the failed mails are sent when re-running the mailing task. That is, we run the task and some mails are sent, so we have to run it again several times until all mails are sent.

Is there ny other place where I can get more info about this error?

Regards,
Tomas

 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Hi Tomas,

What may have happened is that one of the emails failed, and then it stops on that problem email and doesn't continue on. When you run into that again, look at the results in the database again and you'll see that the most recent ones are still waiting to send (with nulls in many of the fields). Look for the most recent one that looks different. In other words, find the most recent message that failed. That will show you details on the message that it got hung up on.

btw, I'm giving most details by memory without a current failed situation to refer to. It may be that RecipientSentTime is also null until it's sent. In that case, it's probably RecipientId that you should order by instead.

Regarding the error message, I don't know that it's clear enough which field is the problem field. However, you do have a good clue to work with. That's RecipientId = 111159. Check out select * from EmailRecipient where RecipientId = 111159. That will show which user it got hung up on. You may find that something stands out with that data that will help track down the cause. Look for anything out of the ordinary like a blank date (it expects a real date) or a null or negative integer or possible an empty field that would typically be filled in.

Scott

 
Tomas Gomez
Reply

Thanks for the tips, Scott.

I will look for them on the next newsletter to our users

Regards,
Tomas

 
Tomas Gomez
Reply

Hi, Scott

I just sent the newsletter to 5800 users without any issue. Maybe the problematic recipient has unsuscribed or changed the data, I don't. know.

Anyway thanks for your supportt. i'll write again if I detect any other issue.

Regards,
Tomas

 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Hi Tomas,

Glad that it worked this time. As you say, it could be a problematic recipient, or some intermittent issue like a timeout. I'm sure it will come up again in the future, but nice to see it work well this time.

Scott

 

You must be logged in to post in the forum