{"record":{"id":"57991e635b983933","repo":"docmirror/dev-sidecar","slug":"speed-test-error-this-hostname-item-ho","errorCode":null,"errorMessage":"[speed] test error:   ${this.hostname} ➜ ${item.host}:${this.port} from DNS '${item.dns}', errorMsg: ${e.message}","messagePattern":"\\[speed\\] test error:   (.+?) ➜ (.+?):(.+?) from DNS '(.+?)', errorMsg: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/mitmproxy/src/lib/speed/SpeedTester.js","lineNumber":224,"sourceCode":"    } finally {\n      this.isTestingBackups = false\n    }\n  }\n\n  async _doTest (item, aliveList) {\n    try {\n      const ret = await this.testOne(item)\n      item.title = `${ret.by}测速成功：${ret.target}`\n      log.info(`[speed] test success: ${this.hostname} ➜ ${item.host}:${this.port} from DNS '${item.dns}'`)\n      _.merge(item, ret)\n      aliveList.push({ ...ret, ...item })\n    } catch (e) {\n      if (item.time == null) {\n        item.title = e.message\n        item.status = 'failed'\n      }\n      if (!e.message.includes('timeout')) {\n        log.warn(`[speed] test error:   ${this.hostname} ➜ ${item.host}:${this.port} from DNS '${item.dns}', errorMsg: ${e.message}`)\n      }\n    }\n  }\n\n  testByTCP (item) {\n    return new Promise((resolve, reject) => {\n      const { host, dns } = item\n      const startTime = Date.now()\n\n      let isOver = false\n      const timeout = 5000\n      let timeoutId = null\n\n      const client = net.createConnection({ host, port: this.port, family: host.includes(':') ? 6 : 4 }, () => {\n        isOver = true\n        clearTimeout(timeoutId)\n\n        const connectionTime = Date.now()","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/docmirror/dev-sidecar/blob/7710cd56cce760c708f30b01d2d4056eb8c402d5/packages/mitmproxy/src/lib/speed/SpeedTester.js#L206-L242","documentation":"SpeedTester._doTest logs a warning when testing a candidate IP (host:port for a domain, via a specific DNS provider) throws and the failure is not a timeout. The candidate item is marked status 'failed' with the error as its title; the tester then moves on to other backups, so overall IP selection usually still succeeds.","triggerScenarios":"During testBackups → _doTest, connecting to a candidate IP throws a non-timeout error: ECONNREFUSED (IP dead/blocked), EHOSTUNREACH, TLS handshake failure for https probes, or DNS resolution failure for item.dns.","commonSituations":"Preset/backup IP lists going stale (IPs no longer serving the domain); GFW/ISP blocking certain IPs; DoH/DoT provider unreachable; firewall on the local network blocking the probe port.","solutions":["Check the errorMsg in the log: ECONNREFUSED/EHOSTUNREACH means the candidate IP is dead — remove or update it in dns/providers or preset IP config","If the DNS provider failed, switch to a reachable one (e.g. aliyun/google) in config","Verify no local firewall blocks outbound connections to the tested port","Nothing to fix if other backups pass — this is expected failover behavior; the fastest working IP is still chosen"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await tester.testOne(candidate)\n} catch (e) {\n  if (!String(e.message).includes('timeout')) {\n    log.warn('candidate unreachable, trying next backup', e.message)\n  }\n  // tester already marks item failed; proceed to next backup\n}","preventionTips":["Refresh preset/backup IP lists periodically — stale IPs are the main cause","Configure multiple DNS providers so a dead DoH/DoT endpoint doesn't fail all probes","Ignore non-timeout warnings when other backups succeed — failover is by design","Check RequestCounter stats (3 consecutive errors / <40% success) to see if a backend is flapping"],"tags":["network","speed-test","failover"],"backgroundTag":"speed-test-failed","analyzedSha":"7710cd56cce760c708f30b01d2d4056eb8c402d5","analyzedAt":"2026-08-31T22:07:07.234Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}