{"record":{"id":"a80ce5a253468993","repo":"langchain-ai/langgraph","slug":"auth-handler-getattr-fn-name-fn-must","errorCode":null,"errorMessage":"Auth handler '{getattr(fn, '__name__', fn)}' must be an async function. Add 'async' before 'def' to make it asynchronous and ensure any IO operations are non-blocking.","messagePattern":"Auth handler '(.+?)' must be an async function\\. Add 'async' before 'def' to make it asynchronous and ensure any IO operations are non-blocking\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/sdk-py/langgraph_sdk/auth/__init__.py","lineNumber":847,"sourceCode":"    else:\n        r = resource if resource is not None else \"*\"\n        a = action if action is not None else \"*\"\n        if (r, a) in auth._handlers:\n            raise ValueError(f\"types.Handler already set for {r}, {a}.\")\n        auth._handlers[(r, a)] = [fn]\n    return fn\n\n\ndef _validate_handler(fn: Callable[..., typing.Any]) -> None:\n    \"\"\"Validates that an auth handler function meets the required signature.\n\n    Auth handlers must:\n    1. Be async functions\n    2. Accept a ctx parameter of type AuthContext\n    3. Accept a value parameter for the data being authorized\n    \"\"\"\n    if not inspect.iscoroutinefunction(fn):\n        raise ValueError(\n            f\"Auth handler '{getattr(fn, '__name__', fn)}' must be an async function. \"\n            \"Add 'async' before 'def' to make it asynchronous and ensure\"\n            \" any IO operations are non-blocking.\"\n        )\n\n    sig = inspect.signature(fn)\n    if \"ctx\" not in sig.parameters:\n        raise ValueError(\n            f\"Auth handler '{getattr(fn, '__name__', fn)}' must have a 'ctx: AuthContext' parameter. \"\n            \"Update the function signature to include this required parameter.\"\n        )\n    if \"value\" not in sig.parameters:\n        raise ValueError(\n            f\"Auth handler '{getattr(fn, '__name__', fn)}' must have a 'value' parameter. \"\n            \" The value contains the mutable data being sent to the endpoint.\"\n            \"Update the function signature to include this required parameter.\"\n        )\n","sourceCodeStart":829,"sourceCodeEnd":865,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/sdk-py/langgraph_sdk/auth/__init__.py#L829-L865","documentation":"Error \"Auth handler '{getattr(fn, '__name__', fn)}' must be an async function. Add 'async' before 'def' to make it asynchronous and ensure any IO operations are non-blocking.\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/sdk-py/langgraph_sdk/auth/__init__.py:847 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"}