microsoft/graphrag · warning · NotImplementedError
Blob storage does yet not support listing keys.
Error message
Blob storage does yet not support listing keys.
What it means
AzureBlobStorage inherits the keys() API from the KeyValueStorageAbstraction but blob storage has no key-listing implementation yet. Any call raises NotImplementedError unconditionally.
Source
Thrown at packages/graphrag-storage/graphrag_storage/azure_blob_storage.py:234
"""Clear the cache."""
def child(self, name: str | None) -> "Storage":
"""Create a child storage instance."""
if name is None:
return self
path = str(Path(self._base_dir) / name) if self._base_dir else name
return AzureBlobStorage(
connection_string=self._connection_string,
container_name=self._container_name,
encoding=self._encoding,
base_dir=path,
account_url=self._account_url,
)
def keys(self) -> list[str]:
"""Return the keys in the storage."""
msg = "Blob storage does yet not support listing keys."
raise NotImplementedError(msg)
def _keyname(self, key: str) -> str:
"""Get the key name."""
return str(Path(self._base_dir) / key) if self._base_dir else key
async def get_creation_date(self, key: str) -> str:
"""Get creation date for the blob."""
try:
key = self._keyname(key)
container_client = self._blob_service_client.get_container_client(
self._container_name
)
blob_client = container_client.get_blob_client(key)
timestamp = blob_client.download_blob().properties.creation_time
return get_timestamp_formatted_with_local_tz(timestamp)
except Exception: # noqa: BLE001
logger.warning("Error getting key %s", key)
return ""View on GitHub (pinned to f40e9a26ce)
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
Example fix
# before
all_cache_keys = store.keys()
# after
try:
all_cache_keys = store.keys()
except NotImplementedError:
all_cache_keys = [] # blob storage cannot enumerate keys Defensive patterns
Strategy: fallback
Validate before calling
def safe_keys(store):
try:
return store.keys()
except NotImplementedError:
return [] Type guard
def supports_keys(store) -> bool:
import inspect
f = type(store).keys
code = getattr(f, '__code__', None)
return not (code and 'not support' in (code.co_consts[0] or '')) if code else True Try / catch
try:
ks = store.keys()
except NotImplementedError:
ks = [] # or load from your own manifest of written keys Prevention
- Don't build logic that enumerates cache keys; keep your own key index
- Feature-detect before enumerating arbitrary storage backends
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- AzureBlobStorage requires only one of connection_string or a
- AzureBlobStorage requires either a connection_string or acco
- Container name must be between 3 and 63 characters long and
- No storage account blob url provided for blob storage.
- Either connection_string or account_url must be provided.
AI-assisted analysis of microsoft/graphrag@f40e9a26ce (2026-08-27).
Data as JSON: /api/errors/06129cbd32189471.
Report an issue: GitHub.