You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/service-bus-messaging/service-bus-messaging-exceptions.md
+90-2Lines changed: 90 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,8 +43,6 @@ The following table lists messaging exception types, and their causes, and notes
43
43
|[MessageNotFoundException](/dotnet/api/microsoft.servicebus.messaging.messagenotfoundexception)|Attempt to receive a message with a particular sequence number. This message isn't found. |Make sure the message hasn't been received already. Check the deadletter queue to see if the message has been deadlettered. |Retry doesn't help. |
44
44
|[MessagingCommunicationException](/dotnet/api/microsoft.servicebus.messaging.messagingcommunicationexception)|Client isn't able to establish a connection to Service Bus. |Make sure the supplied host name is correct and the host is reachable. |Retry might help if there are intermittent connectivity issues. |
45
45
|[ServerBusyException](/dotnet/api/microsoft.azure.servicebus.serverbusyexception)|Service isn't able to process the request at this time. |Client can wait for a period of time, then retry the operation. |Client may retry after certain interval. If a retry results in a different exception, check retry behavior of that exception. |
46
-
|[MessageLockLostException](/dotnet/api/microsoft.azure.servicebus.messagelocklostexception)|Lock token associated with the message has expired, or the lock token isn't found. |Dispose the message. |Retry doesn't help. |
47
-
|[SessionLockLostException](/dotnet/api/microsoft.azure.servicebus.sessionlocklostexception)|Lock associated with this session is lost. |Abort the [MessageSession](/dotnet/api/microsoft.servicebus.messaging.messagesession) object. |Retry doesn't help. |
48
46
| [MessagingException](/dotnet/api/microsoft.servicebus.messaging.messagingexception) |Generic messaging exception that may be thrown in the following cases:<p>An attempt is made to create a [QueueClient](/dotnet/api/microsoft.azure.servicebus.queueclient) using a name or path that belongs to a different entity type (for example, a topic).</p><p>An attempt is made to send a message larger than 256 KB. </p>The server or service encountered an error during processing of the request. See the exception message for details. It's usually a transient exception.</p><p>The request was terminated because the entity is being throttled. Error code: 50001, 50002, 50008. </p> | Check the code and ensure that only serializable objects are used for the message body (or use a custom serializer). <p>Check the documentation for the supported value types of the properties and only use supported types.</p><p> Check the [IsTransient](/dotnet/api/microsoft.servicebus.messaging.messagingexception) property. If it's **true**, you can retry the operation. </p>| If the exception is due to throttling, wait for a few seconds and retry the operation again. Retry behavior is undefined and might not help in other scenarios.|
49
47
|[MessagingEntityAlreadyExistsException](/dotnet/api/microsoft.servicebus.messaging.messagingentityalreadyexistsexception)|Attempt to create an entity with a name that is already used by another entity in that service namespace. |Delete the existing entity or choose a different name for the entity to be created. |Retry doesn't help. |
50
48
|[QuotaExceededException](/dotnet/api/microsoft.azure.servicebus.quotaexceededexception)|The messaging entity has reached its maximum allowable size, or the maximum number of connections to a namespace has been exceeded. |Create space in the entity by receiving messages from the entity or its subqueues. See [QuotaExceededException](#quotaexceededexception). |Retry might help if messages have been removed in the meantime. |
@@ -101,6 +99,96 @@ You should check the value of the [ServicePointManager.DefaultConnectionLimit](h
101
99
### Queues and topics
102
100
For queues and topics, the timeout is specified either in the [MessagingFactorySettings.OperationTimeout](/dotnet/api/microsoft.servicebus.messaging.messagingfactorysettings) property, as part of the connection string, or through [ServiceBusConnectionStringBuilder](/dotnet/api/microsoft.azure.servicebus.servicebusconnectionstringbuilder). The error message itself might vary, but it always contains the timeout value specified for the current operation.
103
101
102
+
## MessageLockLostException
103
+
104
+
### Cause
105
+
106
+
The **MessageLockLostException** is thrown when a message is received using the [PeekLock](message-transfers-locks-settlement.md#peeklock) Receive mode and the lock held by the client expires on the service side.
107
+
108
+
The lock on a message may expire due to various reasons -
109
+
110
+
* The lock timer has expired before it was renewed by the client application.
111
+
* The client application acquired the lock, saved it to a persistent store and then restarted. Once it restarted, the client application looked at the inflight messages and tried to complete these.
112
+
113
+
### Resolution
114
+
115
+
In the event of a **MessageLockLostException**, the client application can no longer process the message. The client application may optionally consider logging the exception for analysis, but the client *must* dispose off the message.
116
+
117
+
Since the lock on the message has expired, it would go back on the Queue (or Subscription) and can be processed by the next client application which calls receive.
118
+
119
+
If the **MaxDeliveryCount** has exceeded then the message may be moved to the **DeadLetterQueue**.
120
+
121
+
## SessionLockLostException
122
+
123
+
### Cause
124
+
125
+
The **SessionLockLostException** is thrown when a session is accepted and the lock held by the client expires on the service side.
126
+
127
+
The lock on a session may expire due to various reasons -
128
+
129
+
* The lock timer has expired before it was renewed by the client application.
130
+
* The client application acquired the lock, saved it to a persistent store and then restarted. Once it restarted, the client application looked at the inflight sessions and tried to process the messages in those sessions.
131
+
132
+
### Resolution
133
+
134
+
In the event of a **SessionLockLostException**, the client application can no longer process the messages on the session. The client application may consider logging the exception for analysis, but the client *must* dispose off the message.
135
+
136
+
Since the lock on the session has expired, it would go back on the Queue (or Subscription) and can be locked by the next client application which accepts the session. Since the session lock is held by a single client application at any given time, the in-order processing is guaranteed.
137
+
138
+
## SocketException
139
+
140
+
### Cause
141
+
142
+
A **SocketException** is thrown in the below cases -
143
+
* When a connection attempt fails because the host did not properly respond after a specified time (TCP error code 10060).
144
+
* An established connection failed because connected host has failed to respond.
145
+
* There was an error processing the message or the timeout is exceeded by the remote host.
146
+
* Underlying network resource issue.
147
+
148
+
### Resolution
149
+
150
+
The **SocketException** errors indicate that the VM hosting the applications is unable to convert the name `<mynamespace>.servicebus.windows.net` to the corresponding IP address.
151
+
152
+
Check to see if below command succeeds in mapping to an IP address.
If the above name **does not resolve** to an IP and the namespace alias, check which the network administrator to investigate further. Name resolution is done through a DNS server typically a resource in the customer network. If the DNS resolution is done by Azure DNS please contact Azure support.
167
+
168
+
If name resolution **works as expected**, check if connections to Azure Service Bus is allowed [here](service-bus-troubleshooting-guide.md#connectivity-certificate-or-timeout-issues)
169
+
170
+
171
+
## MessagingException
172
+
173
+
### Cause
174
+
175
+
**MessagingException** is a generic exception that may be thrown for various reasons. Some of the reasons are listed below.
176
+
177
+
* An attempt is made to create a **QueueClient** on a **Topic** or a **Subscription**.
178
+
* The size of the message sent is greater than the limit for the given tier. Read more about the Service Bus [quotas and limits](service-bus-quotas.md).
179
+
* Specific data plane request (send, receive, complete, abandon) was terminated due to throttling.
180
+
* Transient issues caused due to service upgrades and restarts.
181
+
182
+
> [!NOTE]
183
+
> The above list of exceptions is not exhaustive.
184
+
185
+
### Resolution
186
+
187
+
The resolution steps depends on what caused the **MessagingException** to be thrown.
188
+
189
+
* For **transient issues** (where ***isTransient*** is set to ***true***) or for **throttling issues**, retrying the operation may resolve it. The default retry policy on the SDK can be leveraged for this.
190
+
* For other issues, the details in the exception indicate the issue and resolution steps can be deduced from the same.
191
+
104
192
## Next steps
105
193
For the complete Service Bus .NET API reference, see the [Azure .NET API reference](/dotnet/api/overview/azure/service-bus).
106
194
For troubleshooting tips, see the [Troubleshooting guide](service-bus-troubleshooting-guide.md)
0 commit comments