{"record":{"id":"0dbd6c3518cc2994","repo":"BerriAI/litellm","slug":"internal-server-error-0dbd6c","errorCode":null,"errorMessage":"Internal Server Error.","messagePattern":"Internal Server Error\\.","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/management_endpoints/key_management_endpoints.py","lineNumber":4032,"sourceCode":"                )\n            key_data[\"litellm_budget_table\"] = getattr(create_key_response, \"litellm_budget_table\", None)\n            key_data[\"created_at\"] = getattr(create_key_response, \"created_at\", None)\n            key_data[\"updated_at\"] = getattr(create_key_response, \"updated_at\", None)\n\n            # Deserialize router_settings from JSON string to dict for response\n            router_settings_value: Final = key_data.get(\"router_settings\")\n            if router_settings_value is not None and isinstance(router_settings_value, str):\n                try:\n                    key_data[\"router_settings\"] = yaml.safe_load(router_settings_value)\n                except yaml.YAMLError:\n                    # If it's not valid JSON/YAML, keep as is or set to empty dict\n                    key_data[\"router_settings\"] = {}\n    except Exception as e:\n        verbose_proxy_logger.error(\"litellm.proxy.proxy_server.generate_key_helper_fn(): Exception occured - %s\", e)\n        verbose_proxy_logger.debug(traceback.format_exc())\n        if isinstance(e, HTTPException):\n            raise e\n        raise HTTPException(\n            status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,\n            detail={\"error\": \"Internal Server Error.\"},\n        )\n\n    # Add budget related info in key_data - this ensures it's returned\n    key_data[\"budget_id\"] = budget_id\n\n    if request_type == \"user\":\n        # if this is a /user/new request update the key_date with user_data fields\n        key_data.update(user_data)\n\n    return key_data\n\n\nasync def _team_key_deletion_check(\n    user_api_key_dict: UserAPIKeyAuth,\n    key_info: LiteLLM_VerificationToken,\n    prisma_client: PrismaClient,","sourceCodeStart":4014,"sourceCodeEnd":4050,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/key_management_endpoints.py#L4014-L4050","documentation":"Error \"Internal Server Error.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:4032 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check proxy server logs for the underlying exception.","Retry the request; if it persists, report the error with the request details to the proxy operator."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}