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.

Azure.Messaging.ServiceBus.ServiceBusException: System.Net.Sockets.SocketException (110): Operation timed out

See original GitHub issue

Hi, I use the below code to schedule the messages in Azure Web Job ServiceBusTrigger. However I am getting the below error immediately after starting the AKS containers Azure.Messaging.ServiceBus" Version=“7.5.0”

var client = new ServiceBusClient(ConnectionString);
                        var sender = client.CreateSender(TopicName);
                        var scheduledMessage = new ServiceBusMessage(message);
                        await sender.ScheduleMessageAsync(scheduledMessage, DateTimeOffset.UtcNow.AddMinutes(_serviceBusConfig.ScheduledEnqueueTimeInMinutes));
                        await messageActions.CompleteMessageAsync(message);

Azure.Messaging.ServiceBus.ServiceBusException: Operation timed out ErrorCode: TimedOut (ServiceCommunicationProblem) —> System.Net.Sockets.SocketException (110): Operation timed out at Microsoft.Azure.Amqp.AsyncResult.End[TAsyncResult](IAsyncResult result) at Microsoft.Azure.Amqp.Transport.AmqpTransportInitiator.<>c.<ConnectAsync>b__17_1(IAsyncResult r) at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization) — End of stack trace from previous location — at Azure.Messaging.ServiceBus.Amqp.AmqpConnectionScope.CreateAndOpenConnectionAsync(Version amqpVersion, Uri serviceEndpoint, ServiceBusTransportType transportType, IWebProxy proxy, String scopeIdentifier, TimeSpan timeout) at Microsoft.Azure.Amqp.FaultTolerantAmqpObject1.OnCreateAsync(TimeSpan timeout) at Microsoft.Azure.Amqp.Singleton1.GetOrCreateAsync(TimeSpan timeout) at Microsoft.Azure.Amqp.Singleton1.GetOrCreateAsync(TimeSpan timeout) at Azure.Messaging.ServiceBus.Amqp.AmqpConnectionScope.OpenManagementLinkAsync(String entityPath, String identifier, TimeSpan timeout, CancellationToken cancellationToken) at Azure.Messaging.ServiceBus.Amqp.AmqpSender.OpenManagementLinkAsync(TimeSpan timeout) at Microsoft.Azure.Amqp.FaultTolerantAmqpObject1.OnCreateAsync(TimeSpan timeout) at Microsoft.Azure.Amqp.Singleton1.GetOrCreateAsync(TimeSpan timeout) at Microsoft.Azure.Amqp.Singleton1.GetOrCreateAsync(TimeSpan timeout) at Azure.Messaging.ServiceBus.Amqp.ManagementUtilities.ExecuteRequestResponseAsync(AmqpConnectionScope connectionScope, FaultTolerantAmqpObject1 managementLink, AmqpRequestMessage amqpRequestMessage, TimeSpan timeout) at Azure.Messaging.ServiceBus.Amqp.AmqpSender.ScheduleMessageInternalAsync(IReadOnlyList1 messages, TimeSpan timeout, CancellationToken cancellationToken) — End of inner exception stack trace — at Azure.Messaging.ServiceBus.Amqp.AmqpSender.ScheduleMessageInternalAsync(IReadOnlyList1 messages, TimeSpan timeout, CancellationToken cancellationToken) at Azure.Messaging.ServiceBus.Amqp.AmqpSender.<>c.<<ScheduleMessagesAsync>b__24_0>d.MoveNext() --- End of stack trace from previous location --- at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.RunOperation[T1,TResult](Func4 operation, T1 t1, TransportConnectionScope scope, CancellationToken cancellationToken) at Azure.Messaging.ServiceBus.ServiceBusRetryPolicy.RunOperation[T1,TResult](Func4 operation, T1 t1, TransportConnectionScope scope, CancellationToken cancellationToken) at Azure.Messaging.ServiceBus.Amqp.AmqpSender.ScheduleMessagesAsync(IReadOnlyList1 messages, CancellationToken cancellationToken) at Azure.Messaging.ServiceBus.ServiceBusSender.ScheduleMessagesAsync(IEnumerable`1 messages, DateTimeOffset scheduledEnqueueTime, CancellationToken cancellationToken)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
krishnad1982commented, Mar 3, 2022

Hi @jsquire , All sorted. I have tested and confirmed that the issue is no longer exists. Thanks.

1reaction
krishnad1982commented, Feb 26, 2022

Hey @jsquire Thanks for the swift reply. I could not bind the ServiceBusSender directly “Cannot bind parameter ‘sender’ to type ServiceBusSender”. However, I managed to use it with ServiceBus attribute as mentioned below. I will update once done with my testing.

public async Task Process(
            [ServiceBusTrigger("%Topic%", "%Subscription%", Connection = "Connection ")]
            ServiceBusReceivedMessage message,
            ServiceBusMessageActions messageActions, 
            [ServiceBus(""%Topic%", Connection = "Connection"] ServiceBusSender sender)
        { }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Service bus connection is not working from on-premise ...
I am getting a time-out (socket exception) while executing the exe in on-premise VM. I am using shared access policy connection strung to ......
Read more >
Azure Service Bus Connection issue - Microsoft Q&A
ErrorCode: TimedOut ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly ...
Read more >
Azure Service Bus TimedOut exception when running ...
I'm getting a "ServiceBusCommunicationException" reason "Connection timed out ErrorCode: TimedOut" with an Inner Exception of ...
Read more >
'Azure.Messaging.ServiceBus.ServiceBusExceptio' when ...
Hi We are getting stuck in what seems like an endless message loop, when trying to publish event using Azure Service Bus.
Read more >
The Azure Service Bus connector times out when there are ...
The Azure Service Bus connector receives a timeout when no messages are received from the topic during the specified response timeout value.
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