{"record":{"id":"06129cbd32189471","repo":"microsoft/graphrag","slug":"blob-storage-does-yet-not-support-listing-keys","errorCode":null,"errorMessage":"Blob storage does yet not support listing keys.","messagePattern":"Blob storage does yet not support listing keys\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"warning","filePath":"packages/graphrag-storage/graphrag_storage/azure_blob_storage.py","lineNumber":234,"sourceCode":"        \"\"\"Clear the cache.\"\"\"\n\n    def child(self, name: str | None) -> \"Storage\":\n        \"\"\"Create a child storage instance.\"\"\"\n        if name is None:\n            return self\n        path = str(Path(self._base_dir) / name) if self._base_dir else name\n        return AzureBlobStorage(\n            connection_string=self._connection_string,\n            container_name=self._container_name,\n            encoding=self._encoding,\n            base_dir=path,\n            account_url=self._account_url,\n        )\n\n    def keys(self) -> list[str]:\n        \"\"\"Return the keys in the storage.\"\"\"\n        msg = \"Blob storage does yet not support listing keys.\"\n        raise NotImplementedError(msg)\n\n    def _keyname(self, key: str) -> str:\n        \"\"\"Get the key name.\"\"\"\n        return str(Path(self._base_dir) / key) if self._base_dir else key\n\n    async def get_creation_date(self, key: str) -> str:\n        \"\"\"Get creation date for the blob.\"\"\"\n        try:\n            key = self._keyname(key)\n            container_client = self._blob_service_client.get_container_client(\n                self._container_name\n            )\n            blob_client = container_client.get_blob_client(key)\n            timestamp = blob_client.download_blob().properties.creation_time\n            return get_timestamp_formatted_with_local_tz(timestamp)\n        except Exception:  # noqa: BLE001\n            logger.warning(\"Error getting key %s\", key)\n            return \"\"","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/microsoft/graphrag/blob/f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704/packages/graphrag-storage/graphrag_storage/azure_blob_storage.py#L216-L252","documentation":"AzureBlobStorage inherits the keys() API from the KeyValueStorageAbstraction but blob storage has no key-listing implementation yet. Any call raises NotImplementedError unconditionally.","triggerScenarios":"Calling storage.keys() on an AzureBlobStorage instance, directly or via generic code that enumerates a KeyValueStorageAbstraction (e.g. cache inspection, debugging utilities, vector store cleanup loops).","commonSituations":"Porting pipelines that call keys() on the LLM cache or text cache storage after switching storage type to blob, or generic admin tooling that assumes every backend supports enumeration.","solutions":["Avoid calling keys() on blob storage; track needed keys in your own metadata/index","Switch that storage component to a backend implementing keys() (e.g. File/Redis if available)","Guard generic code with hasattr/try-except NotImplementedError before enumerating","File an upstream feature request / contribute an implementation using container list_blobs"],"exampleFix":"# before\nall_cache_keys = store.keys()\n\n# after\ntry:\n    all_cache_keys = store.keys()\nexcept NotImplementedError:\n    all_cache_keys = []  # blob storage cannot enumerate keys","handlingStrategy":"fallback","validationCode":"def safe_keys(store):\n    try:\n        return store.keys()\n    except NotImplementedError:\n        return []","typeGuard":"def supports_keys(store) -> bool:\n    import inspect\n    f = type(store).keys\n    code = getattr(f, '__code__', None)\n    return not (code and 'not support' in (code.co_consts[0] or '')) if code else True","tryCatchPattern":"try:\n    ks = store.keys()\nexcept NotImplementedError:\n    ks = []  # or load from your own manifest of written keys","preventionTips":["Don't build logic that enumerates cache keys; keep your own key index","Feature-detect before enumerating arbitrary storage backends"],"tags":["azure","blob-storage","not-implemented","api-support"],"backgroundTag":"unsupported-operation-not-implemented","analyzedSha":"f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704","analyzedAt":"2026-08-27T11:16:29.677Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}