0
Under review

Routing Service crashing after receiving invalid URL data

John Micallef 3 years ago updated by Ben Burner 3 years ago 3

We have the routing service enabled to share port 443. Once a week we have ScreenConnect service crash with the following in the event log;


Application ID: ConfigurationRouter-0002


Process ID: 4048

Exception: System.UriFormatException

Message: Invalid URI: The hostname could not be parsed.

StackTrace: at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString)
at System.UriBuilder.get_Uri()
at ScreenConnect.Router.RelayHandshakeProcessor.<>c.<ProcessHandshakeData>b__0_6(String n)
at ScreenConnect.Extensions.SafeNav[T,U](T obj, Func`2 selector, U defaultValue)
at ScreenConnect.Router.RelayHandshakeProcessor.ProcessHandshakeData(IPEndPoint localEndPoint, IPEndPoint remoteEndPoint, ArraySegment`1 mutableHandshakeData)
at ScreenConnect.Router.<>c__DisplayClass2_0.<ProcessHandshakeAsync>b__0(HandshakeProcessor hp)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at ScreenConnect.Router.ProcessHandshakeAsync(IPEndPoint localEndPoint, IPEndPoint remoteEndPoint, ArraySegment`1 mutableHandshakeData, Proc`2 proc)
at ScreenConnect.Router.<>c__DisplayClass4_0.<ProcessAcceptedSocket>b__0()
at ScreenConnect.SocketAsyncExecutor.<.ctor>b__2_0(Object <sender>, SocketAsyncEventArgs <e>)
at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e)
at System.Net.Sockets.SocketAsyncEventArgs.ExecutionCallback(Object ignored)
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.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationSuccess(SocketError socketError, Int32 bytesTransferred, SocketFlags flags)
at System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)


Application: ScreenConnect.Service.exe

Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.UriFormatException
Stack:
at System.Uri.CreateThis(System.String, Boolean, System.UriKind)
at System.Uri..ctor(System.String)
at System.UriBuilder.get_Uri()
at ScreenConnect.Router+RelayHandshakeProcessor+<>c.<ProcessHandshakeData>b__0_6(System.String)
at ScreenConnect.Extensions.SafeNav[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon, ScreenConnect.Func`2<System.__Canon,System.__Canon>, System.__Canon)
at ScreenConnect.Router+RelayHandshakeProcessor.ProcessHandshakeData(System.Net.IPEndPoint, System.Net.IPEndPoint, System.ArraySegment`1<Byte>)
at ScreenConnect.Router+<>c__DisplayClass2_0.<ProcessHandshakeAsync>b__0(HandshakeProcessor)
at System.Linq.Enumerable+WhereSelectArrayIterator`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at System.Linq.Enumerable+WhereEnumerableIterator`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at System.Linq.Enumerable.FirstOrDefault[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
at ScreenConnect.Router.ProcessHandshakeAsync(System.Net.IPEndPoint, System.Net.IPEndPoint, System.ArraySegment`1<Byte>, ScreenConnect.Proc`2<ScreenConnect.RoutingActionType,System.Uri>)
at ScreenConnect.Router+<>c__DisplayClass4_0.<ProcessAcceptedSocket>b__0()
at ScreenConnect.SocketAsyncExecutor.<.ctor>b__2_0(System.Object, System.Net.Sockets.SocketAsyncEventArgs)
at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(System.Net.Sockets.SocketAsyncEventArgs)
at System.Net.Sockets.SocketAsyncEventArgs.ExecutionCallback(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationSuccess(System.Net.Sockets.SocketError, Int32, System.Net.Sockets.SocketFlags)
at System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)


ConnectWise Control Version:
Server Affected:
Host Client Affected:
Guest Client Affected:

Good morning and thank you for submitting this information.


I've begun reviewing the report; the stack is very helpful, but I was hoping you might be able to send along some additional information and enable router tracing:


1) What version of ScreenConnect are you using?

2) Can you add the following to the beginning of your web.config to enable router tracing (you'll need to update trace.log to output to an absolute path on your server):


<configuration>
<system.diagnostics>
<trace autoflush="true" />
<sharedListeners>
    <add name="Listener" type="System.Diagnostics.TextWriterTraceListener" initializeData="trace.log" />
</sharedListeners>
<sources>
    <source name="Router" switchValue="All">
        <listeners>
            <add name="Listener" />
        </listeners>
    </source>
</sources>
</system.diagnostics>
...


Also, it would be helpful to review your web.config in its entirety. If you're amenable, please send a copy of your web.config to extension@screenconnect.com.


Cheers,

Ben

Any updates on this?

We have so far been unable to replicate this behavior in our test environment; however, the investigation is ongoing.


In addition, we have not observed this behavior in our cloud-hosted environments, which also use the Router service.