IOException preventing mail from 'sending'

Aug 27, 2010 at 6:20 PM

I am seeing an error in the logs and I am not sure where to start looking for problems.

2010-08-27 11:33:31,499 [3] WARN  [2] - IOException received in Processor.DATA while reading message.  Closing connection.  Message: Unable to read data from the transport connection: A non-blocking socket operation could not be completed immediately.

This is what I am seeing on the client program side:

2010-08-27 12:32:12,693 [main] ERROR com.nprise.mail.SimpleMailer  - SimpleMailer failed to send VirtualScout is starting up to lgaschot@drillinginfo.com
javax.mail.MessagingException: Can't send command to SMTP host;
  nested exception is:
    java.net.SocketException: Software caused connection abort: socket write error
    at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1564)
    at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1551)
    at com.sun.mail.smtp.SMTPTransport.close(SMTPTransport.java:696)
    at javax.mail.Transport.send0(Transport.java:191)
    at javax.mail.Transport.send(Transport.java:118)
    at com.nprise.mail.DefaultMimeMessageUtil.send(DefaultMimeMessageUtil.java:27)
    at com.nprise.mail.SimpleMailer.basicSendMessage(SimpleMailer.java:235)
    at com.nprise.mail.SimpleMailer.sendTextMessage(SimpleMailer.java:149)
    at com.nprise.mail.SimpleMailer.sendTextMessage(SimpleMailer.java:103)
    at com.drillinginfo.loader.email.StartupEmailValidator.isReady(StartupEmailValidator.java:48)
    at com.drillinginfo.loader.app.ServicesAreLive.isValid(ServicesAreLive.java:22)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutProvider.get(VirtualScoutProvider.java:29)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutOptionBuilder.<init>(VirtualScoutOptionBuilder.java:24)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutOptionBuilder$$FastClassByGuice$$cd9981da.newInstance(<generated>)
    at com.google.inject.internal.cglib.reflect.FastConstructor.newInstance(FastConstructor.java:40)
    at com.google.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
    at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
    at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758)
    at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
    at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754)
    at com.google.inject.InjectorImpl.getInstance(InjectorImpl.java:793)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutAppCreator.createApplication(VirtualScoutAppCreator.java:48)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutApp.createVirtualScout(VirtualScoutApp.java:95)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutApp.main(VirtualScoutApp.java:31)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.simontuffs.onejar.Boot.run(Boot.java:306)
    at com.simontuffs.onejar.Boot.main(Boot.java:159)
Caused by: java.net.SocketException: Software caused connection abort: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    at com.sun.mail.util.TraceOutputStream.write(TraceOutputStream.java:114)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
    at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1562)
    ... 30 more
javax.mail.MessagingException: Can't send command to SMTP host;
  nested exception is:
    java.net.SocketException: Software caused connection abort: socket write error
    at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1564)
    at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1551)
    at com.sun.mail.smtp.SMTPTransport.close(SMTPTransport.java:696)
    at javax.mail.Transport.send0(Transport.java:191)
    at javax.mail.Transport.send(Transport.java:118)
    at com.nprise.mail.DefaultMimeMessageUtil.send(DefaultMimeMessageUtil.java:27)
    at com.nprise.mail.SimpleMailer.basicSendMessage(SimpleMailer.java:235)
    at com.nprise.mail.SimpleMailer.sendTextMessage(SimpleMailer.java:149)
    at com.nprise.mail.SimpleMailer.sendTextMessage(SimpleMailer.java:103)
    at com.drillinginfo.loader.email.StartupEmailValidator.isReady(StartupEmailValidator.java:48)
    at com.drillinginfo.loader.app.ServicesAreLive.isValid(ServicesAreLive.java:22)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutProvider.get(VirtualScoutProvider.java:29)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutOptionBuilder.<init>(VirtualScoutOptionBuilder.java:24)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutOptionBuilder$$FastClassByGuice$$cd9981da.newInstance(<generated>)
    at com.google.inject.internal.cglib.reflect.FastConstructor.newInstance(FastConstructor.java:40)
    at com.google.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
    at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
    at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758)
    at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
    at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754)
    at com.google.inject.InjectorImpl.getInstance(InjectorImpl.java:793)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutAppCreator.createApplication(VirtualScoutAppCreator.java:48)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutApp.createVirtualScout(VirtualScoutApp.java:95)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutApp.main(VirtualScoutApp.java:31)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.simontuffs.onejar.Boot.run(Boot.java:306)
    at com.simontuffs.onejar.Boot.main(Boot.java:159)
Caused by: java.net.SocketException: Software caused connection abort: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    at com.sun.mail.util.TraceOutputStream.write(TraceOutputStream.java:114)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
    at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1562)
    ... 30 more
java.net.SocketException: Software caused connection abort: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    at com.sun.mail.util.TraceOutputStream.write(TraceOutputStream.java:114)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
    at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1562)
    at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1551)
    at com.sun.mail.smtp.SMTPTransport.close(SMTPTransport.java:696)
    at javax.mail.Transport.send0(Transport.java:191)
    at javax.mail.Transport.send(Transport.java:118)
    at com.nprise.mail.DefaultMimeMessageUtil.send(DefaultMimeMessageUtil.java:27)
    at com.nprise.mail.SimpleMailer.basicSendMessage(SimpleMailer.java:235)
    at com.nprise.mail.SimpleMailer.sendTextMessage(SimpleMailer.java:149)
    at com.nprise.mail.SimpleMailer.sendTextMessage(SimpleMailer.java:103)
    at com.drillinginfo.loader.email.StartupEmailValidator.isReady(StartupEmailValidator.java:48)
    at com.drillinginfo.loader.app.ServicesAreLive.isValid(ServicesAreLive.java:22)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutProvider.get(VirtualScoutProvider.java:29)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutOptionBuilder.<init>(VirtualScoutOptionBuilder.java:24)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutOptionBuilder$$FastClassByGuice$$cd9981da.newInstance(<generated>)
    at com.google.inject.internal.cglib.reflect.FastConstructor.newInstance(FastConstructor.java:40)
    at com.google.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
    at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
    at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758)
    at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
    at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754)
    at com.google.inject.InjectorImpl.getInstance(InjectorImpl.java:793)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutAppCreator.createApplication(VirtualScoutAppCreator.java:48)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutApp.createVirtualScout(VirtualScoutApp.java:95)
    at com.drillinginfo.loader.virtualscout.app.VirtualScoutApp.main(VirtualScoutApp.java:31)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.simontuffs.onejar.Boot.run(Boot.java:306)
    at com.simontuffs.onejar.Boot.main(Boot.java:159)

 

Nov 11, 2011 at 9:45 PM

The problem is in Processor.DATA(). The filename is a timestamp. If lots of mails come in at the same time, different threads will try to write to the same file (because they have the same timestamp).

Try adding a GUID to the filename. Remember to update the MessageEntry class also.

Jan 14, 2012 at 2:12 PM

I had the same problem but when I changes the permissions of the folder where all the files where contained the problem dissapperard.

Coordinator
May 4, 2012 at 4:09 AM

Fixed in latest commit.