{"record":{"id":"25bfef47ce7ca473","repo":"iflytek/astron-agent","slug":"file-download-failed-http-response-status","errorCode":null,"errorMessage":"File download failed: HTTP {response.status}","messagePattern":"File download failed: HTTP (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"core/knowledge/infra/ragflow/ragflow_utils.py","lineNumber":194,"sourceCode":"            )\n\n    @staticmethod\n    async def _download_url_file(file: str) -> tuple[bytes, str]:\n        \"\"\"\n        Download file from URL\n\n        Args:\n            file: File URL\n\n        Returns:\n            (file content, filename)\n        \"\"\"\n        logger.info(f\"Downloading file from URL: {file}\")\n\n        async with aiohttp.ClientSession() as session:\n            async with session.get(file) as response:\n                if response.status != 200:\n                    raise Exception(f\"File download failed: HTTP {response.status}\")\n\n                file_content = await response.read()\n                logger.info(f\"Download completed: {len(file_content)} bytes\")\n\n                # Get filename\n                filename = RagflowUtils._extract_filename_from_url(file, response)\n\n                # Validate downloaded content\n                if len(file_content) == 0:\n                    raise Exception(\"Downloaded file is empty\")\n\n                return file_content, filename\n\n    @staticmethod\n    def _extract_filename_from_url(file: str, response: Any) -> str:\n        \"\"\"\n        Extract filename from URL or response\n","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/knowledge/infra/ragflow/ragflow_utils.py#L176-L212","documentation":"_download_url_file raises when fetching a document from an HTTP(S) URL returns a non-200 status. The knowledge ingestion pipeline cannot obtain the file bytes, so processing for that URL must stop; the HTTP status is embedded for diagnosis.","triggerScenarios":"Thrown at core/knowledge/infra/ragflow/ragflow_utils.py:194 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the URL is publicly reachable (no 401/403/404)","Check for expired signed URLs or blocked egress","Retry with backoff for transient 5xx responses"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}