2
Vote

Infinite Loop of EMails with Custom Forms/Workflows

description

In 1.6 I had a Custom Form (as a widget) and a Rule to send an e-mail. This worked fine.

I upgraded to 1.7.1 and then basically copied over the body of the e-mail into a new activity in Workflows. The workflow just had two (2) activities: 1) Form Submitted (the custom form I created in Content Types/Definitions) and 2) Send E-Mail. The Custom Form redirected to a page when submitted

Now, with 1.7.1 when I filled out the form and hit "Submit" I waited a few seconds for the redirect but there was no redirect, it just kept looking like it was going to redirect but never did. I then noticed that I started getting an infinite loop of e-mails (after about a minute over 100). I had to basically shut down the browser to stop it.

I have just recieved 10,000 emails from a single form submission...

This was previously recorded as:
https://orchard.codeplex.com/workitem/20256

Bug closed with no fix.
I think that if at least 3 people say thate is a bug, even without a repro, bug should not be closed.
I understand that a repro is something that helps fixing the bug but this one is pretty serious and it is there even if you close it.
How can Orchard code be trusted if such problems are closed without a fix because a full repro is missing.

The repro so far is:
1) Create a custom form in 1.6
2) create a rule that sends email (optional)
3) Upgrade to 1.7.2
4) Create a workflow activity that sends an email
5) Experience an infinite loop sending thousands of emails

My guess is that upgrade is not perfect.
I cannot repro on new forms.

Stack trace of the error:
Please note that it seems that an error occurs on sending email, but email si sent anyway
and the cycle continue until browser is closed...
(ps: xxxx@email.com is a fake email but the actual stack trace contains a real and valid email)

ilter, ActionExecutingContext preContext, Func`1 continuation)
2014-02-14 14:20:15,369 [7] NHibernate.AssertionFailure - An AssertionFailure occurred - this may indicate a bug in NHibernate or in your custom types.
NHibernate.AssertionFailure: null id in Orchard.ContentManagement.Records.ContentItemVersionRecord entry (don't flush the Session after an exception occurs)
2014-02-14 14:47:46,154 [13] Orchard.Email.Services.EmailMessagingChannel - An unexpected error while sending a message to xxxx@email.com: ActionEmail
System.Net.Mail.SmtpException: Errore durante l'invio della posta. ---> System.IO.IOException: Impossibile leggere dati dalla connessione del trasporto: net_io_connectionclosed.
in System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine)
in System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine)
in System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)
in System.Net.Mail.CheckCommand.Send(SmtpConnection conn, String& response)
in System.Net.Mail.DataStopCommand.Send(SmtpConnection conn)
in System.Net.Mail.SmtpConnection.OnClose(Object sender, EventArgs args)
in System.Net.ClosableStream.Close()
in System.Net.Mail.MailWriter.Close()
in System.Net.Mail.SmtpClient.Send(MailMessage message)
--- Fine della traccia dello stack dell'eccezione interna ---
in System.Net.Mail.SmtpClient.Send(MailMessage message)
in Orchard.Email.Services.EmailMessagingChannel.SendMessage(MessageContext context)
2014-02-14 14:47:46,251 [13] Orchard.Email.Services.EmailMessagingChannel - An unexpected error while sending a message to xxxx@email.com: ActionEmail
System.Net.Mail.SmtpException: Errore durante l'invio della posta. ---> System.IO.IOException: Impossibile leggere dati dalla connessione del trasporto: net_io_connectionclosed.
in System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine)
in System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine)
in System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)
in System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
in System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint)
in System.Net.Mail.SmtpClient.GetConnection()
in System.Net.Mail.SmtpClient.Send(MailMessage message)
--- Fine della traccia dello stack dell'eccezione interna ---
in System.Net.Mail.SmtpClient.Send(MailMessage message)

comments

manudea wrote Feb 14 at 1:00 PM

I may understand that this can be related to a not perferct upgrade.
The real bug is that a module sholud check data anyway and in no case send 100000 emails.... even if the upgrade failed in some place. Modules sholud consider that we live in an imperfect world and do the best to minimize issues. Nobody in real word has a perfect clean instance to play for, or can start the site from scratch each time a new version comes out.