{"record":{"id":"9a87d584729c77ce","repo":"diegosouzapw/OmniRoute","slug":"1proxy-api-returned-response-status","errorCode":null,"errorMessage":"1proxy API returned ${response.status}","messagePattern":"1proxy API returned (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/oneproxySync.ts","lineNumber":97,"sourceCode":"      total: 0,\n      error: `Circuit breaker: ${consecutiveFailures} consecutive failures. Reset required.`,\n    };\n  }\n\n  let added = 0;\n  let updated = 0;\n  let failed = 0;\n  let offset = 0;\n\n  try {\n    while (true) {\n      const url = `${apiUrl}/api/v1/proxies/advanced?limit=${DEFAULT_PAGE_SIZE}&offset=${offset}&min_quality=${minQuality}&is_working=true`;\n      const response = await fetch(url, {\n        signal: AbortSignal.timeout(30000),\n      });\n\n      if (!response.ok) {\n        throw new Error(`1proxy API returned ${response.status}`);\n      }\n\n      const data = (await response.json()) as OneProxyApiResponse;\n      if (!data.proxies || data.proxies.length === 0) break;\n\n      for (const proxy of data.proxies) {\n        if (added + updated >= maxProxies) break;\n\n        try {\n          const result = await upsertOneproxyProxy({\n            ip: proxy.ip,\n            port: proxy.port,\n            protocol: proxy.protocol,\n            countryCode: proxy.country_code,\n            anonymity: proxy.anonymity,\n            qualityScore: proxy.quality_score,\n            latencyMs: proxy.latency_ms,\n            googleAccess: proxy.can_access_google,","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oneproxySync.ts#L79-L115","documentation":"Inside the 1proxy fetch loop, a page from /api/v1/proxies/advanced returned a non-2xx status. The status code is embedded in the message; the outer routine counts it toward the circuit-breaker's consecutive-failure counter.","triggerScenarios":"Thrown at src/lib/oneproxySync.ts:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check 1proxy service health and the configured apiUrl","Verify API credentials/quota if the status is 401/403/429","Wait for the circuit breaker to reset after repeated failures","Retry once the upstream recovers — the breaker reset clears the state"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}