langchain-ai/langgraph · error · DuplicateHandlerError

JSON encryptor already registered

Error message

JSON encryptor already registered

What it means

Error "JSON encryptor already registered" thrown in langchain-ai/langgraph.

Source

Thrown at libs/sdk-py/langgraph_sdk/encryption/__init__.py:131

            ```python
            @encryption.encrypt.json
            async def encrypt_json(ctx: EncryptionContext, data: dict) -> dict:
                # Encrypt the data
                return encrypt_data(data)
            ```

        Args:
            fn: The encryption handler function

        Returns:
            The registered handler function

        Raises:
            DuplicateHandlerError: If JSON encryptor already registered
            TypeError: If handler has invalid signature
        """
        if self._parent._json_encryptor is not None:
            raise DuplicateHandlerError("JSON encryptor already registered")
        _validate_handler(fn, "JSON encryptor")
        self._parent._json_encryptor = fn
        return fn


class _DecryptDecorators:
    """Decorators for decryption handlers.

    Provides @encryption.decrypt.blob and @encryption.decrypt.json decorators for
    registering decryption functions.
    """

    def __init__(self, parent: Encryption):
        self._parent = parent

    def blob(self, fn: _BlobDecryptorT) -> _BlobDecryptorT:
        """Register a blob decryption handler.

View on GitHub (pinned to 38031739e5)

When it happens

Trigger: Thrown at libs/sdk-py/langgraph_sdk/encryption/__init__.py:131 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/3f38864be719c7a3. Report an issue: GitHub.