iflytek/astron-agent · error · Exception

Local file does not exist

Error message

Local file does not exist: {file}

What it means

_read_local_file raises when the given local path does not exist on disk (os.path.exists fails). The ingestion path expected a readable file but got a missing/stale path — a filesystem-input validation before open().

Solutions

  1. Verify the file path and that the file was uploaded/cleaned correctly
  2. Check mount/volume configuration if running in containers
  3. Handle missing files gracefully in the upload pipeline
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at core/knowledge/infra/ragflow/ragflow_utils.py:250 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/21457e8c63a4cab1. Report an issue: GitHub.

Appendix: source

Thrown at core/knowledge/infra/ragflow/ragflow_utils.py:250

            filename = urllib.parse.unquote(raw_filename, encoding="utf-8")

        return filename

    @staticmethod
    def _read_local_file(file: str) -> tuple[bytes, str]:
        """
        Read local file

        Args:
            file: Local file path

        Returns:
            (file content, filename)
        """
        logger.info(f"Reading local file: {file}")

        if not os.path.exists(file):
            raise Exception(f"Local file does not exist: {file}")

        with open(file, "rb") as f:
            file_content = f.read()
        filename = os.path.basename(file)

        logger.info(
            f"Local file reading completed: {filename}, size: {len(file_content)} bytes"
        )
        return file_content, filename

    @staticmethod
    async def process_file(file_input: Union[str, UploadFile]) -> tuple[bytes, str]:
        """
        Process file (download, read local file, or handle upload file)

        Args:
            file_input: File path/URL (str) or UploadFile object

View on GitHub (pinned to 5e758547a8)