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.

[BUG] Service Bus raises an incorrect exception for legal values of ForwardTo

See original GitHub issue

Describe the bug Receiving an erroneous error “{0} exceeds the ‘260’ character limit. (Parameter ‘ForwardTo’)” when setting ForwardTo to a value less than 260 characters, but which would exceed it when the base path is prepended.

Expected behavior The maximum name supported is 260 characters, but that should exclude the base path.

Actual behavior (include Exception or Stack Trace) Microsoft.Azure.ServiceBus.ServiceBusException: ‘Entity path ‘sb://sanitized-base-east-us-sanitized.servicebus.windows.net/integration-test-pc-name-lt-azureservicebusamqpconnection-sanitized.messagequeue.client.tests.integration.chain.provisionflowconsumer-sanitized.messagequeue.client.tests.integration.chain.request.sqlservermessage’ exceeds the ‘260’ character limit. (Parameter ‘ForwardTo’)’

In this situation, the base path is appended by the framework by the following code located in SubscriptionDescriptionExtensions.cs

description.ForwardTo = NormalizeForwardToAddress(description.ForwardTo, baseAddress);

The setter of ForwardTo then runs validation which causes the exception to be thrown.

To Reproduce

var description = new SubscriptionDescription(topicName, subscriptionName)
{
    ForwardTo = queueName,  
    // where queuename is less than 260 characters EXCLUDING the base address
    // sanitized code
};

if (await _managementClient.SubscriptionExistsAsync(description.TopicPath, description.SubscriptionName))
{
    // sanitized code
}

Environment: Microsoft.Azure.ServiceBus v4.1.2

.NET Core SDK (reflecting any global.json): Version: 3.1.101 Commit: b377529961

Runtime Environment: OS Name: Windows OS Version: 10.0.18362 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.1.101\

Host (useful for support): Version: 3.1.1 Commit: a1388f194c

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
nemakamcommented, Apr 6, 2020

ForwardDeadLetterTo should also have been updated. Forgot about that. And also, this needs to be updated in QueeuDescription as wel.

0reactions
nemakamcommented, Apr 7, 2020

@redtaped , thank you for getting back with another PR. Really appreciate it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Service Bus Resource Manager exceptions
List of Service Bus exceptions surfaced by Azure Resource Manager and suggested actions. ... The MaxSizeInMegabytes value is invalid.
Read more >
[BUG] Invalid operation exception while sending batched ...
Servicebus 7.5.1 Describe the bug I was sending batched messages to Azure Service Standard and encountered the following exception.
Read more >
Create service bus topic request gives exception Operation ...
1 Answer. According to the error, seems you did not add your service principal as a role to your service bus. You could...
Read more >
Title 18 - CRIMES AND OFFENSES
Sentence of persons under the age of 18 for murder, murder of an unborn child and murder of a law enforcement officer. §...
Read more >
Texas Commercial Motor Vehicle Drivers Handbook
All drivers who operate a commercial motor vehicle are re- quired to have a Commercial Driver License. The law does provide for some...
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