-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[BUG] ServiceBus.Core.MessageSender.OnSendAsync throws "InvalidCastException: Unable to cast object of type 'Microsoft.Azure.Amqp.Framing.Accepted' to type 'Microsoft.Azure.Amqp.Transaction.Declared'." #14836
Comments
//cc: @JoshLove-msft, @MiYanni |
Thank you for your feedback. Tagging and routing to the team best able to assist. |
@chwarr could you share a code repro for when you see this? |
This happens intermittently, so I haven't been able to craft a minimal repro. It's also in a code base that I'm not the most familiar with, so I'm learning it at the same time as debugging this issue.
I'm happy to provide more details. Let me know what you're looking for. |
I am experiencing exactly the same exception intermittently.
I am happy to provide more details. Let me know what you're looking for. |
We are seeing this in our subscription too. But we are seeing the exception on It is reproducable only under a load. |
@23min Can you also share your user scenario or a piece of code if possible? In how much load will this occur and where is the exception throwing from? What SDK version are you using? |
I haven't been working on the for a while. The freshest timestamp I have is 2020-10-14 06:26:40Z. I don't have a fresher repro than that. The task I was using Service Bus for has concluded. I won't be able to get you a fresher repro than that. I've sent you a Event Source trace log from that October incident at your Microsoft email. I hope this helps. |
We are using 5.1.0. We will soon swith to 5.1.1 or 5.1.2 but no date for that yet. Stack trace:
The failure occurs about 1 in 10,000 transactions through our system. The total number of transactions on ServiceBus is at least tenfold. |
@23min thanks so much. I don't think 5.1.2 will make any difference since we haven't identified the issue yet. If this exception happened within 30 days, can you open a Azure support ticket with us? https://azure.microsoft.com/en-us/support/create-ticket/ We will investigate further. |
We don't have enough information to answer this right now since we suspect this is an issue on the AMQP layer. We will get back when we find proof. |
We couldn't yet reproduce it on our end. There is something going wrong with AMQP library, in a particular corner case. I just couldn't reproduce it so far and don't see any particular code path that may have caused this. We will keep this open, and continue to investigate as a low priority item. In the meantime, if any of you can consistently reproduce it and identify a reproducible pattern, we will be happy to fix it. |
I also face the same issue. Please check the below steps. hope, you can generate an issue
Seems like the issue comes with load |
Hi Team, Update: Unfortunately, we did not receive a positive response on the ticket we had open. We still have this issue. |
@EldertGrootenboer: Would you be able to follow-up on this? |
Hi Team, |
I am getting this in the latest client. The line that causes this is at the link below. I looked over the code a little to see if I could find the cause but this is some serious multi-threaded stuff. My guess, from what I am seeing is that something is getting disposed/cancelled, while one of these async tasks is in flight and something in the queue processing is having it return the wrong value. Again its impossible to reproduce but it happens several times a day, where we are processing 100's thousands of messages. The reason I think it's a cancel/dispose issue is because we are running containers and this happens often when autoscaling and not so much in the debugger. https://github.com/Azure/azure-amqp/blob/master/src/Transaction/Controller.cs#L81 |
We are also seeing this error regularly (on the receiving side, when messages get marked as completed). We have also noticed that the error rate is correlated with the number of pod starts/stops. NuGet Package versions: Example stack trace:
|
@JoshLove-msft : From the most recent report, it looks as if this can be reproduced on |
Hi @chwarr, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support. |
Describe the bug
ServiceBus.Core.MessageSender.OnSendAsync
is occasionally throwing the exception "System.InvalidCastException: Unable to cast object of type 'Microsoft.Azure.Amqp.Framing.Accepted' to type 'Microsoft.Azure.Amqp.Transaction.Declared'."Expected behavior
No
InvalidCastException
is thrown. If this is an error due to how I'm using the library, something more descriptive than an AMQP cast exception is thrown so that I can fix how I'm calling the library/service.Actual behavior (include Exception or Stack Trace)
Here's an exception stack trace excerpt. Everything after the "..." is Polly retry code or my service's code:
To Reproduce
Unknown. This happens occasionally when our service tries to add items to a Service Bus queue. I can provide more details, but I would appreciate some guidance on what you're looking for.
Environment:
The text was updated successfully, but these errors were encountered: