IPC error when accessing Tree

Bug reports.
chrisgeorge
Posts: 49
Joined: Thu Aug 20, 2009 11:28 am

IPC error when accessing Tree

Post by chrisgeorge » Wed May 19, 2010 11:19 am

We're currently running 2.1.3 but I'm evaluating 2.3.1 at the moment with a view to upgrading (to fix some issues we're having).

However, I've started getting the errors when trying to access the object explorer tree in SQL Server Management studio that I never used to get in 2.1.3.

They do not happen every time, and it is not easy to reproduce, but I've included the stack trace below. I wonder if you've changed anything in the remoting between 2.1 and 2.3 that might lead to differing behaviour?

I will try to create a reproducible example at some point.

Cheers

Chris

System.Runtime.Remoting.RemotingException : An error occurred while processing the request on the server: System.Runtime.Remoting.RemotingException: Tcp channel protocol violation: expecting preamble.
at System.Runtime.Remoting.Channels.Tcp.TcpSocketHandler.ReadAndMatchPreamble()
at System.Runtime.Remoting.Channels.Tcp.TcpSocketHandler.ReadVersionAndOperation(UInt16& operation)
at System.Runtime.Remoting.Channels.Ipc.IpcServerHandler.ReadHeaders()
at System.Runtime.Remoting.Channels.Ipc.IpcServerTransportSink.ServiceRequest(Object state)
at System.Runtime.Remoting.Channels.SocketHandler.ProcessRequestNow()

Server stack trace:
at System.Runtime.Remoting.Channels.Ipc.IpcServerHandler.ReadToEndOfHeaders(BaseTransportHeaders headers)
at System.Runtime.Remoting.Channels.Ipc.IpcClientHandler.ReadHeaders()
at System.Runtime.Remoting.Channels.Ipc.IpcClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Ranorex.Libs.WinForms.IControlProxy.get_Handle()
at Ranorex.Plugin.RemoteCommonControls.RemoteControlProxy.Ranorex.Libs.WinForms.IControlProxy.get_Handle()
at Ranorex.Plugin.WinFormsFlavorElement.GetRuntimeTokenValues()
at Ranorex.Core.FlavorElement.get_Token()
at Ranorex.Core.FlavorElement.IsEqual(FlavorElement flavorElem)
at Ranorex.Core.Element.IsEqual(Element elem)
at Ranorex.Core.Element.Equals(Object obj)
at System.Collections.Generic.ObjectEqualityComparer`1.IndexOf(T[] array, T value, Int32 startIndex, Int32 count)
at System.Array.IndexOf[T](T[] array, T value, Int32 startIndex, Int32 count)
at System.Collections.Generic.List`1.IndexOf(T item)
at Ranorex.Core.ElementEngine.ApplyGlueRules(Element element, GlueRuleExecutionState state)
at Ranorex.Core.ElementEngine.ApplyGlueRules(Element element)
at Ranorex.Core.Element.GetChildren(CacheSession session)
at Ranorex.Core.Element.get_Children()
at Ranorex.Core.RxPath.collectAxis(LocationStep step, Axis optimizedAxis, Element self, IList`1 elements, Boolean quitOnFirstGoodNode)
at Ranorex.Core.RxPath.ApplyInternal(RxPath path, Element startElement, IDataProvider dataProvider, Duration timeout, Boolean findSingle)
at Ranorex.Core.RxPath.Apply(Element startElement, Duration timeout, Boolean findSingle)
at Ranorex.Core.Element.TryFindSingleInternal(RxPath path, Duration timeout, Element& foundElement)
at Ranorex.Core.Repository.RepoGenBaseFolder.TryGetFolderElement(Boolean& isCached, Element& folderElement)
at Ranorex.Core.Repository.RepoItemInfo.CreateAdapter[T](Boolean throwException)
at RedGate.SQLSourceControl.Testing.GuiTests.SSMS.Repository.SSMSRepoFolders.MainWindowAppFolder.get_TreeObjectExplorerTree1() in C:\Work\SQLSourceControl\Trunk\Source\Testing\GuiTests\SSMS\Repository\SSMS.Repository.cs:line 498
at RedGate.SQLSourceControl.Testing.GuiTests.SSMS.SsmsUiBase.GetObjectExplorerTree() in C:\Work\SQLSourceControl\Trunk\Source\Testing\GuiTests\SSMS\SsmsUiBase.cs:line 683
at RedGate.SQLSourceControl.Testing.GuiTests.SSMS.SsmsUiBase.GetObjectExplorerTreeOutline() in C:\Work\SQLSourceControl\Trunk\Source\Testing\GuiTests\SSMS\SsmsUiBase.cs:line 699
at RedGate.SQLSourceControl.Testing.GuiTests.SSMS.SsmsUiBase.GetObjectExplorerTreeItem(List`1 path) in C:\Work\SQLSourceControl\Trunk\Source\Testing\GuiTests\SSMS\SsmsUiBase.cs:line 669
at RedGate.SQLSourceControl.Testing.GuiTests.GreenIconTests.MakeImageComparisonAtPath(List`1 list, Bitmap refBitmapImage) in C:\Work\SQLSourceControl\Trunk\Source\Testing\GuiTests\GreenIconTests.cs:line 1028
at RedGate.SQLSourceControl.Testing.GuiTests.GreenIconTests.ConnectToSameInstanceMultipleTimesGreenIcon() in C:\Work\SQLSourceControl\Trunk\Source\Testing\GuiTests\GreenIconTests.cs:line 678
--TearDown
Chris George
Test Engineer

Red Gate Software Ltd
Cambridge

chrisgeorge
Posts: 49
Joined: Thu Aug 20, 2009 11:28 am

Re: IPC error when accessing Tree

Post by chrisgeorge » Thu May 20, 2010 12:58 pm

hmm... might have been a red-herring I'm afraid. I rebooted my machine and it's all working fine at the moment...

Chris
Chris George
Test Engineer

Red Gate Software Ltd
Cambridge

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: IPC error when accessing Tree

Post by Support Team » Thu May 20, 2010 1:16 pm

Thanks for reporting this issue!

Did you get this error everytime you access the application or just once in a while?

It seems that communication with the Ranorex 32/64 bit bridge fails and the exception is not correctly handled. We'll fix that with the next maintenance release. Anyway, I don't know why this exception is thrown at all, i.e. why communication with the bit bridge fails :?

Regards,
Alex
Ranorex Support Team

chrisgeorge
Posts: 49
Joined: Thu Aug 20, 2009 11:28 am

Re: IPC error when accessing Tree

Post by chrisgeorge » Thu May 20, 2010 2:34 pm

further to my last email, it's started happening again... I don't know what's triggering it, but it isn't every time. At the moment it's intermittent.

System.Runtime.Remoting.RemotingException : Failed to write to an IPC Port: The pipe is being closed.

Server stack trace:
at System.Runtime.Remoting.Channels.Ipc.IpcPort.Write(Byte[] data, Int32 offset, Int32 size)
at System.Runtime.Remoting.Channels.Ipc.PipeStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.Runtime.Remoting.Channels.ChunkedMemoryStream.WriteTo(Stream stream)
at System.Runtime.Remoting.Channels.Ipc.IpcClientHandler.SendRequest(IMessage msg, ITransportHeaders headers, Stream contentStream)
at System.Runtime.Remoting.Channels.Ipc.IpcClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Ranorex.Plugin.ICommonControls.GetControlProxy(IntPtr hwnd, IList`1 assemblyNamesAndPaths)
at Ranorex.Plugin.RemoteCommonControls.Ranorex.Plugin.ICommonControls.GetControlProxy(IntPtr hwnd, IList`1 assemblyNamesAndPaths)
at Ranorex.Plugin.RemoteCommonControls.RemoteControlProxy.UpdateRemoteInterface()
at Ranorex.Plugin.RemoteCommonControls.RemoteControlProxy.Ranorex.Libs.WinForms.IControlProxy.get_Handle()
at Ranorex.Plugin.WinFormsFlavorElement.GetRuntimeTokenValues()
at Ranorex.Core.FlavorElement.get_Token()
at Ranorex.Core.FlavorElement.IsEqual(FlavorElement flavorElem)
at Ranorex.Core.Element.IsEqual(Element elem)
at Ranorex.Core.Element.Equals(Object obj)
at System.Collections.Generic.ObjectEqualityComparer`1.IndexOf(T[] array, T value, Int32 startIndex, Int32 count)
at System.Array.IndexOf[T](T[] array, T value, Int32 startIndex, Int32 count)
at System.Collections.Generic.List`1.IndexOf(T item)
at Ranorex.Core.ElementEngine.ApplyGlueRules(Element element, GlueRuleExecutionState state)
at Ranorex.Core.ElementEngine.ApplyGlueRules(Element element)
at Ranorex.Core.Element.GetChildren(CacheSession session)
at Ranorex.Core.Element.get_Children()
at Ranorex.Core.RxPath.collectAxis(LocationStep step, Axis optimizedAxis, Element self, IList`1 elements, Boolean quitOnFirstGoodNode)
at Ranorex.Core.RxPath.ApplyInternal(RxPath path, Element startElement, IDataProvider dataProvider, Duration timeout, Boolean findSingle)
at Ranorex.Core.RxPath.Apply(Element startElement, Duration timeout, Boolean findSingle)
at Ranorex.Core.Element.TryFindSingleInternal(RxPath path, Duration timeout, Element& foundElement)
at Ranorex.Core.Element.FindSingle(RxPath path, Duration timeout)
at Ranorex.Core.Element.op_Implicit(String path)
at RedGate.SQLSourceControl.Testing.GuiTests.SSMS.MdiTabs.FindTab(String tabString) in C:\Work\SQLSourceControl\Trunk\Source\Testing\GuiTests\SSMS\MdiTabs.cs:line 155
at RedGate.SQLSourceControl.Testing.GuiTests.SSC.SscUi.SelectSourceControlTab() in C:\Work\SQLSourceControl\Trunk\Source\Testing\GuiTests\SSC\SSCUi.cs:line 1047
at RedGate.SQLSourceControl.Testing.GuiTests.SSC.SscUi.OpenSSCTabs(String dbserver, String databasename) in C:\Work\SQLSourceControl\Trunk\Source\Testing\GuiTests\SSC\SSCUi.cs:line 1129
at RedGate.SQLSourceControl.Testing.GuiTests.SSC.SscUi.OpenPendingChangesCommitForDatabase(String dbserver, String databasename) in C:\Work\SQLSourceControl\Trunk\Source\Testing\GuiTests\SSC\SSCUi.cs:line 1134
at RedGate.SQLSourceControl.Testing.GuiTests.PendingChangesCommit.Setup() in C:\Work\SQLSourceControl\Trunk\Source\Testing\GuiTests\PendingChanges.cs:line 863
Chris George
Test Engineer

Red Gate Software Ltd
Cambridge

chrisgeorge
Posts: 49
Joined: Thu Aug 20, 2009 11:28 am

Re: IPC error when accessing Tree

Post by chrisgeorge » Thu May 20, 2010 3:41 pm

and another instance, it doesn't seem to be any one particular control type...

System.Runtime.Remoting.RemotingException : Failed to write to an IPC Port: The pipe is being closed.

Server stack trace:
at System.Runtime.Remoting.Channels.Ipc.IpcPort.Write(Byte[] data, Int32 offset, Int32 size)
at System.Runtime.Remoting.Channels.Ipc.PipeStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.Runtime.Remoting.Channels.ChunkedMemoryStream.WriteTo(Stream stream)
at System.Runtime.Remoting.Channels.Ipc.IpcClientHandler.SendRequest(IMessage msg, ITransportHeaders headers, Stream contentStream)
at System.Runtime.Remoting.Channels.Ipc.IpcClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Ranorex.Plugin.ICommonControls.GetControlProxy(IntPtr hwnd, IList`1 assemblyNamesAndPaths)
at Ranorex.Plugin.RemoteCommonControls.Ranorex.Plugin.ICommonControls.GetControlProxy(IntPtr hwnd, IList`1 assemblyNamesAndPaths)
at Ranorex.Plugin.RemoteCommonControls.RemoteControlProxy.UpdateRemoteInterface()
at Ranorex.Plugin.RemoteCommonControls.RemoteControlProxy.Ranorex.Libs.WinForms.IControlProxy.get_Handle()
at Ranorex.Plugin.WinFormsFlavorElement.GetRuntimeTokenValues()
at Ranorex.Core.FlavorElement.get_Token()
at Ranorex.Core.FlavorElement.IsEqual(FlavorElement flavorElem)
at Ranorex.Core.Element.IsEqual(Element elem)
at Ranorex.Core.Element.Equals(Object obj)
at System.Collections.Generic.ObjectEqualityComparer`1.IndexOf(T[] array, T value, Int32 startIndex, Int32 count)
at System.Array.IndexOf[T](T[] array, T value, Int32 startIndex, Int32 count)
at System.Collections.Generic.List`1.IndexOf(T item)
at Ranorex.Core.ElementEngine.ApplyGlueRules(Element element, GlueRuleExecutionState state)
at Ranorex.Core.ElementEngine.ApplyGlueRules(Element element)
at Ranorex.Core.Element.GetChildren(CacheSession session)
at Ranorex.Core.Element.get_Children()
at Ranorex.Adapter.get_Children()
at RedGate.SQLSourceControl.Testing.GuiBase.AppUI.<get_Forms>d__10.MoveNext() in C:\Work\SQLSourceControl\Trunk\Source\Testing\GuiBase\AppUI.cs:line 490
at RedGate.SQLSourceControl.Testing.GuiTests.SSMS.SsmsUiBase.CloseFormAndCheckForErrors(Form formtoclose) in C:\Work\SQLSourceControl\Trunk\Source\Testing\GuiTests\SSMS\SsmsUiBase.cs:line 320
at RedGate.SQLSourceControl.Testing.GuiTests.SSMS.SsmsUiBase.StopSSMS() in C:\Work\SQLSourceControl\Trunk\Source\Testing\GuiTests\SSMS\SsmsUiBase.cs:line 248
at RedGate.SQLSourceControl.Testing.GuiTests.PendingChangesCommitDb.TearDown() in C:\Work\SQLSourceControl\Trunk\Source\Testing\GuiTests\PendingChangesCommitDb.cs:line 93
Chris George
Test Engineer

Red Gate Software Ltd
Cambridge

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: IPC error when accessing Tree

Post by Support Team » Thu May 20, 2010 4:59 pm

chrisgeorge wrote:and another instance, it doesn't seem to be any one particular control type...
I don't think it is related to the control type, but to bad timing :wink:

The bid bridge is a standalone process which is started on demand (if a 32 Ranorex application tries to access a 64 bit application or vice versa) and shut down if it is not contacted/used within 60 seconds (by default). I guess that you get the exception when Ranorex tries to contact the bit bridge process when it is just shutting down.

Regards,
Alex
Ranorex Support Team

chrisgeorge
Posts: 49
Joined: Thu Aug 20, 2009 11:28 am

Re: IPC error when accessing Tree

Post by chrisgeorge » Fri May 21, 2010 7:32 am

hmmm... I guess that makes sense. As far as I'm aware though, although I'm running on 64bit Win7, my application, visual studio, our plugin, nunit are all running 32bit.

Is there any way to stop this bitbridge from loading? Our tests ran fine without it using 2.1.3...

I am liking a few of the enhancements in 2.3 :-).... especially the repo info object. That's awesome! It will remove lots of lines of code written to check for object existence and get paths etc... :-)

Chris
Chris George
Test Engineer

Red Gate Software Ltd
Cambridge

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: IPC error when accessing Tree

Post by Support Team » Fri May 21, 2010 9:00 am

chrisgeorge wrote:Is there any way to stop this bitbridge from loading? Our tests ran fine without it using 2.1.3...
Sure, you can disable the bit bridge in the configuration settings, see the topic in the Ranorex User Guide:
http://www.ranorex.com/support/user-gui ... ation.html
chrisgeorge wrote:I am liking a few of the enhancements in 2.3 .... especially the repo info object. That's awesome! It will remove lots of lines of code written to check for object existence and get paths etc...
Thanks! We are doing our best to extend the Ranorex framework with useful features and your requests help us to decide which features are the high priority ones :D

Regards,
Alex
Ranorex Team

chrisgeorge
Posts: 49
Joined: Thu Aug 20, 2009 11:28 am

Re: IPC error when accessing Tree

Post by chrisgeorge » Fri May 21, 2010 9:32 am

Is there a way to programatically disable it? we do not use the recorder, we purely use the Ranorex API (oh and Spy :-)

In fact we can't even open the recorder as we just have the developer pro licence.

Chris
Chris George
Test Engineer

Red Gate Software Ltd
Cambridge

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: IPC error when accessing Tree

Post by Support Team » Fri May 21, 2010 9:43 am

chrisgeorge wrote:In fact we can't even open the recorder as we just have the developer pro licence.
The configuration dialog is available in Ranorex Spy, too, see the Ranorex User Guide:
http://www.ranorex.com/support/user-gui ... html#c2388
chrisgeorge wrote:Is there a way to programatically disable it?
You can, it's a little hard to find, though, I have to admit...
Ranorex.Core.Configuration.Current.Plugins.Win32.EnableBitBridge = false;
Or you can just copy the Ranorex configuration file ("%ALLUSERSPROFILE%\Ranorex2.lic") to the target machine.

Regards,
Alex
Ranorex Team

chrisgeorge
Posts: 49
Joined: Thu Aug 20, 2009 11:28 am

Re: IPC error when accessing Tree

Post by chrisgeorge » Fri May 21, 2010 9:45 am

Cool... we set up various settings in one of our constructors anyway ( mouse move time/ click time / default search timeout etc) so this will be a good place to put it for now :-)


Thanks. I'll let you know if that solves the problem.


Chris
Chris George
Test Engineer

Red Gate Software Ltd
Cambridge