question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Microsoft.Azure.SignalR.ServiceConnectionManager`1.WriteAsync(ServiceMessage serviceMessage) Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

See original GitHub issue

Net Core version: 2.2 Microsoft.Azure.SignalR : 1.0.4 Application type: Web API

Hi, we are experiencing a strange scenario when we are using Azure SignalR 1.0.4. We have different groups that we create for different types of messages that needs to be sent out to the clients that subscribe to these groups. They usually get them but then some times they stop getting the messages but we can still see that our SendAsync method is called. We are also seeing a few exceptions that show up regularly saying:

Microsoft.Azure.SignalR.ServiceConnectionManager`1.WriteAsync(ServiceMessage serviceMessage)

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

We have tried a few different approaches that has been mentioned in other issues that have revolved around clients not reciving messages but with no luck. Hopefully you can help us out.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
vicancycommented, Jan 11, 2019

@brread For this issue, it happens when server does not yet connected to Azure SignalR Service however DI gets the IHubContext and tries to send message to Azure SignalR Service, so it is a right behavior to throw an exception in such case.

0reactions
brread-msftcommented, Jan 10, 2019

I’m confused by the resolution of this issue. It looks like the code change that @vwxyzh pushed in just gives a more descriptive error message.

What does “The Service Connection Is Not Connected” mean?

Is this related to using DI on the IHubContext? (Or the HubLifetimeManager). Does something about this method affect the Service connection?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Index was out of range. Must be non-negative and less ...
The error says "The index is out of range". That means you were trying to index an object with a value that was...
Read more >
Index was out of range. Must be non-negative and less than ...
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index. Source Error:.
Read more >
Azure AD connect: Index was out of range. Must be non- ...
Azure AD connect: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index.
Read more >
Monitor Azure SignalR Service
This article describes the monitoring data generated by Azure SignalR and how you can use the features of Azure Monitor to analyze and...
Read more >
Troubleshooting guide for Azure SignalR Service
This article provides troubleshooting guidance for some of the common issues that customers might encounter.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found