{"record":{"id":"268fa2ae47a82b33","repo":"vxcontrol/pentagi","slug":"request-to-sploitus-failed-w","errorCode":null,"errorMessage":"request to Sploitus failed: %w","messagePattern":"request to Sploitus failed: %w","errorType":"exception","errorClass":"Retryable","httpStatus":null,"severity":"warning","filePath":"backend/pkg/tools/searchers/sploitus.go","lineNumber":155,"sourceCode":"\n\t// Mimic Chrome browser headers to bypass Cloudflare protection\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treq.Header.Set(\"Accept-Language\", \"en-US,en;q=0.9\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.Header.Set(\"Origin\", \"https://sploitus.com\")\n\treq.Header.Set(\"Referer\", referer)\n\treq.Header.Set(\"User-Agent\", \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36\")\n\treq.Header.Set(\"sec-ch-ua\", `\"Not:A-Brand\";v=\"99\", \"Google Chrome\";v=\"145\", \"Chromium\";v=\"145\"`)\n\treq.Header.Set(\"sec-ch-ua-mobile\", \"?0\")\n\treq.Header.Set(\"sec-ch-ua-platform\", `\"macOS\"`)\n\treq.Header.Set(\"sec-fetch-dest\", \"empty\")\n\treq.Header.Set(\"sec-fetch-mode\", \"cors\")\n\treq.Header.Set(\"sec-fetch-site\", \"same-origin\")\n\treq.Header.Set(\"DNT\", \"1\")\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn \"\", Retryable(fmt.Errorf(\"request to Sploitus failed: %w\", err), 0)\n\t}\n\tdefer resp.Body.Close()\n\n\t// Sploitus API returns 499 (and sometimes 422) when its rate limit is temporarily\n\t// exceeded — a transient condition that may clear on retry.\n\tif resp.StatusCode == 499 || resp.StatusCode == 422 {\n\t\treturn \"\", Retryable(fmt.Errorf(\"Sploitus API rate limit exceeded (HTTP %d), please try again later\", resp.StatusCode), 0)\n\t}\n\n\tif resp.StatusCode != http.StatusOK {\n\t\terr := fmt.Errorf(\"Sploitus API returned HTTP %d\", resp.StatusCode)\n\t\tif resp.StatusCode == http.StatusTooManyRequests || resp.StatusCode >= 500 {\n\t\t\treturn \"\", Retryable(err, 0)\n\t\t}\n\t\treturn \"\", Fatal(err)\n\t}\n\n\tvar apiResp sploitusResponse","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/tools/searchers/sploitus.go#L137-L173","documentation":"client.Do(req) failed at the transport level (DNS failure, connection refused/reset, TLS error, timeout, or context cancellation); the searcher classifies this as Retryable with delay 0 so the web_search orchestrator may retry against fallback engines. Sploitus sits behind Cloudflare, so blocked/intercepted connections can also surface here.","triggerScenarios":"Handle() calls client.Do(req) on the POST to sploitus.com; any error from the http.Client transport — network unreachable, DNS NXDOMAIN, sploitusRequestTimeout exceeded, ctx cancelled, TLS handshake failure.","commonSituations":"The PentAGI container has no outbound internet or DNS, a corporate proxy blocks sploitus.com, the timeout (sploitusRequestTimeout) is too small for slow networks, or the request context is cancelled when the flow is aborted.","solutions":["Read the wrapped error: 'no such host' => fix DNS, 'connection refused' => check outbound firewall/proxy","Confirm the container can reach https://sploitus.com (curl from inside the container)","Check whether sploitusRequestTimeout is too short and raise it if requests are timing out","Verify the flow context was not cancelled upstream; if intentional, ignore this error"],"exampleFix":"// before\nclient.Timeout = 2 * time.Second // too tight on slow links\n// after\nclient.Timeout = 15 * time.Second","handlingStrategy":"retry","validationCode":"if err := ctx.Err(); err != nil {\n    return fmt.Errorf(\"context already cancelled: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"resp, err := client.Do(req)\nif err != nil {\n    // Retryable: attempt backoff or fall back to another searcher engine\n    return \"\", Retryable(fmt.Errorf(\"request to Sploitus failed: %w\", err), 0)\n}","preventionTips":["Ensure the container has outbound DNS + HTTPS access before enabling the engine","Set a realistic client timeout (10-15s) for external APIs","Configure multiple search engines so web_search fallback chains engage","Check proxy/firewall rules for sploitus.com in corporate environments"],"tags":["network","http-client","timeout","retryable"],"backgroundTag":"http-request-failed","analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}