{"record":{"id":"083b61170443b950","repo":"langchain-ai/langgraph","slug":"json-decryptor-already-registered","errorCode":null,"errorMessage":"JSON decryptor already registered","messagePattern":"JSON decryptor already registered","errorType":"exception","errorClass":"DuplicateHandlerError","httpStatus":null,"severity":"error","filePath":"libs/sdk-py/langgraph_sdk/encryption/__init__.py","lineNumber":202,"sourceCode":"            async def decrypt_json(\n                ctx: EncryptionContext, data: dict\n            ) -> dict | DecryptResult[dict]:\n                # Decrypt the data\n                return decrypt_data(data)\n            ```\n\n        Args:\n            fn: The decryption handler function\n\n        Returns:\n            The registered handler function\n\n        Raises:\n            DuplicateHandlerError: If JSON decryptor already registered\n            TypeError: If handler has invalid signature\n        \"\"\"\n        if self._parent._json_decryptor is not None:\n            raise DuplicateHandlerError(\"JSON decryptor already registered\")\n        _validate_handler(fn, \"JSON decryptor\")\n        self._parent._json_decryptor = fn\n        return fn\n\n\nclass Encryption:\n    \"\"\"Add custom at-rest encryption to your LangGraph application.\n\n    .. warning::\n        This API is in beta and may change in future versions.\n\n    The Encryption class provides a system for implementing custom encryption\n    of data at rest in LangGraph applications. It supports encryption of\n    both opaque blobs (like checkpoints) and structured JSON data (like\n    metadata, context, kwargs, values, etc.).\n\n    To use, create a separate Python file and add the path to the file to your\n    LangGraph API configuration file (`langgraph.json`). Within that file, create","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/sdk-py/langgraph_sdk/encryption/__init__.py#L184-L220","documentation":"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.","triggerScenarios":"Thrown at libs/sdk-py/langgraph_sdk/encryption/__init__.py:202 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete the duplicate @encryption.decrypt.json registration","Merge the decryption logic into the already-registered JSON decryptor"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","contentChangedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}