Typical reason for EndWrite failure, SocketException

Hi,

Just curious what are some typical reasons one might see an EndWrite/SocketException error, was seen using pop3 java email implementation in production. We don’t see it often, seems removing an email from the inbox we were reading might have solved it.

Exception: EndWrite failure ERROR_DETAILS: com.aspose.email.AsposeException: EndWrite failure
at com.aspose.email.lw.a(SourceFile:86)
at com.aspose.email.Pop3Client.fetchMessage(SourceFile:1158)
at com.comcast.sa.esl.emailinbound.services.Pop3EmailClient.fetchMessageByUuid(Pop3EmailClient.java:95)
at com.comcast.sa.esl.emailinbound.services.EmailInboundService.process(EmailInboundService.java:98)
at com.comcast.sa.esl.emailinbound.services.EmailInboundService.processEmailInboundScheduled(EmailInboundService.java:64)
at com.comcast.sa.esl.emailinbound.services.EmailInboundService$$FastClassBySpringCGLIB$$f20c15a4.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
at com.comcast.sa.esl.emailinbound.services.EmailInboundService$$EnhancerBySpringCGLIB$$361ff3df.processEmailInboundScheduled()
at com.comcast.sa.esl.emailinbound.services.ScheduleTask.processEmailInbound(ScheduleTask.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)
at net.javacrumbs.shedlock.core.DefaultLockingTaskExecutor.executeWithLock(DefaultLockingTaskExecutor.java:42)
at net.javacrumbs.shedlock.core.DefaultLockManager.executeWithLock(DefaultLockManager.java:51)
at net.javacrumbs.shedlock.core.LockableRunnable.run(LockableRunnable.java:35)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)Caused by: com.aspose.email.system.exceptions.IOException: EndWrite failure at com.aspose.email.internal.q.f.endWrite(Unknown Source)
at com.aspose.email.internal.co.ak.d(Unknown Source)
at com.aspose.email.internal.co.ak.c(Unknown Source)
at com.aspose.email.internal.co.ao.invoke(Unknown Source)
at com.aspose.email.internal.q.g$b.b(Unknown Source)
at com.aspose.email.internal.q.g$b.a(Unknown Source)
at com.aspose.email.internal.q.g$c.d(Unknown Source)
at com.aspose.email.internal.q.j.a(Unknown Source)
at com.aspose.email.internal.q.k.a(Unknown Source)
at com.aspose.email.internal.ck.c.a(Unknown Source)
at com.aspose.email.internal.af.m.run(SourceFile:66)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266) …
3 common frames omittedCaused by: com.aspose.email.system.exceptions.SocketException: An existing connection was forcibly closed by the remote host.
at com.aspose.email.internal.q.g.d(Unknown Source)
at com.aspose.email.internal.q.g.b(Unknown Source) … 10 common frames omitted

thanks,
Mike

@mlittle4444,
Thank you for the request. I have logged the issue in our tracking system with ID EMAILJAVA-34855 to investigate it. I will inform you about the typical reasons for this exception later.

@mlittle4444,
Could you please let us know which version of Aspose.Email you are using?
Please check the issue with the latest version of Aspose.Email.

17.4.0. It appears it doesn’t happen with the 21.2.1 which we be deploying out in about a month. I was just curious, so that if we see it again I know what to look at, or we can write our logic in a mannger that handles things better. But we have situation under control, seemingly removing one of the emails from the inbox got us past the problem. We passed the same through our service that uses 21.2.1 in our test environment and the email was processed fine.

thanks

@mlittle4444,
Thank you for the additional information. I will inform you about possible reasons for this exception as soon as our development team investigates it.

Thank you. I guess the one question that I am thinking is of concern has anyone ever seen a scenario where one particular email within a folder could cause other email messages in that same folder not to be read? So, fetchMessage by uuid fails for all the emails in the folder.

@mlittle4444,
I will answer you for an additional question later as well.

@mlittle4444,
Our development team has not encountered this issue before. We need to know which mail server is used on your end. We will perform additional testing. We also need any additional information you can provide to reproduce the issue.

Regarding the issue you mentioned, we can suggest using a new implementation of SocketsLayer to connect the server. Aspose.Email 21.3 uses the new SocketsLayer by default.

Thank you for following up. We cannot recreate the issue, so I am thinking we won’t go down the troubleshooting path unless it happens again and we figure out how to recreate the issue.

We will upgrade to 21.3. Thank you.