langchain-ai/langgraph · error · DuplicateHandlerError
Blob decryptor already registered
Error message
Blob decryptor already registered
What it means
Raised (as DuplicateHandlerError) by the encryption context's register decorator when a blob decryptor has already been registered for the context. Only one decryptor per registration slot is allowed; a second registration is rejected to avoid ambiguous decryption behavior. Register the decryptor once.
Solutions
- Remove the extra @encryption.decrypt.blob registration so only one blob decryptor exists
- Route different decryption paths through the single handler based on ctx
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at libs/sdk-py/langgraph_sdk/encryption/__init__.py:173 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26).
Data as JSON: /api/errors/4ca3b0f6789588c1.
Report an issue: GitHub.
Appendix: source
Thrown at libs/sdk-py/langgraph_sdk/encryption/__init__.py:173
async def decrypt_blob(
ctx: EncryptionContext, blob: bytes
) -> bytes | DecryptResult[bytes]:
# Decrypt the blob using your encryption service
return decrypted_blob
```
Args:
fn: The decryption handler function
Returns:
The registered handler function
Raises:
DuplicateHandlerError: If blob decryptor already registered
TypeError: If handler has invalid signature
"""
if self._parent._blob_decryptor is not None:
raise DuplicateHandlerError("Blob decryptor already registered")
_validate_handler(fn, "Blob decryptor")
self._parent._blob_decryptor = fn
return fn
def json(self, fn: _JsonDecryptorT) -> _JsonDecryptorT:
"""Register the JSON decryption handler.
Example:
```python
@encryption.decrypt.json
async def decrypt_json(
ctx: EncryptionContext, data: dict
) -> dict | DecryptResult[dict]:
# Decrypt the data
return decrypt_data(data)
```
Args:View on GitHub (pinned to 38031739e5)