wpurrer

An existing connection was forcibly closed by the remote host] & Webserver

Discussion created by wpurrer on Mar 28, 2012
Latest reply on Mar 29, 2012 by mhamel

ar Vcampus 

 

Right after I solved the issue with impersonation (thanks to justin) ...http://vcampus.osisoft.com/discussion_hall/development_with_osisoft_sdks/f/40/t/2907.aspx) I stumpled over the next issue:

 

I have the following issue:

 

depending on which user I logon to my website, i get the exception below:

 

 

 

Architecture:

 

2 Servers: (all in the same domain)

 

a) PI + AF Server (all lastest Versions on a Windows 2008 R2)
AF - Server 2.4.0.4431 + PI 2010 SP1

 

B) Webserver (all lastest Versions on a Windows 2008 R2)
(AF - Client 2.4.0.4431)

 

2 Users:

 

wolfgang-user
wolfgang-adm

 

on the PI+AF Server both User have Admin Rights
on the Web Server only  the adm has admin rights:

 

when i log on with the wolfgang-adm everything works,
when i log on with the other one, i get the following exception:
(no matter local,...

 

 

 

in one of the following statements  in (   DowntimeDeliveryChannel.EventInterface.Init() )( i can't narrow it down .. but it think it is the 3rd one)

 

myPiSystems = new PISystems();
myPiSystem = myPiSystems.DefaultPISystem;
myDatabase = myPiSystem.Databases["PIMS"];
myTemplate = myDatabase.ElementTemplates["Downtime"];

 

 

 

The interesting thing is that after a couple of minutes the isse was gone .. when i restarted the IIS the issue reappread.

 

 


Server Error in '/downtime' Application.


An existing connection was forcibly closed by the remote host

            Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.            

            Exception Details: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

            Source Error:

           

                      An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.                  

           
            Stack Trace:

           

                     
[SocketException (0x2746): An existing connection was forcibly closed by the remote host]
   System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing) +276

[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:05:00'.]
   System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing) +16433296
   System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout) +132
   System.ServiceModel.Channels.ConnectionStream.Read(Byte[] buffer, Int32 offset, Int32 count) +66
   System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count) +60
   System.Net.Security.NegotiateStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) +64
   System.Net.Security.NegotiateStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) +54
   System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) +379

[IOException: The read operation failed, see inner exception.]
   System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) +659
   System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int32 count) +170
   System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout) +187

[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:05:00'.]
   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +4727747
   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +1725
   System.ServiceModel.ICommunicationObject.Open(TimeSpan timeout) +0
   System.ServiceModel.ClientBase`1.System.ServiceModel.ICommunicationObject.Open(TimeSpan timeout) +139
   OSIsoft.AF.Support.AFProxy.Reconnect(Boolean autoPrompt, Boolean raiseEvents, AFConnectionProtocol protocol, String host, Int32 port, String accountName, TimeSpan timeOut) in c:\Builds\AF\AF 2.4\Sources\SDK\Support\AFProxy.cs:264

[CommunicationException: Cannot connect to server 'LNFPIMSHIST'.]
   OSIsoft.AF.Support.AFProxy.Reconnect(AFCollectiveMember member, Boolean autoPrompt, Boolean raiseEvents, AFConnectionPreference preference) in c:\Builds\AF\AF 2.4\Sources\SDK\Support\AFProxy.cs:244
   OSIsoft.AF.Support.AFProxy.Reconnect() in c:\Builds\AF\AF 2.4\Sources\SDK\Support\AFProxy.cs:150
   OSIsoft.AF.Support.AFSerialProxy.GetDatabaseList(DateTime sinceTime, AFSortField sortField, AFSortOrder sortOrder, Int32 maxCount, Boolean& fullUpdate, DateTime& lastUpdateTime) in c:\Builds\AF\AF 2.4\Sources\SDK\Support\AFProxy.Remote.cs:2880
   OSIsoft.AF.AFDatabases.LoadObjects(Int32 page, Boolean fullReload) in c:\Builds\AF\AF 2.4\Sources\SDK\AFDatabases.cs:169
   OSIsoft.AF.AFCollection`1.Load(Boolean force) in c:\Builds\AF\AF 2.4\Sources\SDK\AFCollection.cs:2010
   OSIsoft.AF.AFNamedCollection`1.GetItemTyped(String name, Boolean returnDeletedItems, Boolean handlePathInName, Boolean inLoad) in c:\Builds\AF\AF 2.4\Sources\SDK\AFCollection.cs:4056
   OSIsoft.AF.AFNamedCollection`1.get_Item(String name) in c:\Builds\AF\AF 2.4\Sources\SDK\AFCollection.cs:3998
   DowntimeDeliveryChannel.EventInterface..ctor() +342
   DowntimeDeliveryChannel.EventInterface.Init() +168
   _Default.Page_Load(Object sender, EventArgs e) +3068
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064

Regards

 

Wolfgang

Outcomes