locked
Randomly Failing Azure SignalR Auction Hub Method RRS feed

  • Question

  • User-374939276 posted

    Thank you ahead of time. I can't figure this out. It worked 100% of the time with the local signalr but if I use the Azure Signalr service it randomly has an error like this: Error: There was an error invoking Hub method 'auctionhub.JoinGroup'.

    Even that method is very simple and fails randomly. In the AuctionHub.cs:

    public Task JoinGroup(string id)
    {
        return Groups.Add(Context.ConnectionId, id);
    }

    I made a sample video: http://youtu.be/SjhiPBb1Q8Q?hd=1 

    Wednesday, September 18, 2019 9:21 AM

Answers

  • User-374939276 posted
    It turns out that Azure Signalr needs a unique application name for each application. Even having tested it on my local machine and deploying it on the server caused it to randomly fail. app.MapAzureSignalR("needs to be unique", hubConfiguration);
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 19, 2019 3:01 AM

All replies

  • User-374939276 posted
    It turns out that Azure Signalr needs a unique application name for each application. Even having tested it on my local machine and deploying it on the server caused it to randomly fail. app.MapAzureSignalR("needs to be unique", hubConfiguration);
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 19, 2019 3:01 AM
  • User61956409 posted

    Hi warrenkc2,

    warrenkc2

    I can't figure this out. It worked 100% of the time with the local signalr but if I use the Azure Signalr service it randomly has an error like this: Error: There was an error invoking Hub method 'auctionhub.JoinGroup'.

    Firstly, I'd like to know if same error randomly appears on your development environment with using Azure SignalR Service, or the error only appears on production environment.

    Secondly, I did test with your site, invoking Hub method JoinGroup with "4997" seems not cause error anymore.

    Besides, you can try to catch HubException and check if it include useful information for troubleshooting issue, like below.

    public Task JoinGroup(string id)
    {
        try
        {
            return Groups.Add(Context.ConnectionId, id);
        }
        catch (Exception ex)
        {
            throw new HubException("Error Message", new { message = ex.Message });
        }
                
    }

    On JavaScript client side

    auctioneerHub.server.joinGroup(auctionId).fail(function (e) {
        if (e.source === 'HubException') {
            console.log(e.message + ' : ' + e.data.message);
        }
    });

    Updated:

    It turns out that Azure Signalr needs a unique application name for each application. Even having tested it on my local machine and deploying it on the server caused it to randomly fail. app.MapAzureSignalR("needs to be unique", hubConfiguration);

    Glad to hear you solve the problem, do you mean you have multi apps with same name and using same Azure SignalR Service?

    With Regards,

    Fei Han

    Thursday, September 19, 2019 3:20 AM