{"record":{"id":"1a8f991526995bdb","repo":"assafelovic/gpt-researcher","slug":"fastcrw-api-search-failed","errorCode":null,"errorMessage":"fastCRW API search failed.","messagePattern":"fastCRW API search failed\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"gpt_researcher/retrievers/crw/crw.py","lineNumber":98,"sourceCode":"        \"\"\"\n\n        data = {\n            \"query\": query,\n            \"limit\": max_results,\n        }\n\n        response = requests.post(\n            f\"{self.base_url}/v1/search\",\n            data=json.dumps(data),\n            headers=self.headers,\n            timeout=100,\n        )\n        # Raises a HTTPError if the HTTP request returned an unsuccessful status code\n        response.raise_for_status()\n        results = response.json()\n        # fastCRW wraps responses in a {success, error, data} envelope.\n        if results.get(\"success\") is False:\n            raise Exception(results.get(\"error\", \"fastCRW API search failed.\"))\n        return results\n\n    def search(self, max_results=10):\n        \"\"\"\n        Searches the query\n        Returns:\n\n        \"\"\"\n        try:\n            # Search the query\n            results = self._search(self.query, max_results=max_results)\n            sources = results.get(\"data\") or []\n            if not isinstance(sources, list) or not sources:\n                raise Exception(\"No results found with fastCRW API search.\")\n            # Return the results. A source missing \"url\" is unusable, so skip it\n            # rather than raising a KeyError that discards the whole result set.\n            search_response = []\n            for obj in sources:","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/assafelovic/gpt-researcher/blob/6f998577d547b1e54ec662dac63583aa11e3b84b/gpt_researcher/retrievers/crw/crw.py#L80-L116","documentation":"Exception raised by the fastCRW retriever's _search when the API responds successfully at the HTTP level but the JSON envelope has success == false. The message is the API's own error text, defaulting to \"fastCRW API search failed.\" when the envelope omits it.","triggerScenarios":"Calling search() → _search() which POSTs/GETs the fastCRW endpoint; response.raise_for_status() passes, but results.get(\"success\") is False.","commonSituations":"Invalid/expired fastCRW credentials, quota exceeded, malformed query params, or an upstream fastCRW service error — all reported via the envelope rather than an HTTP status code.","solutions":["Read the exception text — it's the fastCRW error message naming the real cause.","Verify your fastCRW credentials/endpoint configuration and remaining quota.","Retry once after a short delay for transient service errors.","Check the fastCRW API docs for the error code in the message."],"exampleFix":"# before\nresults = retriever.search(max_results=10)\n\n# after\ntry:\n    results = retriever.search(max_results=10)\nexcept Exception as e:\n    logger.warning(f\"fastCRW search failed: {e}\")\n    results = []","handlingStrategy":"fallback","validationCode":"null","typeGuard":"null","tryCatchPattern":"try:\n    results = retriever.search(max_results=10)\nexcept Exception as e:\n    logger.warning(f\"fastCRW error: {e}\")\n    results = fallback_retriever.search(max_results=10)","preventionTips":["Log the envelope error message to distinguish auth/quota/service failures.","Add a secondary retriever as fallback.","Retry once for transient upstream errors."],"tags":["fastcrw","api-error","search","envelope-error"],"backgroundTag":"api-envelope-error","analyzedSha":"6f998577d547b1e54ec662dac63583aa11e3b84b","analyzedAt":"2026-08-28T17:50:07.383Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}