Service Bus unknown error (0xffffffff) while sending message

0

I have an Azure App Service API which connects to a Service Bus Queue. Everything worked perfect for a while, but then I started to get these kind of errors:

System.AggregateException: One or more errors occurred. (Unknown error (0xffffffff) ErrorCode: SocketError) ---> Microsoft.Azure.ServiceBus.ServiceBusCommunicationException: Unknown error (0xffffffff) ErrorCode: SocketError ---> System.Net.Sockets.SocketException: Unknown error (0xffffffff)
   at Microsoft.Azure.ServiceBus.ServiceBusConnection.CreateConnectionAsync(TimeSpan timeout)
   at Microsoft.Azure.Amqp.FaultTolerantAmqpObject`1.OnCreateAsync(TimeSpan timeout)
   at Microsoft.Azure.Amqp.Singleton`1.GetOrCreateAsync(TimeSpan timeout)
   at Microsoft.Azure.Amqp.Singleton`1.GetOrCreateAsync(TimeSpan timeout)
   at Microsoft.Azure.ServiceBus.Amqp.AmqpLinkCreator.CreateAndOpenAmqpLinkAsync()
   at Microsoft.Azure.ServiceBus.Core.MessageSender.CreateLinkAsync(TimeSpan timeout)
   at Microsoft.Azure.Amqp.FaultTolerantAmqpObject`1.OnCreateAsync(TimeSpan timeout)
   at Microsoft.Azure.Amqp.Singleton`1.GetOrCreateAsync(TimeSpan timeout)
   at Microsoft.Azure.Amqp.Singleton`1.GetOrCreateAsync(TimeSpan timeout)
   at Microsoft.Azure.ServiceBus.Core.MessageSender.OnSendAsync(IList`1 messageList)
   --- End of inner exception stack trace ---
   at Microsoft.Azure.ServiceBus.Core.MessageSender.OnSendAsync(IList`1 messageList)
   at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout)
   at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout)
   at Microsoft.Azure.ServiceBus.Core.MessageSender.SendAsync(IList`1 messageList)
    public async Task SendAsync(string message)
    {
        var queueMessage = new Message(Encoding.ASCII.GetBytes(message));
        var queueClient = GetQueueClient("myqueue");
        await queueClient.SendAsync(queueMessage);
    }

    public IQueueClient CreateQueueClient(string queueName)
    {
        var messageBusSection = _configuration
            .GetSection("AppSettings:MessageBus");
        var connectionString = messageBusSection["ConnectionString"];
        var path = messageBusSection.GetSection("Queues")[queueName];
        return new QueueClient(connectionString, path);
    }

I assume this is not a quota exceeded issue and it also doesn't say timeout. Any idea on how I could debug this?

c#
azureservicebus
asked on Stack Overflow Apr 22, 2019 by kord

2 Answers

0

Note: This is not certain to solve your problem (since the error is not very descriptive).

One of the best practices in using ASB messaging is to reuse factories and clients:

It is recommended that you do not close messaging factories or queue, topic, and subscription clients after you send a message, and then re-create them when you send the next message.

It's possible that you're just running into some sort of connection throttling that could be solved by reusing the QueueClient instead of re-creating it on every message send.

answered on Stack Overflow Apr 22, 2019 by devNull
0

I just started getting lots of these yesterday myself:

Microsoft.ServiceBus: Unknown error (0xffffffff)

And

Could not connect to net.tcp://some-namespace.servicebus.windows.net:9354/. The connection attempt lasted for a time span of 00:00:00. TCP error code -1: Unknown error (0xffffffff).

As you see the connection attempt fails directly.

Have been working fine for months, then bam.... I guess Microsoft did something again. Their Azure Status board is all green, but I have a 60% failure rate on my function.

answered on Stack Overflow Apr 23, 2019 by Paaland

User contributions licensed under CC BY-SA 3.0