[BUG] Invalid operation exception while sending batched messages to Service Bus Standard tier
See original GitHub issueLibrary name and version
Azure.Messaging.Servicebus 7.5.1
Describe the bug
I was sending batched messages to Azure Service Standard and encountered the following exception. Note that this exception is not reproducible consistently. My observation is that when the load on the ASB Standard is close to getting it throttled, this happens.
System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Cannot open log for source 'Microsoft.ServiceBus'. You may not have write access.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Azure.Messaging.ServiceBus.Amqp.AmqpSender.<SendBatchInternalAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.Amqp.AmqpSender.<>c.<<SendBatchAsync>b__18_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<>c__20`1.<<RunOperation>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask`1.get_Result()
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<RunOperation>d__21`2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<RunOperation>d__21`2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<RunOperation>d__20`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.Amqp.AmqpSender.<SendBatchAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.ServiceBusSender.<SendMessagesAsync>d__30.MoveNext()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.InvalidOperationException: Cannot open log for source 'Microsoft.ServiceBus'. You may not have write access.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Azure.Messaging.ServiceBus.Amqp.AmqpSender.<SendBatchInternalAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.Amqp.AmqpSender.<>c.<<SendBatchAsync>b__18_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<>c__20`1.<<RunOperation>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask`1.get_Result()
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<RunOperation>d__21`2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<RunOperation>d__21`2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<RunOperation>d__20`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.Amqp.AmqpSender.<SendBatchAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.ServiceBusSender.<SendMessagesAsync>d__30.MoveNext()<---
Expected behavior
There should not be any exceptions.
Actual behavior
Exception occured
System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Cannot open log for source 'Microsoft.ServiceBus'. You may not have write access.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Azure.Messaging.ServiceBus.Amqp.AmqpSender.<SendBatchInternalAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.Amqp.AmqpSender.<>c.<<SendBatchAsync>b__18_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<>c__20`1.<<RunOperation>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask`1.get_Result()
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<RunOperation>d__21`2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<RunOperation>d__21`2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<RunOperation>d__20`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.Amqp.AmqpSender.<SendBatchAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.ServiceBusSender.<SendMessagesAsync>d__30.MoveNext()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.InvalidOperationException: Cannot open log for source 'Microsoft.ServiceBus'. You may not have write access.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Azure.Messaging.ServiceBus.Amqp.AmqpSender.<SendBatchInternalAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.Amqp.AmqpSender.<>c.<<SendBatchAsync>b__18_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<>c__20`1.<<RunOperation>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask`1.get_Result()
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<RunOperation>d__21`2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<RunOperation>d__21`2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.<RunOperation>d__20`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.Amqp.AmqpSender.<SendBatchAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Messaging.ServiceBus.ServiceBusSender.<SendMessagesAsync>d__30.MoveNext()<---
Reproduction Steps
Used .net SDK to continuously send batched messages to ASB standard
Environment
.net 4.8
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
What is the exception "cannot open log" invalid operation ...
I am getting the following exception when sending batched messages to the Azure Service Bus Standard Tier. What is the exception that talks ......
Read more >Azure Service Bus Resource Manager exceptions
This error occurs when you try to create a queue in a non-premium tier namespace with a value set to the property maxMessageSizeInKilobytes...
Read more >Create partitioned Azure Service Bus queues and topics
If the partition key property is set to a different value than the session ID property, Service Bus returns an invalid operation exception....
Read more >Deep dive into Azure Service Bus messaging with the .NET ...
In this session, you will learn what Azure Service Bus messaging offers and why it ... and the standard tiers are basically consumption...
Read more >Azure Service Bus and its Complete Overview
Azure Service Bus is a messaging service on cloud used to connect any applications, devices, and services running in the cloud.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @arunprakashn. We’ve discussed internally and agree that this appears to be an error triggered by the service. It is currently under investigation.
@arunprakashn: Apologies for the confusion. I do not believe this is a local exception in your application or in the SDK. I’ll follow-up with @shankarsama offline for discussion.