Emails stop sending

182 views
Skip to first unread message

Simon Goldschmidt

unread,
Aug 15, 2015, 6:20:08 AM8/15/15
to Lucee
In the last week, we have a server that has been giving up on sending emails. It'll send for an hour or two, then pile up emails in the WEB-INF/lucee/remote-client/open directory. A restart of the Tomcat service will clear the backlog. Neither catalina nor mail logs give any indication of anything happening.

We use Windows Server 2012 R2, Java 8, Tomcat 7 and Lucee 4.5.0.23. This behaviour appeared around the time we upgraded from 4.5.0.22.

Any suggestions what might cause this backlog and what we might be able to change to prevent it?

Thanks,
Simon

Simon Goldschmidt

unread,
Aug 15, 2015, 4:45:11 PM8/15/15
to Lucee
I noticed that before each occurrence, there is an email that fails to send because a file attachment is not found. I'm convinced this file attachment is being created because the code that creates it hasn't changed and has been working. It sounds to me like Andrew's "File upload issue" at https://groups.google.com/forum/#!topic/lucee/B06_IVEVieg

In the remoteclient.log file I get the line java.io.FileNotFoundException: C:\Website\WEB-INF\lucee\temp\cc743.dat (The system cannot find the file specified)

The code boils down to:
  <cfset filename="#gettempdirectory()#cc#randrange(100,999)#.dat">
  <cffile action="copy" source="C:\Logs\cc.dat" destination="#filename#">
  <cfmail to="#to#" from="#from#" subject="#subject#">
  <cfmailparam file="#filename#" remove="true">
  See data file attached
  </cfmail>
and the file C:\Logs\cc.dat does exist

Andrew Dixon

unread,
Aug 15, 2015, 5:51:29 PM8/15/15
to lu...@googlegroups.com
Hi Simon,

Is the email generated by the client uploading a file via the browser then?

Kind regards,

Andrew

--
See Lucee at CFCamp Oct 22 & 23 2015 @ Munich Airport, Germany - Get your ticket NOW - http://www.cfcamp.org/
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/342f3c07-c640-42b1-9d5c-cd3dd3a57f9b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Igal @ Lucee.org

unread,
Aug 15, 2015, 8:46:42 PM8/15/15
to lu...@googlegroups.com
@Simon --

the next time this happens try to send a test mail with <cfmail ... async="false">.  see if that email goes through while emails that are sent asynchronously (default) do not.

if the synchronous email fails please post the exception and stack trace.

if it goes through, then possibly the failed email is stuck there and causes the spooler to hang.  if that's the case, look in {your-app}/WEB-INF/lucee/remote-client/open and delete the .tsk files (or better yet, move them to a different folder in case we want to inspect them later), then try to send an email again.

the task system has much room for improvement but that's another issue...

Igal Sapir
Lucee Core Developer
Lucee.org

Simon Goldschmidt

unread,
Aug 15, 2015, 11:01:09 PM8/15/15
to Lucee
@Andrew: file is system generated in a logging directory, then copied to the temp directory before attaching to an email.... I did some tests and the file don't appear to be the issue.

@Igal: I removed the spool enable option in the administrator... trust this is the same thing as adding the async="false" parameter. I'll monitor the logs.

I noticed the errors in the attached thread.log file, followed by a repeat of the "could not stop the thread" and "Thread.stop(Throwable) is not supported by this JVM" messages repeated 10 times each in the space of a few seconds. The code creating this error is below, with the error being called on the line with the cfftp "open":
  <cftry>
  <cfftp connection="cslock" action="open" server="#hostname#" username="#username#" password="#password#" timeout="10">
  <cfif cfftp.succeeded>
    <cfftp connection="cslock" action="putfile" localfile="C:\Logs\cc.dat" remotefile="cc.dat" failifexists="no">
  <cfelse>
    <cfthrow>
  </cfif>
  <cfcatch>
    <cffile....>
    <cfmail....>
  </cfcatch>
  </cftry>

The file copying and attaching to an email described previously are done in the <cfcatch> tags. Would this be an explanation for the mail spooler stopping?

Simon


 
thread.log

Simon Goldschmidt

unread,
Aug 15, 2015, 11:04:51 PM8/15/15
to Lucee
Sorry... that was the requesttimeout.log file, not the thread.log file

Simon Goldschmidt

unread,
Aug 16, 2015, 2:54:56 AM8/16/15
to Lucee
Without mail spooling, I'm getting a timeout error when emails in the <cfcatch> block when the FTP process fails. The error occurs on the </cfmail> line.

"ERROR","ajp-bio-8009-exec-4","08/16/2015","15:42:07","",";request (path: C:\Website\tennis\interfaces\lock.cfm:5) has run into a timeout (120 seconds) and has been stopped.;request (path: C:\Website\tennis\interfaces\lock.cfm:5) has run into a timeout (120 seconds) and has been stopped.
at java.lang.Object.wait(Native Method):-2
at java.lang.Object.wait(Object.java:502):502
at lucee.commons.lang.lock.KeyLock.start(KeyLock.java:50):50
at lucee.runtime.net.proxy.Proxy.start(Proxy.java:40):40
at lucee.runtime.net.proxy.Proxy.start(Proxy.java:34):34
at lucee.runtime.net.smtp.SMTPClient._send(SMTPClient.java:668):668
at lucee.runtime.net.smtp.SMTPClient.send(SMTPClient.java:658):658
at lucee.runtime.tag.Mail.doEndTag(Mail.java:533):533
at tennis.interfaces.lock_cfm$cf.call(C:\Website\tennis\interfaces\lock.cfm:57):57
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:921):921
at lucee.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:56):56
at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:36):36
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2257):2257
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2224):2224
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:456):456
at lucee.loader.servlet.CFMLServlet.service(Unknown Source):-1
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727):727
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303):303
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208):208
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52):52
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241):241
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208):208
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220):220
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122):122
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504):504
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170):170
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103):103
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116):116
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421):421
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190):190
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611):611
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314):314
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142):1142
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617):617
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61):61
at java.lang.Thread.run(Thread.java:745):745
"

Simon Goldschmidt

unread,
Aug 16, 2015, 3:10:42 AM8/16/15
to Lucee
Looks to me like CFFTP doesn't manage the timeout correctly when a host is not online and this breaks any subsequent use of CFMAIL, which throws exception like the following:

"ERROR","ajp-bio-8009-exec-4","08/16/2015","16:59:37","",";request (path: C:\Website\tennis\account.cfm (C:\Website\tennis\include\je\receipt.txt):6) has run into a timeout (50 seconds) and has been stopped.;request (path: C:\Website\tennis\account.cfm (C:\Website\tennis\include\je\receipt.txt):6) has run into a timeout (50 seconds) and has been stopped.
at java.lang.Object.wait(Native Method):-2
at java.lang.Object.wait(Object.java:502):502
at lucee.commons.lang.lock.KeyLock.start(KeyLock.java:50):50
at lucee.runtime.net.proxy.Proxy.start(Proxy.java:40):40
at lucee.runtime.net.proxy.Proxy.start(Proxy.java:34):34
at lucee.runtime.net.smtp.SMTPClient._send(SMTPClient.java:668):668
at lucee.runtime.net.smtp.SMTPClient.send(SMTPClient.java:658):658
at lucee.runtime.tag.Mail.doEndTag(Mail.java:533):533
at tennis.include.je.receipt_txt$cf.call(C:\Website\tennis\include\je\receipt.txt:39):39
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:921):921
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:854):854
at tennis.admin.account_cfm$cf.call(C:\Website\tennis\account.cfm:212):212

Simon Goldschmidt

unread,
Aug 19, 2015, 6:19:55 PM8/19/15
to Lucee
If you identify that emails are stacking up in {your-app}/WEB-INF/lucee/remote-client/open, is there a way to start up the spooler (if that's what you need to do to get the emails to send) without restarting the Lucee server?
Simon

Reply all
Reply to author
Forward
0 new messages