question

SachinTripathi-5603 avatar image
0 Votes"
SachinTripathi-5603 asked MayankBargali-MSFT commented

While sending request from API to Service bus, error occured "No such host is known" (09b49113)

Hi Team,

We are using service bus to do some back-end process and it is running properly and processing the requests but all of sudden it threw error "No such host is known".

We are using below code to send message to Service Bus:

 Message message = new Message(Encoding.UTF8.GetBytes(data));
 QueueClient queueClient = new QueueClient(ServiceBusConnectionString, queueName);
 await queueClient.SendAsync(message).ConfigureAwait(false);  

And getting error below at that time:

 [ERR] Queue Message handler encountered an exception One or more errors occurred. (No such host is known) (09b49113)

Note: This is a intermittent issue.

Please let me know the root cause of this issue.

azure-service-bus
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
1 Vote"
MayankBargali-MSFT answered MayankBargali-MSFT commented

Hi @SachinTripathi-5603

Welcome to Microsoft Q&A! Thanks for posting the question.

This is the socket exception when the connection is made from the client application to the service bus. Please make sure that you are using the right connection string.
If you are using the right connection string (don't remove Endpoint=sb:// or other details) define on your ServiceBusConnectionString object then you need to verify whether the ports are blocked at your client machine. You can follow this troubleshooting guide.

Endpoint=sb://{yourservicebusnae}.servicebus.windows.net/;SharedAccessKeyName={your access key name(RootManageSharedAccessKey)};SharedAccessKey={your key}

Hope the above helps. Feel free to get back to me if you need any assistance.

Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for your reply @MayankBargali-MSFT !

Yes, we are using service bus connection string in the same way you mentioned AND it is working fine at the moment.

Service Bus Connection String Format:

 "Endpoint=sb://xyz.servicebus.windows.net/;SharedAccessKeyName=XXXSharedAccessKey;SharedAccessKey=XYZ"

But above error comes only once from last one year. Don't know what causes this error.
Can you please suggest if this is related to azure infrastructure issue or something that we need to change from our end to handle such error in future?

0 Votes 0 ·

@SachinTripathi-5603 Mostly the issue would have caused due to DNS where the name was not resolved once. Most probably in the exception stack trace, you would have seen it as MessageCommunicationException and you can refer to this service bus exception document which has a description, suggested action, and whether automatic retry will work or not. In MessageCommunicationException the automatic retry might help in some scenarios where there is an issue at the service bus end but in case of a network issue in between, client-side issue you can do manual/exponential retry before throwing the exception.

1 Vote 1 ·

Yes. In case of any network issue in between client and service bus, we can apply retry mechanism. That is what we are not implemented yet. we should try this. Thanks for your suggestion @MayankBargali-MSFT.


0 Votes 0 ·

@SachinTripathi-5603 My Pleasure. Feel free to get back to us in Microsoft Q&A if you need any assistance in further.

0 Votes 0 ·