subhra74/xdm · error

Connectivity error

Error message

Connectivity error

What it means

NetFxHttpClient.Send wraps WebException from the underlying HttpWebRequest. When the WebException carries no Response object, the request never reached a server (DNS failure, TCP connect failure, TLS failure), so there is no response to process; it throws a plain Exception with the message 'Connectivity error'.

Solutions

  1. Verify network connectivity and DNS resolution for the target host (ping/nslookup the URL's host)
  2. Check configured proxy settings; a bad proxy causes WebException with a null Response
  3. Catch this exception in download orchestration and retry with backoff, since it is usually transient
  4. Check firewall/antivirus blocking the XDM process's outbound connections

Example fix

// before
client.Send(req); // raw Exception("Connectivity error") on network failure
// after
try
{
    client.Send(req);
}
catch (Exception ex) when (ex.Message == "Connectivity error")
{
    Log.Warn("Network unreachable, will retry");
    await Task.Delay(TimeSpan.FromSeconds(5));
    // retry or mark link as failed
}
Defensive patterns

Strategy: retry

Validate before calling

// Pre-check reachability before Send
using (var ping = new System.Net.NetworkInformation.Ping())
{
    var reply = ping.Send(host, 2000);
    if (reply.Status != IPStatus.Success) throw new InvalidOperationException("Network unreachable for " + host);
}

Try / catch

try
{
    response = client.Send(request);
}
catch (Exception ex) when (ex.Message == "Connectivity error")
{
    // no response arrived: transient network problem, safe to retry
    await Task.Delay(backoff);
    response = client.Send(request);
}

Prevention

When it happens

Trigger: Calling Send on NetFxHttpClient when the network is down, the host cannot be resolved, the connection is refused, or the TLS handshake fails before any HTTP response is received.

Common situations: Offline machine or Wi-Fi drop during a download; wrong proxy settings in Windows; firewall or antivirus blocking the connection; DNS misconfiguration; server hostname no longer valid.

Related errors


AI-assisted analysis of subhra74/xdm@1ca5a25aae (2026-09-13). Data as JSON: /api/errors/e75987c6286c4ecb. Report an issue: GitHub.

Appendix: source

Thrown at app/XDM/XDM.Core/Clients/Http/NetFxHttpClient.cs:138

            if (request.Session is not NetFxHttpSession session)
            {
                throw new ArgumentNullException(nameof(request.Session));
            }
            if (session.Request == null)
            {
                throw new ArgumentNullException(nameof(session.Request));
            }
            r = session.Request;
            try
            {
                response = (HttpWebResponse)r.GetResponse();
            }
            catch (WebException we)
            {
                Log.Debug(we, we.Message);
                if (we.Response == null)
                {
                    throw new Exception("Connectivity error");
                }
                response = (HttpWebResponse?)we.Response!;
                response.Discard();
                response.Close();
            }

            var servicePoint = r.ServicePoint;
            if (servicePoint != null)
            {
                servicePoints.Add(servicePoint);
            }
            session.Response = response;
            return new HttpResponse { Session = session };
        }

        public void Dispose()
        {
            lock (this)

View on GitHub (pinned to 1ca5a25aae)