I am helping investigate and diagnose some issues we have and have noticed that the User Errors metrics on a service bus queue is changing. I'd like to know exactly what this metric means as the documentation at https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-metrics-azure-monitor is a little vague.
Thank you for your help.
What are user errors in Azure Service Bus?
User errors generally occur due to mistakes in the client application like, InvalidOperationException, The requested user operation is not allowed within the server or service. For example, Complete() generates InvalidOperationException if the message was received in ReceiveAndDelete mode.
How do I monitor my Azure Service Bus queue?
You can access alerts for Azure Service Bus by selecting Alerts from the Azure Monitor section on the home page for your Service Bus namespace. See Create, view, and manage metric alerts using Azure Monitor for details on creating alerts.
What happens when Service Bus queue max delivery count exceeds?
When the delivery count exceeds the limit, the message is moved to the DLQ. The dead-letter reason for the message in DLQ is set to: MaxDeliveryCountExceeded. This behavior can't be disabled, but you can set the max delivery count to a large number.
I too was exploring possible User Errors on the Azure Service Bus. Below are few of my findings. User errors generally occur due to mistakes in the client application like,
-
InvalidOperationException, The requested user operation is not allowed within the server or service. For example, Complete() generates InvalidOperationException if the message was received in ReceiveAndDelete mode
-
OperationCanceledException, An attempt is made to invoke an operation on an object that has already been closed, aborted or disposed. In rare cases, the ambient transaction is already disposed.
-
UnauthorizedAccessException, The TokenProvider object could not acquire a token, the token is invalid, or the token does not contain the claims required to perform the operation
-
ArgumentException/ArgumentNullException/ ArgumentOutOfRangeException, when One or more arguments supplied to the method are invalid. The URI supplied to NamespaceManager or Create contains path segment(s). The URI scheme supplied to NamespaceManager or Create is invalid. The property value is larger than 32KB.
-
SessionLockLostException, Lock associated with this session is lost
-
MessageLockLostException, Lock token associated with the message has expired, or the lock token is not found
-
MessageNotFoundException, Attempt to receive a message with a particular sequence number. This message is not found
-
MessagingEntityNotFoundException, Entity associated with the operation does not exist or it has been deleted
-
MessagingCommunicationException, Client is unable to establish a connection with Service Bus
-
SessionLockLostException, Lock associated with this session is lost
-
MessagingException, Generic messaging exception that may be thrown in the following cases: An attempt is made to create a QueueClient using a name or path that belongs to a different entity type (for example, a topic). An attempt is made to send a message larger than 256KB. The server or service encountered an error during processing of the request. This is usually a transient exception
-
MessagingEntityAlreadyExistsException, Attempt to create an entity with a name that is already used by another entity in that service namespace
-
QuotaExceededException, The messaging entity has reached its maximum allowable size, or the maximum number of connections to a namespace has been exceeded
-
RuleActionException, Service Bus returns this exception if you attempt to create an invalid rule action. Service Bus attaches this exception to a deadlettered message if an error occurs while processing the rule action for that message
-
FilterException, Service Bus returns this exception if you attempt to create an invalid filter. Service Bus attaches this exception to a deadlettered message if an error occurred while processing the filter for that message
-
SessionCannotBeLockedException, attempt to accept a session with a specific session ID, but the session is currently locked by another client
-
TransactionSizeExceededException, Too many operations are part of the transaction
-
MessagingEntityDisabledException, Request for a runtime operation on a disabled entity
-
NoMatchingSubscriptionException, Service Bus returns this exception if you send a message to a topic that has pre-filtering enabled and none of the filters match
-
MessageSizeExceededException, A message payload exceeds the 256 KB limit. Note that the 256 KB limit is the total message size, which can include system properties and any .NET overhead
-
TransactionException, The ambient transaction (Transaction.Current) is invalid. It may have been completed or aborted
-
TransactionInDoubtException, An operation is attempted on a transaction that is in doubt, or an attempt is made to commit the transaction and the transaction becomes in doubt
I collected the exhaustive list of exceptions from MSDN documentation and filtered the list to get the User Errors possible on a Azure ServiceBus