none
The I/O operation has been aborted because of either a thread exit or an application RRS feed

  • Question

  • hello,

     

    I got below error, while rendering file (by File Stream) by using WCF services. We have used TCP Binding to achieve this.

    Error log from Event Viewer:
    <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier><Description>Throwing an exception.</Description><AppDomain>AVEVA.NET.Job.Server.exe</AppDomain><Exception><ExceptionType>System.ServiceModel.CommunicationException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:30.0000001'.</Message><StackTrace> at System.ServiceModel.Channels.SocketConnection.BeginReadCore(Int32 offset, Int32 size, TimeSpan timeout, WaitCallback callback, Object state)
    at System.ServiceModel.Channels.SocketConnection.CloseAsyncAndLinger()
    at System.ServiceModel.Channels.SocketConnection.Close(TimeSpan timeout, Boolean asyncAndLinger)
    at System.ServiceModel.Channels.BufferedConnection.Close(TimeSpan timeout, Boolean asyncAndLinger)
    at System.ServiceModel.Channels.CommunicationPool`2.EndpointConnectionPool.CloseIdleConnection(TItem connection, TimeSpan timeout)
    at System.ServiceModel.Channels.CommunicationPool`2.EndpointConnectionPool.TakeConnection(TimeSpan timeout)
    at System.ServiceModel.Channels.ConnectionPoolHelper.TakeConnection(TimeSpan timeout)
    at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
    at System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
    at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
    at AVEVA.NET.Job.Plugin.FileStore.FileStore.IFileStore.Remove(String registrationToken, String locator)
    at AVEVA.NET.Job.Plugin.FileStore.RemoveFileHandler.Process(String sessionToken, Int32 handle)
    at AVEVA.NET.Job.Server.ServiceHost.ProcessJobs(String sessionToken)
    at AVEVA.NET.Job.Server.ServiceHost.ProcessSource(SourceConfigurationElement sourceConfigurationElement)
    at AVEVA.NET.Job.Server.ServiceHost.ProcessSources()
    at AVEVA.NET.Job.Server.ServiceHost.TimerCallback(Object state)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.TimerQueueTimer.CallCallback()
    at System.Threading.TimerQueueTimer.Fire()
    at System.Threading.TimerQueue.FireNextTimers()
    </StackTrace><ExceptionString>System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:30.0000001'. ---&gt; System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
    at System.ServiceModel.Channels.SocketConnection.BeginReadCore(Int32 offset, Int32 size, TimeSpan timeout, WaitCallback callback, Object state)
    — End of inner exception stack trace ---</ExceptionString><InnerException><ExceptionType>System.Net.Sockets.SocketException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>An existing connection was forcibly closed by the remote host</Message><StackTrace> at System.ServiceModel.Channels.SocketConnection.BeginReadCore(Int32 offset, Int32 size, TimeSpan timeout, WaitCallback callback, Object state)</StackTrace><ExceptionString>System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host
    at System.ServiceModel.Channels.SocketConnection.BeginReadCore(Int32 offset, Int32 size, TimeSpan timeout, WaitCallback callback, Object state)</ExceptionString><NativeErrorCode>2746</NativeErrorCode></InnerException></Exception></TraceRecord>

     The  error looked like a like generic one and I have enabled the Stack Trace for WCF services to get the errors into a log file. Since Job server uses File Store services for getting the file, I have seen that the error that we have encountered is below.

    There is already a listener on IP endpoint 0.0.0.0:7101. This could happen if there is another application already listening on this endpoint or if you have multiple service endpoints in your service host with the same IP endpoint but with incompatible binding configurations.

    So, I have updated NETTCP endpoint with

    “portSharingEnabled="true"

    in the app.config of the File Store services. The above error stopped occurring. But, I got below error in the log file:

    The I/O operation has been aborted because of either a thread exit or an application

    I suspected if there is a fire wall issue, or permission issue for net tcp protocol and so I have added a rule for NET TCP protocol to have read/write permission on all windows process. This also did not yield any results.

    I did more research and found that this issue is more common whenever we use the NETTCP binding for WCF services and there were attempts made by Microsoft to fix the issue – and they released a hot fix for .NET Framework 3.5, but even after that the users have been facing the same issue in some specific contexts. Please find below references, where there are users who did not a find a proper fix for it and such error could be ignored as of now.

    Its mentioned in some of the Microsoft forums that there is a challenge handling such issue, but not quite sure, if this got a fix from Microsoft. 

    Can anyone please kindly suggest if this is an existing issue with Service.Model of Microsoft dlls OR 

    If there is any other alternate way to fix.

    Thank you

    Laxmi
    • Edited by Laxmi Palle Wednesday, October 26, 2016 1:56 PM
    Wednesday, October 26, 2016 1:54 PM

All replies

  • Hi Laxmi,

    How did you host your WCF Service? Did you host it in IIS or Windows Service?

    To check whether it is related with port sharing, I suggest you change the port for wcf Service and make a test again.

    To check whether it is related with read/write permission, I suggest you add a simple method which only returns a string like “Hello World” to check whether this issue still exist.

    If it works for this simple method, could you debug your wcf method to check whether you will get any exception? If it is related with WCF permission and you host your wcf service in iis, I think you need to assign suitable permission for this service, and I suggest you refer the link below:

    # IIS AppPoolIdentity and file system write access permissions

    http://stackoverflow.com/questions/5437723/iis-apppoolidentity-and-file-system-write-access-permissions

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, October 27, 2016 8:13 AM