{"record":{"id":"e75987c6286c4ecb","repo":"subhra74/xdm","slug":"connectivity-error","errorCode":null,"errorMessage":"Connectivity error","messagePattern":"Connectivity error","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/XDM/XDM.Core/Clients/Http/NetFxHttpClient.cs","lineNumber":138,"sourceCode":"            if (request.Session is not NetFxHttpSession session)\r\n            {\r\n                throw new ArgumentNullException(nameof(request.Session));\r\n            }\r\n            if (session.Request == null)\r\n            {\r\n                throw new ArgumentNullException(nameof(session.Request));\r\n            }\r\n            r = session.Request;\r\n            try\r\n            {\r\n                response = (HttpWebResponse)r.GetResponse();\r\n            }\r\n            catch (WebException we)\r\n            {\r\n                Log.Debug(we, we.Message);\r\n                if (we.Response == null)\r\n                {\r\n                    throw new Exception(\"Connectivity error\");\r\n                }\r\n                response = (HttpWebResponse?)we.Response!;\r\n                response.Discard();\r\n                response.Close();\r\n            }\r\n\r\n            var servicePoint = r.ServicePoint;\r\n            if (servicePoint != null)\r\n            {\r\n                servicePoints.Add(servicePoint);\r\n            }\r\n            session.Response = response;\r\n            return new HttpResponse { Session = session };\r\n        }\r\n\r\n        public void Dispose()\r\n        {\r\n            lock (this)\r","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/subhra74/xdm/blob/1ca5a25aae007826c859c81bea494e7c102e1242/app/XDM/XDM.Core/Clients/Http/NetFxHttpClient.cs#L120-L156","documentation":"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'.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify network connectivity and DNS resolution for the target host (ping/nslookup the URL's host)","Check configured proxy settings; a bad proxy causes WebException with a null Response","Catch this exception in download orchestration and retry with backoff, since it is usually transient","Check firewall/antivirus blocking the XDM process's outbound connections"],"exampleFix":"// before\nclient.Send(req); // raw Exception(\"Connectivity error\") on network failure\n// after\ntry\n{\n    client.Send(req);\n}\ncatch (Exception ex) when (ex.Message == \"Connectivity error\")\n{\n    Log.Warn(\"Network unreachable, will retry\");\n    await Task.Delay(TimeSpan.FromSeconds(5));\n    // retry or mark link as failed\n}","handlingStrategy":"retry","validationCode":"// Pre-check reachability before Send\nusing (var ping = new System.Net.NetworkInformation.Ping())\n{\n    var reply = ping.Send(host, 2000);\n    if (reply.Status != IPStatus.Success) throw new InvalidOperationException(\"Network unreachable for \" + host);\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    response = client.Send(request);\n}\ncatch (Exception ex) when (ex.Message == \"Connectivity error\")\n{\n    // no response arrived: transient network problem, safe to retry\n    await Task.Delay(backoff);\n    response = client.Send(request);\n}","preventionTips":["Check network/proxy availability before starting large downloads","Retry Send with exponential backoff; connectivity errors are usually transient","Verify URL hostnames resolve (DNS) before queuing the download","Review Windows proxy and firewall/AV settings if errors persist"],"tags":["network","http","connectivity","retry"],"backgroundTag":"network-request-failed","analyzedSha":"1ca5a25aae007826c859c81bea494e7c102e1242","analyzedAt":"2026-09-13T20:37:40.968Z","contentChangedAt":"2026-09-13T20:37:40.968Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}