{"record":{"id":"a2d303c5d240981e","repo":"microsoft/graphrag","slug":"could-not-find-filename-in-storage","errorCode":null,"errorMessage":"Could not find {filename} in storage!","messagePattern":"Could not find (.+?) in storage!","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"packages/graphrag-storage/graphrag_storage/tables/csv_table_provider.py","lineNumber":66,"sourceCode":"            table_name: str\n                The name of the table to read. The file will be accessed as '{table_name}.csv'.\n\n        Returns\n        -------\n            pd.DataFrame:\n                The table data loaded from the csv file.\n\n        Raises\n        ------\n            ValueError:\n                If the table file does not exist in storage.\n            Exception:\n                If there is an error reading or parsing the csv file.\n        \"\"\"\n        filename = f\"{table_name}.csv\"\n        if not await self._storage.has(filename):\n            msg = f\"Could not find {filename} in storage!\"\n            raise ValueError(msg)\n        try:\n            logger.info(\"reading table from storage: %s\", filename)\n            csv_data = await self._storage.get(filename, as_bytes=False)\n            # Handle empty CSV (pandas can't parse files with no columns)\n            if not csv_data or csv_data.strip() == \"\":\n                return pd.DataFrame()\n            return pd.read_csv(StringIO(csv_data), keep_default_na=False)\n        except Exception:\n            logger.exception(\"error loading table from storage: %s\", filename)\n            raise\n\n    async def write_dataframe(self, table_name: str, df: pd.DataFrame) -> None:\n        \"\"\"Write a pandas DataFrame to storage as a CSV file.\n\n        Args\n        ----\n            table_name: str\n                The name of the table to write. The file will be saved as '{table_name}.csv'.","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/microsoft/graphrag/blob/f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704/packages/graphrag-storage/graphrag_storage/tables/csv_table_provider.py#L48-L84","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run the indexing pipeline to generate the CSV outputs first","Verify the storage base_dir/root and that <base>/<table>.csv actually exists (ls output/)","Check table-name spelling and that you're reading from the same environment/filesystem the indexer wrote to"],"exampleFix":"# before\ndf = await provider.read_dataframe(\"create_base_entities\")\n# after\n# ensure output/create_base_entities.csv exists (run: python -m graphrag index --root .)\ndf = await provider.read_dataframe(\"create_base_entities\")","handlingStrategy":"try-catch","validationCode":"if not await provider._storage.has(f\"{table_name}.csv\"):\n    raise RuntimeError(f\"index outputs missing: {table_name}.csv\")","typeGuard":null,"tryCatchPattern":"try:\n    df = await provider.read_dataframe(t)\nexcept ValueError as e:\n    if \"Could not find\" in str(e):\n        df = pd.DataFrame()  # or trigger indexing\n    else:\n        raise","preventionTips":["Check output/ contents before running queries","Run index and query with the same --root"],"tags":["csv","file-not-found","table-provider"],"backgroundTag":"file-not-found","analyzedSha":"f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704","analyzedAt":"2026-08-27T11:16:29.677Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}