Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

WebSockets error on Azure (IAAS) server

Vote:
 

Running a site on a regular Azure based windows server 2012 environment. Checking the installed roles and features I see that the Application Development section is checked but greyed out. So it states that WebSocket Protocol is installed. Why it is greyed out I don't know but the log gets filled with a lot of these messages:

2016-10-07 15:16:18,627 [1] ERROR EPiServer.Shell.UI.Messaging.Internal.DefaultWebSocketHandler: Web socket communication failure
System.Net.WebSockets.WebSocketException (0x80070026): Reached the end of the file
   at System.Web.WebSockets.WebSocketPipe.<>c__DisplayClass7.b__6(Int32 hrError, Int32 cbIO, Boolean fUtf8Encoded, Boolean fFinalFragment, Boolean fClose)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.WebSockets.AspNetWebSocket.d__2d`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.WebSockets.AspNetWebSocket.<>c__DisplayClass1a.d__1c.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at EPiServer.Shell.UI.Messaging.Internal.DefaultWebSocketHandler.d__7.MoveNext()
System.Net.WebSockets.WebSocketException (0x80070026): Reached the end of the file
   at System.Web.WebSockets.WebSocketPipe.<>c__DisplayClass7.b__6(Int32 hrError, Int32 cbIO, Boolean fUtf8Encoded, Boolean fFinalFragment, Boolean fClose)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.WebSockets.AspNetWebSocket.d__2d`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.WebSockets.AspNetWebSocket.<>c__DisplayClass1a.d__1c.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at EPiServer.Shell.UI.Messaging.Internal.DefaultWebSocketHandler.d__7.MoveNext()

Anyone have any idea why these errors occur?

Site running EPiServer.CMS.UI 9.9.1

#161198
Edited, Oct 07, 2016 15:25
Vote:
 

Hi, did you follow this technote http://world.episerver.com/documentation/Items/Developers-Guide/Episerver-CMS/9/User-interface/websocket-support/? Also check this blog post http://world.episerver.com/blogs/Eric-Pettersson/Dates/2016/2/fixing-the-websocket-protocol-support-issue-when-upgrading-to-episerver-ui-9-4-0/
You can also test if the websocket works http://www.websocket.org/echo.html http://websocketstest.com/

#162064
Oct 10, 2016 9:21
Vote:
 

The settings for the websockets are as far as I can see correct and running the suggested test page (from websocket.org) on the server also provides a successful test result. I don't get any of these errors on the development environment only on the production server. This is how it looks on the server roles setup

And this the web.config parts

<appSettings>
    <add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="vs:EnableBrowserLink" value="false" />
    <add key="PreserveLoginUrl" value="true" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>
  <system.web>
    <httpRuntime requestValidationMode="2.0" targetFramework="4.5" />
#162065
Edited, Oct 10, 2016 10:43
Vote:
 

Have you enabled Websockets in Azure? See this link https://azure.microsoft.com/sv-se/blog/introduction-to-websockets-on-windows-azure-web-sites/

#162067
Oct 10, 2016 10:47
Vote:
 

Hi this is not an Azure Website but a "regular" windows server running in Azure (Azure IAAS). Running the websocket Create your own test from http://www.websocket.org/echo.html is successful so it doesn't seem to be anything wrong with the Websocket functionality on the server but EPiServer seems to have issues running it.

#162851
Edited, Oct 18, 2016 10:39
Vote:
 

It seemed to be some Feature settings causing this. I ran the setup command form Fredrik Haglunds post http://blog.fredrikhaglund.se/blog/2016/03/01/setup-iis-for-episerver-cms/ and that seems to have added some missing features that were not setup as the logging has stopped now. Unfortunately it didn't state which settings were missing but there seemed to be only a few since it ran through quite quickly.

#162854
Oct 18, 2016 11:30
Vote:
 

OK, great you found a solution!

#162976
Oct 18, 2016 13:41
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.