{"record":{"id":"5c911f80ae4e0ff7","repo":"BerriAI/litellm","slug":"db-not-connected-prisma-client-is-none","errorCode":null,"errorMessage":"DB not connected. prisma_client is None","messagePattern":"DB not connected\\. prisma_client is None","errorType":"exception","errorClass":"Exception","httpStatus":500,"severity":"error","filePath":"litellm/proxy/management_endpoints/key_management_endpoints.py","lineNumber":4234,"sourceCode":"                prisma_client=prisma_client,\n                user_api_key_dict=user_api_key_dict,\n                litellm_changed_by=litellm_changed_by,\n            )\n\n            if user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN.value:\n                deleted_tokens = await prisma_client.delete_data(tokens=tokens)\n                if deleted_tokens is not None and len(deleted_tokens) != len(tokens):\n                    failed_tokens = [token for token in tokens if token not in deleted_tokens]\n            else:\n                deletion_tasks: Final = [prisma_client.delete_data(tokens=[key.token]) for key in authorized_keys]\n                await asyncio.gather(*deletion_tasks)\n\n                deleted_tokens = [key.token for key in authorized_keys]\n                if len(deleted_tokens) != len(tokens):\n                    failed_tokens = [token for token in tokens if token not in deleted_tokens]\n\n        else:\n            raise Exception(\"DB not connected. prisma_client is None\")\n    except Exception as e:\n        verbose_proxy_logger.exception(\n            \"litellm.proxy.proxy_server.delete_verification_tokens(): Exception occured - %s\", e\n        )\n        verbose_proxy_logger.debug(traceback.format_exc())\n        raise e\n\n    for key in tokens:\n        user_api_key_cache.delete_cache(key)\n        # remove hash token from cache\n        hashed_token = hash_token(cast(str, key))\n        user_api_key_cache.delete_cache(hashed_token)\n\n    # After credential invalidation, so a failure here can never keep a deleted key alive.\n    for deleted_key in authorized_keys:\n        if deleted_key.token is not None:\n            await sync_key_access_group_membership(\n                prisma_client=prisma_client,","sourceCodeStart":4216,"sourceCodeEnd":4252,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/key_management_endpoints.py#L4216-L4252","documentation":"Error \"DB not connected. prisma_client is None\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:4234 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set DATABASE_URL to a valid PostgreSQL connection string and restart the proxy.","Check proxy startup logs for database connection failures."],"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-14T05:17:10.506Z"}