Some requests from our service to Azure Orchestration is getting "Connection reset by peer"

Salamy, Sami 0 Reputation points
2025-02-27T09:25:39.8833333+00:00

Hello,

Where using the libcloud package in Python in order to setup the driver for Azure of the type:

DriverType.COMPUTE.AZURE_ARM

The service is working fine for lots of years, while recently we're getting this error from some requests:

('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

We don't have much info other than this exception, so my questions are:

  1. How can I get more info regarding this error?
  2. What is the default timeout for the AZURE_ARM configured driver?
  3. Which params should we add in order to manually change the timeout, can I use timeout=GENERAL_TIMEOUT or ex_connection_kwargs={'timeout': (CONNNECTION_TIMEOUT, READ_TIMEOUT)}
  4. What other reasons might return such general error? Rate limit? Can we increase it?

Thank you

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,306 questions
{count} votes

1 answer

Sort by: Most helpful
  1. anashetty 2,395 Reputation points Microsoft External Staff
    2025-03-03T15:45:39.1933333+00:00

    Hi Salamy, Sami,

    Thanks for getting back, please try below troubleshooting steps:

    The error ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) typically indicates that the connection to the Azure service was abruptly closed by the remote server.

    1. How can I get more info regarding this error? To get more information about the error, you can enable debug logging in the libcloud library, check Azure Service Health, and If the error is due to rate limiting or other server-side issues, the response headers might contain useful information.
    2. What is the default timeout for the AZURE_ARM configured driver? The default timeout for the AZURE_ARM driver in libcloud is typically 60 seconds for both connection and read timeouts. This is defined in the libcloud.http.LibcloudConnection class.
    3. Which params should we add in order to manually change the timeout, can I use timeout=GENERAL_TIMEOUT or ex_connection_kwargs={'timeout': (CONNNECTION_TIMEOUT, READ_TIMEOUT)} You can change the timeout by passing the timeout parameter when initializing the driver. The timeout parameter can be a single value (for both connection and read timeouts) or a tuple (connection_timeout, read_timeout). Alternatively, you can use ex_connection_kwargs to pass additional connection arguments.
    4. What other reasons might return such general error? Rate limit? Can we increase it? The ConnectionResetError could occur due to several reasons like Network issues, Server-side issues, Rate limiting, Firewall or security settings, Timeouts.

    If you have any further queries, please do let us know. If the answer is helpful, please click "Accept Answer" and "Upvote it"

    User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.