{"record":{"id":"f870aa7acfabfb82","repo":"ZhuLinsen/daily_stock_analysis","slug":"feed-response-is-too-large","errorCode":null,"errorMessage":"feed response is too large","messagePattern":"feed response is too large","errorType":"exception","errorClass":"IntelligenceServiceError","httpStatus":400,"severity":"error","filePath":"src/services/intelligence_service.py","lineNumber":484,"sourceCode":"                    request_url = urljoin(request_url, location)\n                    self._validate_url(request_url)\n                    continue\n                response.raise_for_status()\n                break\n            else:\n                raise IntelligenceServiceError(f\"feed redirect chain exceeds {_MAX_FEED_REDIRECTS}\")\n\n            self._validate_url(response.url or request_url)\n\n            if hasattr(response, \"iter_content\") and callable(response.iter_content):\n                chunks = []\n                total = 0\n                for chunk in response.iter_content(chunk_size=8192):\n                    if not chunk:\n                        continue\n                    total += len(chunk)\n                    if total > _MAX_FEED_BYTES:\n                        raise IntelligenceServiceError(\"feed response is too large\")\n                    chunks.append(chunk)\n                content = b\"\".join(chunks)\n            else:\n                content = response.content[: _MAX_FEED_BYTES + 1]\n                if len(content) > _MAX_FEED_BYTES:\n                    raise IntelligenceServiceError(\"feed response is too large\")\n            return self._parse_feed(content, source_name=fields[\"name\"], limit=limit)\n        except IntelligenceServiceError:\n            raise\n        except Exception as exc:\n            raise IntelligenceServiceError(_UPSTREAM_FETCH_FAILURE_MESSAGE) from exc\n        finally:\n            if response is not None:\n                response.close()\n\n    def _fetch_newsnow_entries(self, fields: Dict[str, Any], *, limit: int) -> List[FeedEntry]:\n        timeout = max(1, min(float(self.config.news_intel_fetch_timeout_sec), 30.0))\n        headers = {","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/ZhuLinsen/daily_stock_analysis/blob/5159bd72e8373d215492dff122acc9d389e219c9/src/services/intelligence_service.py#L466-L502","documentation":"Error \"feed response is too large\" thrown in ZhuLinsen/daily_stock_analysis.","triggerScenarios":"Thrown at src/services/intelligence_service.py:484 when the library encounters an invalid state.","commonSituations":"Raised when a feed response body exceeds the size cap; occurs with abnormally large feeds, truncated to protect memory.","solutions":["Use a feed URL that returns a reasonably sized response.","If the feed is legitimate, paginate or filter at the source rather than fetching a huge document.","Check the endpoint is really an RSS/Atom feed and not a large HTML page or file download."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5159bd72e8373d215492dff122acc9d389e219c9","analyzedAt":"2026-08-15T01:59:36.292Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}