{"record":{"id":"a3349bd24aa0f244","repo":"langchain-ai/langgraph","slug":"handler-type-must-accept-exactly-2-parameters-c","errorCode":null,"errorMessage":"{handler_type} must accept exactly 2 parameters (ctx, data), got {len(params)}","messagePattern":"(.+?) must accept exactly 2 parameters \\(ctx, data\\), got (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"libs/sdk-py/langgraph_sdk/encryption/__init__.py","lineNumber":64,"sourceCode":"\n    Args:\n        fn: The handler function to validate\n        handler_type: Description of the handler for error messages\n\n    Raises:\n        TypeError: If the handler is not an async function or has wrong parameter count\n    \"\"\"\n    if not inspect.iscoroutinefunction(fn):\n        raise TypeError(f\"{handler_type} must be an async function, got {type(fn)}\")\n\n    sig = inspect.signature(fn)\n    params = [\n        p\n        for p in sig.parameters.values()\n        if p.kind in (p.POSITIONAL_ONLY, p.POSITIONAL_OR_KEYWORD)\n    ]\n    if len(params) != 2:\n        raise TypeError(\n            f\"{handler_type} must accept exactly 2 parameters \"\n            f\"(ctx, data), got {len(params)}\"\n        )\n\n\nclass _EncryptDecorators:\n    \"\"\"Decorators for encryption handlers.\n\n    Provides @encryption.encrypt.blob and @encryption.encrypt.json decorators for\n    registering encryption functions.\n    \"\"\"\n\n    def __init__(self, parent: Encryption):\n        self._parent = parent\n\n    def blob(self, fn: types.BlobEncryptor) -> types.BlobEncryptor:\n        \"\"\"Register a blob encryption handler.\n","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/sdk-py/langgraph_sdk/encryption/__init__.py#L46-L82","documentation":"Error \"{handler_type} must accept exactly 2 parameters (ctx, data), got {len(params)}\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/sdk-py/langgraph_sdk/encryption/__init__.py:64 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}