Azure / azure-signalr

Azure SignalR Service SDK for .NET
https://aka.ms/signalr-service
MIT License
414 stars 97 forks source link

Azure Signalr Service Issue with Blazor Application #1059

Open BrennanConroy opened 3 years ago

BrennanConroy commented 3 years ago

Issue moved from dotnet/aspnetcore#26600


From @mithunscout on Monday, October 5, 2020 5:16:41 AM

Team,

I have one application which uses the below logic ->

Step 1-> Azure SQL Database gets a row from Web API from another application and one stored procedure runs and creates an entry on the table Step 2-> once the Entry is created in this table there is one Azure Logic App which pushes the row into Queue Table in Azure Step 3 -> Once the queue table gets an entry using Queue Trigger it pushes the record to Signalr Hub where clients are connected and the record is distributed to users;

The issue I am facing here is I moved this application from Web Based to Blazor. Here when I moved this I am facing below issues a. on local system without Azure Signalr Service everything works perfectly (Only Locally) b. when I turn of the Azure Signalr Service and publish it as Web Service App and push it to Azure-> the application fails with Blazor Negotiation Error - Error Message Azure Signalr Service is not started c. When I turn on the Azure Signalr from Startup and try running it locally - it doesnt work same error Azure Signalr Service Is not Started / Connection ID Required d. When I try to push it to Web App with Azure Signalr R Service started - it doesnt work and gives me same error (Azure Signalr Service Not started / Connection Id Required)

find below blazor server logs;

[2020-10-05T05:16:00.498Z] Information: Starting up blazor server-side application. blazor.server.js:1 [2020-10-05T05:16:00.499Z] Information: Normalizing '_blazor' to 'https://localhost:44345/_blazor'. blazor.server.js:1 [2020-10-05T05:16:00.499Z] Debug: Starting HubConnection. blazor.server.js:1 [2020-10-05T05:16:00.499Z] Debug: Starting connection with transfer format 'Binary'. blazor.server.js:1 [2020-10-05T05:16:00.499Z] Debug: Sending negotiation request: https://localhost:44345/_blazor/negotiate?negotiateVersion=1. _blazor/negotiate?negotiateVersion=1:1 Failed to load resource: the server responded with a status of 500 () blazor.server.js:1 [2020-10-05T05:16:00.522Z] Error: Failed to complete negotiation with the server: Error e.log @ blazor.server.js:1 blazor.server.js:1 [2020-10-05T05:16:00.523Z] Error: Failed to start the connection: Error e.log @ blazor.server.js:1 blazor.server.js:1 [2020-10-05T05:16:00.523Z] Debug: HubConnection failed to start successfully because of error 'Error'. blazor.server.js:19 [2020-10-05T05:16:00.523Z] Error: Error e.log @ blazor.server.js:19 blazor.server.js:1 [2020-10-05T05:16:00.523Z] Debug: Call to HubConnection.stop(undefined) ignored because it is already in the disconnected state. blazor.server.js:1 Uncaught (in promise) Error: Cannot send data if the connection is not in the 'Connected' State. at e.send (blazor.server.js:1) at e.sendMessage (blazor.server.js:1) at e.sendWithProtocol (blazor.server.js:1) at blazor.server.js:1 at new Promise () at e.invoke (blazor.server.js:1) at e. (blazor.server.js:19) at blazor.server.js:19 at Object.next (blazor.server.js:19) at blazor.server.js:19

BrennanConroy commented 3 years ago

Issue moved from dotnet/aspnetcore#26600


From @pranavkm on Monday, October 5, 2020 4:36:56 PM

@BrennanConroy could you help?

BrennanConroy commented 3 years ago

Issue moved from dotnet/aspnetcore#26600


From @BrennanConroy on Monday, October 5, 2020 4:39:05 PM

Azure Signalr Service is not started

Have you configured the service correctly? https://docs.microsoft.com/azure/azure-signalr/signalr-quickstart-dotnet-core

BrennanConroy commented 3 years ago

Issue moved from dotnet/aspnetcore#26600


From @mithunscout on Monday, October 5, 2020 10:25:09 PM

Hi I have gone through this document and have configured it as per this...

BrennanConroy commented 3 years ago

Issue moved from dotnet/aspnetcore#26600


From @BrennanConroy on Monday, October 5, 2020 10:29:38 PM

Can you grab your server's logs and see what it says about connecting to the Azure SignalR Service?

BrennanConroy commented 3 years ago

Issue moved from dotnet/aspnetcore#26600


From @mithunscout on Tuesday, October 6, 2020 4:53:33 AM

Hi

I am getting error as "Azure SignalR Service is not started yet... try again later...."...

also I am not able to find any logs at the Server End;

Regards Mithun

BrennanConroy commented 3 years ago

Issue moved from dotnet/aspnetcore#26600


From @BrennanConroy on Tuesday, October 6, 2020 5:01:07 AM

Where are you seeing that error?

Logging: https://docs.microsoft.com/aspnet/core/fundamentals/logging/?view=aspnetcore-3.1

BrennanConroy commented 3 years ago

Issue moved from dotnet/aspnetcore#26600


From @mithunscout on Tuesday, October 6, 2020 6:12:49 AM

MultlingualError

Hi Brennan,

I am seeing this error when I click the link on my console. Pls find attached the screenshot for the same. I still dont see any server side activity on my Signalr Service;

MultlingualSignalrError

Regards Mithun

BrennanConroy commented 3 years ago

Issue moved from dotnet/aspnetcore#26600


From @BrennanConroy on Tuesday, October 6, 2020 6:18:19 AM

You need to get logs from your app. https://github.com/Azure/azure-signalr/blob/82673cad4f95f6926f1e9665cf95c2815cbde55d/docs/tsg.md#500-error-when-negotiate-azure-signalr-service-is-not-connected-yet-please-try-again-later

BrennanConroy commented 3 years ago

Issue moved from dotnet/aspnetcore#26600


From @mithunscout on Tuesday, October 6, 2020 8:10:44 AM

Hi Brennan

The first error says Connection ID REquired and 2nd error says Azure SignalR Service is not started yet (Error Code 500);

I did enable the server side logs as per the attached document but still cant see any logs

Regards Mithun

BrennanConroy commented 3 years ago

Issue moved from dotnet/aspnetcore#26600


From @mithunscout on Tuesday, October 6, 2020 8:49:06 AM

Hi Brennan

Pls find attached the Server Logs for the same Regards Mithun

AzureSignalrLog.log

mithunscout commented 3 years ago

Please provide me an update on this

vicancy commented 3 years ago

The server side, how is it configured to use Azure SignalR? Where you set the ConnectionString?

Also could you please provide your blazor app server side log following https://github.com/Azure/azure-signalr/blob/dev/docs/howto-tsg.md#add_logs_server_aspnetcore when the app server starts? We need the app server side log to identify why it fails to connect to Azure SignalR. Typically we care about logs that "Starting transport" and "Failed to connect", the log should show up right after the app server is started. The logs would be similar to below:

image