{"record":{"id":"828e140bf0c41f87","repo":"vxcontrol/pentagi","slug":"there-had-a-problem-with-our-server-try-again-lat-828e14","errorCode":null,"errorMessage":"there had a problem with our server. try again later","messagePattern":"there had a problem with our server\\. try again later","errorType":"http","errorClass":"Retryable","httpStatus":500,"severity":"warning","filePath":"backend/pkg/tools/searchers/tavily.go","lineNumber":162,"sourceCode":"\t\tvar respBody tavilySearchResult\n\t\tif err := json.NewDecoder(resp.Body).Decode(&respBody); err != nil {\n\t\t\treturn \"\", Fatal(fmt.Errorf(\"failed to decode response body: %v\", err))\n\t\t}\n\t\treturn t.buildTavilyResult(ctx, &respBody), nil\n\tcase http.StatusBadRequest:\n\t\treturn \"\", Fatal(fmt.Errorf(\"request is invalid\"))\n\tcase http.StatusUnauthorized:\n\t\treturn \"\", Fatal(fmt.Errorf(\"API key is wrong\"))\n\tcase http.StatusForbidden:\n\t\treturn \"\", Fatal(fmt.Errorf(\"the endpoint requested is hidden for administrators only\"))\n\tcase http.StatusNotFound:\n\t\treturn \"\", Fatal(fmt.Errorf(\"the specified endpoint could not be found\"))\n\tcase http.StatusMethodNotAllowed:\n\t\treturn \"\", Fatal(fmt.Errorf(\"there need to try to access an endpoint with an invalid method\"))\n\tcase http.StatusTooManyRequests:\n\t\treturn \"\", Retryable(fmt.Errorf(\"there are requesting too many results\"), 0)\n\tcase http.StatusInternalServerError:\n\t\treturn \"\", Retryable(fmt.Errorf(\"there had a problem with our server. try again later\"), 0)\n\tcase http.StatusBadGateway:\n\t\treturn \"\", Retryable(fmt.Errorf(\"there was a problem with the server. Please try again later\"), 0)\n\tcase http.StatusServiceUnavailable:\n\t\treturn \"\", Retryable(fmt.Errorf(\"there are temporarily offline for maintenance. please try again later\"), 0)\n\tcase http.StatusGatewayTimeout:\n\t\treturn \"\", Retryable(fmt.Errorf(\"there are temporarily offline for maintenance. please try again later\"), 0)\n\tdefault:\n\t\treturn \"\", Fatal(fmt.Errorf(\"unexpected status code: %d\", resp.StatusCode))\n\t}\n}\n\nfunc (t *tavily) buildTavilyResult(ctx context.Context, result *tavilySearchResult) string {\n\tvar writer strings.Builder\n\twriter.WriteString(\"# Answer\\n\\n\")\n\twriter.WriteString(result.Answer)\n\twriter.WriteString(\"\\n\\n# Links\\n\\n\")\n\n\tisRawContentExists := false","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/tools/searchers/tavily.go#L144-L180","documentation":"Thrown in tavily.parseHTTPResponse when Tavily answers HTTP 500 Internal Server Error, mapped to \"there had a problem with our server. try again later\". This is a server-side failure at Tavily, not a problem with your request. It is classified Retryable(err, 0) so the orchestrator can retry or fall back to another search engine.","triggerScenarios":"POST to api.tavily.com/search returns 500: a transient Tavily backend failure, capacity problem during peak load, or a fault triggered by an unusual query (very long/odd content) crashing part of their pipeline.","commonSituations":"Tavily incidents/outages (check status.tavily.com); repeated 500s across many different queries during a known outage window; isolated 500 on one exotic query that their backend chokes on; regional infrastructure issues.","solutions":["Retry after a short delay — the error is Retryable, so confirm the orchestrator's retry/backoff and fallback engine chain are active.","Check Tavily's status page or dashboard for an ongoing incident; wait it out if so.","If one specific query reliably 500s, simplify it (shorter, remove special characters) — it may trip a server-side bug; report it to Tavily support.","Verify network path is not returning a synthetic 500 (proxy error pages can mimic 500s) with curl from the container.","Reduce reliance on a single engine by keeping fallback searchers configured in web_search's fallbackStrategy."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"var re *RetryableError\nif errors.As(err, &re) && strings.Contains(err.Error(), \"problem with our server\") {\n    if retryN < maxRetries {\n        time.Sleep(backoff(retryN))\n        return retry(retryN + 1)\n    }\n    return fallbackSearcher.Handle(ctx, req) // engine-level fallback after retries exhausted\n}","preventionTips":["Configure exponential backoff with a small retry count; 500s are usually transient.","Subscribe to Tavily status updates to correlate outages with bursts of 500s.","Always keep a fallback engine in the web_search chain.","Log the query when a 500 occurs to detect queries that deterministically trip server-side bugs."],"tags":["http-500","server-error","searchers","retryable","upstream"],"backgroundTag":"upstream-server-error","analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}