Troubleshooting Common .NET HTTP Connection Errors

The first is to identify whether the error is with the client or server (or even intermediaries). Most of the errors begin with “The underlying connection was closed: “…

Indications of client error

  • An unexpected error occurred on a send – Could be due to:
    • antivirus software installed on the client machine

 

Indications of intermediary error

  • The remote name could not be resolved or The proxy name could not be resolved – Could be due to:
    • DNS issue
    • inability to access the hosts file
  • Unable to connect to the remote server – Likely to have gotten through the DNS but hit a connection glitch due to:
    • proxy
    • firewall
    • network authentication

 

Indications of server error or intermediaries (e.g. load balancer, proxy, etc.)

  • An unexpected error occurred on a receive – Server or intermediary unexpectedly closes the TCP connection. May be due to:
    • Server or intermediary timeout values set too low (TODO: increase the client’s request timeout & also the server’s execution timeout such that client’s request timeout < intermediary’s < server’s)
    • Server crashes (TODO: check the server logs)
  • The request was canceled or The connection was closed unexpectedly – Server or intermediary cancels the TCP connection (TCP RSET). May be due to:
    • low (execution) timeout setting on the server or intermediary (TODO: increase the client’s request timeout & also the server’s execution timeout such that client’s request timeout < intermediary’s < server’s)
    • low keep-alive timeout setting on the server or intermediary (TODO: set client’s keep-alive timeout < intermediary’s < server’s)
    • Although improbable, it could be the result of insufficient concurrent connections at the client machine (typically defaulted to 2 by ServicePointManager.DefaultConnectionLimit). This is aggravated by slow processing at the server side
  • Could not establish trust relationship for the SSL/TLS secure channel -
    • Root and chain certificates are not installed correctly (TODO: install in the Local Machine store)
  • A connection that was expected to be kept alive was closed by the server – Server or intermediary closed the connection that is to be kept-alive due to:
    • client’s keep-alive timeout is longer than that of the server or intermediary (TODO: set client’s keep-alive timeout < intermediary’s < server’s)
  • The operation has timed out – Could be due to:
    • stale DNS entry for the proxy
    • socket timed-out before the response is returned (TODO: increase the client’s request timeout & read-write timeout. Increase the server’s execution timeout)
    • insufficient connection at the server such that no connection thread is available (TODO: increase server’s max connection to 12x number of processors)

    Comments

    Popular posts from this blog

    Understanding ITIL Service Management the UML way…

    How to depict (Professional-Looking) Logical Network Diagrams in Astah