Forum Discussion

F5-Admin1's avatar
F5-Admin1
Icon for Nimbostratus rankNimbostratus
Dec 13, 2024

Blazor WebSocket WebApp behind APM not working...

Dear community, 

we a trying to host a new web-application using Websockets. I created a websocket profile - but we always get the following errors:

[2024-12-13T18:28:56.102Z] Information: Normalizing '_blazor' to 'https://remote-t.dfg.de/f5-w-687474703a2f2f73727767743238312e696e742e742e6466672e6465$$/f5-h-$$/_blazor'.
blazor.server.js?F5CH=J:1  [2024-12-13T18:28:56.219Z] Warning: Failed to connect via WebSockets, using the Long Polling fallback transport. This may be due to a VPN or proxy blocking the connection. To troubleshoot this, visit https://aka.ms/blazor-server-using-fallback-long-polling.
log @ blazor.server.js?F5CH=J:1
blazor.server.js?F5CH=J:1  [2024-12-13T18:28:56.267Z] Error: The circuit failed to initialize.
log @ blazor.server.js?F5CH=J:1
blazor.server.js?F5CH=J:1 [2024-12-13T18:28:56.375Z] Information: Connection disconnected.
blazor.server.js?F5CH=J:1  Uncaught (in promise) Error: Invocation canceled due to the underlying connection being closed.
    at Xt._connectionClosed (blazor.server.js?F5CH=J:1:62068)
    at Xt.connection.onclose (blazor.server.js?F5CH=J:1:51976)
    at pn._stopConnection (blazor.server.js?F5CH=J:1:91786)
    at features.reconnect.transport.onclose (blazor.server.js?F5CH=J:1:89471)
    at hn._raiseOnClose (blazor.server.js?F5CH=J:1:76756)
    at hn.stop (blazor.server.js?F5CH=J:1:76567)
    at async pn._stopInternal (blazor.server.js?F5CH=J:1:84144)
    at async pn.stop (blazor.server.js?F5CH=J:1:83975)
    at async Xt.stop (blazor.server.js?F5CH=J:1:55012)
    at async Ir.disconnect (blazor.server.js?F5CH=J:1:137836)

Without APM, the Website ist working fine.

What am I doing wrong?

I value and appreciate your time and energy and look forward to hearing from you.  Thank you. 

 

  •  Try following additional check

     

    Shockingly the app.MapBlazorHub(blazorHubPath) is case sensitive. When the case doesnt match you get the same error described in the question. Please check for any case sensitive mismatch.

     

    Check the possibility if the load-balancer doesn't preserve the route to forward the requests to, and the requests from the app end up hitting random servers. Is there a way you can configure sticky sessions(Session persistence)? That should help.

    There is definitely seems a load-balancer configuration issue. Can you confirm that you have configured the site as specified in the SignalR docs? Specifically, that "ARR Affinity" and "WebSockets" are both enabled as shown in the below screenshot.

    Based on the error message, I would suggest to check that Web Sockets weren't disabled for your app service. 

    It's in General Settings under the Configuration blade.

    If it's enabled, then check for any firewall rules or NSGs that may have inadvertently applied to your app service.

    for f5 logs about blazor.server.js can you please run the following in bash mode and share the output


     

    [root@f5-TestBox-01:Active:Standalone] ~ # cd /var/log
    [root@f5-TestBox-01:Active:Standalone] log # zcat   *.*.gz | grep blazor.server.js

    Please share the VIP config details from CLI output to help you further

     

    https://learn.microsoft.com/en-us/answers/questions/1696509/my-blazor-web-site-will-load-but-when-i-go-to-the