Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClientManager.ConnectionExistsAsync throws exception on expected 404 response from emulator #1912

Open
vyacheslav-sozap opened this issue Feb 14, 2024 · 0 comments

Comments

@vyacheslav-sozap
Copy link

vyacheslav-sozap commented Feb 14, 2024

Describe the bug

I'm calling "Microsoft.Azure.SignalR.Management.ClientManager.ConnectionExistsAsync" for non-existing connection, while talking to emulator. Method call throws exception, saying that emulator responded "404", but it seems like expected behaviour, so I guess method call shouldn't throw exception. Debugging deeply, I see that response doesn't contain header "x-ms-error-code", which management sdk is expecting, so it might be an emulator issue though.

Tested with azure cloud SignalR, works fine, not throwing exception, so problem is probably in the emulator.

To Reproduce

  1. Run emulator
  2. Create CLI app with "Microsoft.Azure.SignalR.Management" referenced
  3. Create instance of ServiceHubContext
  4. Call hubContext.ClientManager.ConnectionExistsAsync("non_existing_connection");

Exceptions

Microsoft.Azure.SignalR.Common.AzureSignalRInaccessibleEndpointException: Unable to access SignalR service. Response status code does not indicate success: 404 (Not Found) Please make sure the endpoint or DNS setting is correct. Request Uri: http://localhost:8888/api/hubs/signalrhub/connections/xxxxxxxxxxxxxxxxxxxxxx?api-version=2022-06-01
 ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found)
   --- End of inner exception stack trace ---
   at Microsoft.Azure.SignalR.RestClient.ThrowExceptionOnResponseFailureAsync(HttpResponseMessage response) in ...\azure-signalr-1.24.0\src\Microsoft.Azure.SignalR.Common\Utilities\RestClient.cs:line 106
   at Microsoft.Azure.SignalR.RestClient.SendAsyncCore(String httpClientName, RestApiEndpoint api, HttpMethod httpMethod, String methodName, Object[] args, Func`2 handleExpectedResponseAsync, CancellationToken cancellationToken) in ...\azure-signalr-1.24.0\src\Microsoft.Azure.SignalR.Common\Utilities\RestClient.cs:line 138
   at Microsoft.Azure.SignalR.Management.RestHubLifetimeManager`1.ConnectionExistsAsync(String connectionId, CancellationToken cancellationToken) in ...\azure-signalr-1.24.0\src\Microsoft.Azure.SignalR.Management\RestHubLifetimeManager.cs:line 273
   ...

Further technical details

  • SignalR SDK version: 1.24.0
  • Microsoft.AspNetCore.SignalR: 1.0.0
  • Microsoft.AspNet.SignalR.Client: 2.4.3
@vyacheslav-sozap vyacheslav-sozap changed the title ClientManager.ConnectionExistsAsync throws exception on expected 404 response ClientManager.ConnectionExistsAsync throws exception on expected 404 response from emulator Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant