{"record":{"id":"38fbf2d5b59b8f9e","repo":"microsoft/graphrag","slug":"cosmostableprovider-requires-container-name","errorCode":null,"errorMessage":"CosmosTableProvider requires 'container_name'.","messagePattern":"CosmosTableProvider requires 'container_name'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"packages/graphrag-storage/graphrag_storage/tables/cosmos_table_provider.py","lineNumber":94,"sourceCode":"    ) -> None:\n        self._batch_size = min(max(batch_size, 1), _MAX_BATCH_SIZE)\n\n        if _container is not None:\n            # Fast path: child() or test injection.\n            self._cosmos_client = _cosmos_client\n            self._container = _container\n            self._legacy_container = _legacy_container\n            self._namespace = namespace\n            self._owns_client = False\n            return\n\n        # Normal construction from config values.\n        if not database_name:\n            msg = \"CosmosTableProvider requires 'database_name'.\"\n            raise ValueError(msg)\n        if not container_name:\n            msg = \"CosmosTableProvider requires 'container_name'.\"\n            raise ValueError(msg)\n        if connection_string and account_url:\n            msg = \"Specify either 'connection_string' or 'account_url', not both.\"\n            raise ValueError(msg)\n        if not connection_string and not account_url:\n            msg = \"CosmosTableProvider requires 'connection_string' or 'account_url'.\"\n            raise ValueError(msg)\n\n        if connection_string:\n            self._cosmos_client = CosmosClient.from_connection_string(connection_string)\n        else:\n            self._cosmos_client = CosmosClient(\n                url=account_url,  # type: ignore[arg-type]\n                credential=DefaultAzureCredential(),\n            )\n\n        self._namespace = namespace\n        self._owns_client = True\n","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/microsoft/graphrag/blob/f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704/packages/graphrag-storage/graphrag_storage/tables/cosmos_table_provider.py#L76-L112","documentation":"CosmosTableProvider stores each table as documents inside a Cosmos container, so container_name is mandatory in the config-based constructor path. Without it there is no target container and the provider refuses to construct.","triggerScenarios":"Creating CosmosTableProvider from config with database_name set but container_name missing/empty.","commonSituations":"Config template copied only the database/credential keys; container name expected to default to the table name (it does not — one container holds all tables namespaced).","solutions":["Set container_name (e.g. container_name: graphrag_tables) in the cosmos table provider config","Use a stable name — the provider namespaces tables inside this single container","Confirm the container exists or the account allows auto-creation"],"exampleFix":"# before\ntype: cosmosdb\ndatabase_name: graphrag\n# after\ntype: cosmosdb\ndatabase_name: graphrag\ncontainer_name: graphrag_tables","handlingStrategy":"validation","validationCode":"assert cfg.get(\"container_name\"), \"table_storage needs container_name for cosmosdb\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a complete cosmosdb table-storage config template"],"tags":["cosmosdb","table-provider","config","validation"],"backgroundTag":"missing-required-config","analyzedSha":"f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704","analyzedAt":"2026-08-27T11:16:29.677Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}