microsoft/graphrag · error · ValueError

Could not find {filename} in storage!

Error message

Could not find {filename} in storage!

What it means

CSVTableProvider.read_dataframe maps table_name to '{table_name}.csv' and first calls storage.has(filename); if the file is not present it raises ValueError rather than letting pandas throw a confusing FileNotFoundError. It means the output table was never written to that storage location.

Source

Thrown at packages/graphrag-storage/graphrag_storage/tables/csv_table_provider.py:66

            table_name: str
                The name of the table to read. The file will be accessed as '{table_name}.csv'.

        Returns
        -------
            pd.DataFrame:
                The table data loaded from the csv file.

        Raises
        ------
            ValueError:
                If the table file does not exist in storage.
            Exception:
                If there is an error reading or parsing the csv file.
        """
        filename = f"{table_name}.csv"
        if not await self._storage.has(filename):
            msg = f"Could not find {filename} in storage!"
            raise ValueError(msg)
        try:
            logger.info("reading table from storage: %s", filename)
            csv_data = await self._storage.get(filename, as_bytes=False)
            # Handle empty CSV (pandas can't parse files with no columns)
            if not csv_data or csv_data.strip() == "":
                return pd.DataFrame()
            return pd.read_csv(StringIO(csv_data), keep_default_na=False)
        except Exception:
            logger.exception("error loading table from storage: %s", filename)
            raise

    async def write_dataframe(self, table_name: str, df: pd.DataFrame) -> None:
        """Write a pandas DataFrame to storage as a CSV file.

        Args
        ----
            table_name: str
                The name of the table to write. The file will be saved as '{table_name}.csv'.

View on GitHub (pinned to f40e9a26ce)

Solutions

  1. Run the indexing pipeline to generate the CSV outputs first
  2. Verify the storage base_dir/root and that <base>/<table>.csv actually exists (ls output/)
  3. Check table-name spelling and that you're reading from the same environment/filesystem the indexer wrote to

Example fix

# before
df = await provider.read_dataframe("create_base_entities")
# after
# ensure output/create_base_entities.csv exists (run: python -m graphrag index --root .)
df = await provider.read_dataframe("create_base_entities")
Defensive patterns

Strategy: try-catch

Validate before calling

if not await provider._storage.has(f"{table_name}.csv"):
    raise RuntimeError(f"index outputs missing: {table_name}.csv")

Try / catch

try:
    df = await provider.read_dataframe(t)
except ValueError as e:
    if "Could not find" in str(e):
        df = pd.DataFrame()  # or trigger indexing
    else:
        raise

Prevention

When it happens

Trigger: Awaiting read_dataframe('my_table') when output/my_table.csv does not exist — either before indexing, with the wrong root/base_dir, or after outputs were written to a different storage account/container.

Common situations: Running queries before 'graphrag index' completes; wrong --root or base_dir; file present locally but process runs in a container with a different mounted volume; case-sensitivity mismatch on the table name.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of microsoft/graphrag@f40e9a26ce (2026-08-27). Data as JSON: /api/errors/a2d303c5d240981e. Report an issue: GitHub.