You are viewing limited content. For full access, please sign in.

Question

Question

Workflow email failures - too many SMTP Connections

asked on March 8, 2016 Show version history

Hi all,

I'm getting email workflow failures at the moment - the workflows that report via this SMTP server have worked daily for months.  Only once I noticed a report that ran at midnight tended to be failing - with a too many connections error - I figured maybe the server was really busy at midnight at one end or the other or something so I moved the process to 10pm.  No problems until yesterday and today.

Suddenly, although I can use the email connection configuration dialogue to successfully send a test email when the workflows that have always relied on this (unchanged at either end) connection they fail when sending.

The errors I have are these:

<Message>Service not available, closing transmission channel. The server response was: Too many concurrent SMTP connections; please try again later.</Message>

My mail host says the problem is local and not something I can configure with the WHM/cPanel account that I'm using as an smtp service for testing workflow with outbound email.

Again, it's worked for months with only a few instances of this until now.

----------------------------------------
Timestamp: 2016-03-08 10:00:08.045
Local Time: 8/03/2016 8:00:08 PM
Category: Activity
Machine: XXXXXX
Severity: Error
Application Domain: Laserfiche.Workflow.Service.exe
Process Id: 10320
Process Name: D:\Program Files\Laserfiche\Laserfiche Workflow 9\Laserfiche.Workflow.Service.exe
Win32 Thread Id: 20732 - 
Thread Name: 
Message: <Exception handlingInstanceId="c3ace5c5-4245-4067-9249-8383d48ce3f6">
  <Description>An exception of type 'System.Exception' occurred and was caught.</Description>
  <DateTime>2016-03-08 20:00:08Z</DateTime>
  <ExceptionType>System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
  <Message>Service not available, closing transmission channel. The server response was: Too many concurrent SMTP connections; please try again later.</Message>
  <Source>Laserfiche.Workflow.Activity.Base</Source>
  <HelpLink />
  <Property name="ActivityName">Email_Email</Property>
  <Property name="ActivityType">Laserfiche.Workflow.Activities.Email.EmailActivity</Property>
  <Property name="InstanceId">1dafe637-cec2-4239-83c7-54b2612aac41</Property>
  <Property name="TargetSite">Void ProcessTaskQueueEvent(System.Workflow.ComponentModel.ActivityExecutionContext)</Property>
  <Property name="HResult">-2146233088</Property>
  <StackTrace>   at Laserfiche.Workflow.Activities.TaskActivityBase.ProcessTaskQueueEvent(ActivityExecutionContext context)
   at Laserfiche.Workflow.Activities.TaskActivityBase.OnEvent(Object sender, QueueEventArgs e)
   at System.Workflow.ComponentModel.ActivityExecutorDelegateInfo`1.ActivityExecutorDelegateOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
   at System.Workflow.Runtime.Scheduler.Run()</StackTrace>
  <additionalInfo>
    <info name="MachineName" value="XXXXXX" />
    <info name="TimeStamp" value="8/03/2016 10:00:08 AM" />
    <info name="FullName" value="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <info name="AppDomainName" value="Laserfiche.Workflow.Service.exe" />
    <info name="ThreadIdentity" value="" />
    <info name="WindowsIdentity" value="XXX\svc_lf_app" />
  </additionalInfo>
  <InnerException>
    <ExceptionType>System.Net.Mail.SmtpException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
    <Message>Service not available, closing transmission channel. The server response was: Too many concurrent SMTP connections; please try again later.</Message>
    <Source>System</Source>
    <HelpLink />
    <Property name="StatusCode">ServiceNotAvailable</Property>
    <Property name="EmailSyncLevel">1</Property>
    <Property name="StartTime">8/03/2016 10:00:07 AM</Property>
    <Property name="EndTime">8/03/2016 10:00:08 AM</Property>
    <Property name="Duration">00:00:00.0469590</Property>
    <Property name="InstanceId">1dafe637-cec2-4239-83c7-54b2612aac41</Property>
    <Property name="ActivityName">Email_Email</Property>
    <Property name="Workflow">OCRExceptionHandler</Property>
    <Property name="ContextGuid">1dafe637-cec2-4239-83c7-54b2612aac41</Property>
    <Property name="TargetSite">Void GetConnection(System.Net.ServicePoint)</Property>
    <Property name="HResult">-2146233088</Property>
    <StackTrace>   at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
   at System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint)
   at System.Net.Mail.SmtpClient.GetConnection()
   at System.Net.Mail.SmtpClient.Send(MailMessage message)
   at Laserfiche.Workflow.Activities.Email.Runtime.EmailTaskExecutor.Execute(EmailTaskOptions options, TaskExecutorContext status)</StackTrace>
  </InnerException>
</Exception>
----------------------------------------

I can't seem to google anything and don't know where to start.

Is it possible that the service is reattempting to send lots of failed emails on a cycle and this is causing a flood exception sometimes (most times) but not when I do a test email send?

The mail header from the test email looks normal:

Return-path: <will.parker@xxxxxxx.com.au>
Envelope-to: will.parker@xxxxxxx.com.au
Delivery-date: Tue, 08 Mar 2016 21:01:45 +1100
Received: from 125.63.14.154.iipc.com.au ([125.63.14.154]:60929 helo=XXXXXX)
	by XXXXXX.hosting-service.net.au with esmtpsa (TLSv1:ECDHE-RSA-AES256-SHA:256)
	(Exim 4.86_1)
	(envelope-from <will.parker@XXXXXX.com.au>)
	id 1adESX-004AOK-OT
	for will.parker@XXXXXX.com.au; Tue, 08 Mar 2016 21:01:45 +1100
MIME-Version: 1.0
From: will.parker@XXXXXX.com.au
To: will.parker@XXXXXX.com.au
Date: 8 Mar 2016 20:01:47 +1000
Subject: A test email has been requested by XXX\lfadmin
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

The following e-mail server settings were tested.=0D=0ASMTP Serve=
r: XXXXXX.hosting-service.net.au=0D=0ASMTP Port: 587=0D=0AWindo=
ws Authentication: False=0D=0AUser Name: will.parker@XXXXXX.=
com.au=0D=0ASubject: test=0D=0ASSL (Secure Socket Layer): True=0D=0A

[XXX redactions are mine - not misconfiguration]

What do you suggest all?

Will

0 0

Replies

replied on March 9, 2016

The SMTP default port is 25. 
Are you using a pop account?
Does the mail server require authentication?
Have you checked your mail server log for the time of failure?
Are there others using the same port and SMTP server besides Workflow?
Have you checked the Exim Preset limit?
https://forums.cpanel.net/threads/421-too-many-concurrent-smtp-connections-please-try-again-later.109433/
If you have not, please change it to a larger limit then see what happens.

 

1 0
replied on March 9, 2016 Show version history

thanks Raymond!

Here is a funny thing.  When I first started to get these mail problems a few days ago I went into the configuration for the smtp server and the port was set to 25.  The error I was trying to solve was a time out and at that time nothing was able to send via that configured mail server - despite (to my knowledge) nothing having been changed from one day to the next after months of daily reporting.

I grabbed a screenie of the error I was looking at then...

the error being:

After changing the port to 587 I found that the tests and most reports resumed normal operation with the exception of the new workflow that caused me to post this thread.

Now it turns out that last night when it ran at 8pm the mail did get delivered (again without my changing any mail server settings as the other reports are coming through) but not until 4:37am!

So at least we know it keeps trying - there are no warnings associated with the running of the workflow at all.

Interesting.  maybe something has changed at the cPanel end - thank you for the link - I had originally thought to try and change the limit but couldn't see anything in WHM - I'll ssh in and look at the values now.

Can you comment on the information in that timeout error about timeout?

Best regards and thanks for the detailed assistance,
W

 

 

UPDATE - my smtp limit is the default 30 and cannot be increased as it is a shared server.

Not sure how to best handle it but couldn;t send any mail at all - even test mail - so I restarted the workflow service and subscriber service and tested again and it was all good - could it be that there was a queue of failed/stale messages that are on a retry cycle, or somehow the connections were not closed correctly and kept reattaching?  I don't know how this works but it seems that ther might be a way to limit the maximum connections that the workflow service makes outbound?

 

BTW Port 25 and 465 with ssl on or off simply time out as per the timeout error above.  Only 587 seems to work - and when it doesn't that is when it is reporting the too many connections...

0 0
replied on March 10, 2016

The timeout error means that the WF config cannot connect to the mail server during the configuration process.  This is separate and distinct from the issue you are getting. 

It's also safe to say that since it is currently working, that you configuration settings on the WF side are good.  The message you are getting with "too many concurrent connections" comes from the SMTP (Mail server side). 

You should still change the Exim preset limit especially since you are sharing the mail server with other users since you have no control over the number of emails that will be sent by them. 

1 0
replied on March 11, 2016

So, I restarted the workflow service and the problem has not recurred since.  I'll wait and see.  Maybe a runaway workflow that was generating emails had some kind of queue banked up and it got flushed with the service restart. 

 

I can't change the connections value on the server because it is a shared host - I'd have to change provider - but that's ok, I'll wait and see about that if and when it returns.  I have more workflows reporting than before so it will certainly reoccur unless it was something to do with rogue workflows that have since been killed and/or fixed.

Thanks for your help :)

W

0 0
replied on March 8, 2016 Show version history

What kind of mail server are you using?
Are you using a pop account?
Does the mail server require authentication?
Are you using the default SMTP port?

0 0
replied on March 8, 2016 Show version history

Hi, it is an Exim server, uses authentication, smtp on port 587, ssl.

if I leave the port setting blank what port des it default to?

It went ahead and worked for all the other automated emails last night - only that one, which as I said struck me as weird because the test dialogue worked immediately after it failed without changing any config...

i wonder if I should turn off ssl?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.