langchain-ai/langgraph · error · DuplicateHandlerError

JSON decryptor already registered

Error message

JSON decryptor already registered

What it means

DuplicateHandlerError from the JSON decryptor decorator: registration of @encryption.decrypt.json failed because _json_decryptor is already set, i.e. another JSON decryptor was registered earlier in the same process.

Solutions

  1. Delete the duplicate @encryption.decrypt.json registration
  2. Merge the decryption logic into the already-registered JSON decryptor
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

            async def decrypt_json(
                ctx: EncryptionContext, data: dict
            ) -> dict | DecryptResult[dict]:
                # Decrypt the data
                return decrypt_data(data)
            ```

        Args:
            fn: The decryption handler function

        Returns:
            The registered handler function

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


class Encryption:
    """Add custom at-rest encryption to your LangGraph application.

    .. warning::
        This API is in beta and may change in future versions.

    The Encryption class provides a system for implementing custom encryption
    of data at rest in LangGraph applications. It supports encryption of
    both opaque blobs (like checkpoints) and structured JSON data (like
    metadata, context, kwargs, values, etc.).

    To use, create a separate Python file and add the path to the file to your
    LangGraph API configuration file (`langgraph.json`). Within that file, create

View on GitHub (pinned to 38031739e5)