{"record":{"id":"20148f7b3ca05d0f","repo":"ZhuLinsen/daily_stock_analysis","slug":"feed-redirect-chain-exceeds-max-feed-redirects","errorCode":null,"errorMessage":"feed redirect chain exceeds {_MAX_FEED_REDIRECTS}","messagePattern":"feed redirect chain exceeds (.+?)","errorType":"exception","errorClass":"IntelligenceServiceError","httpStatus":400,"severity":"error","filePath":"src/services/intelligence_service.py","lineNumber":472,"sourceCode":"                    request_url,\n                    timeout=timeout,\n                    headers=headers,\n                    allow_redirects=False,\n                    stream=True,\n                )\n                status_code = int(getattr(response, \"status_code\", 200))\n                if status_code in _REDIRECT_STATUS_CODES:\n                    location = getattr(response, \"headers\", {}).get(\"Location\")\n                    if not location:\n                        raise IntelligenceServiceError(\"feed redirect missing Location header\")\n                    response.close()\n                    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\")","sourceCodeStart":454,"sourceCodeEnd":490,"githubUrl":"https://github.com/ZhuLinsen/daily_stock_analysis/blob/5159bd72e8373d215492dff122acc9d389e219c9/src/services/intelligence_service.py#L454-L490","documentation":"Error \"feed redirect chain exceeds {_MAX_FEED_REDIRECTS}\" thrown in ZhuLinsen/daily_stock_analysis.","triggerScenarios":"Thrown at src/services/intelligence_service.py:472 when the library encounters an invalid state.","commonSituations":"Raised when a feed redirect chain exceeds the maximum allowed hops; occurs with redirect loops or overly long chains from the feed provider.","solutions":["Update the source URL to the final destination to skip the redirect chain.","Check for redirect loops at the feed provider.","Replace the source if the provider keeps chaining redirects."],"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"}