{"record":{"id":"e0aeac0982c4944a","repo":"langchain-ai/langgraph","slug":"global-handler-already-set","errorCode":null,"errorMessage":"Global handler already set.","messagePattern":"Global handler already set\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/sdk-py/langgraph_sdk/auth/__init__.py","lineNumber":827,"sourceCode":"                for action in action_list:\n                    _register_handler(self._auth, resource, action, handler)\n            return handler\n\n        return decorator\n\n\ndef _register_handler(\n    auth: Auth,\n    resource: str | None,\n    action: str | None,\n    fn: types.Handler,\n) -> types.Handler:\n    _validate_handler(fn)\n    resource = resource or \"*\"\n    action = action or \"*\"\n    if resource == \"*\" and action == \"*\":\n        if auth._global_handlers:\n            raise ValueError(\"Global handler already set.\")\n        auth._global_handlers.append(fn)\n    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    \"\"\"","sourceCodeStart":809,"sourceCodeEnd":845,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/sdk-py/langgraph_sdk/auth/__init__.py#L809-L845","documentation":"Error \"Global handler already set.\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/sdk-py/langgraph_sdk/auth/__init__.py:827 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"}