{"record":{"id":"0b2c72a71e69c927","repo":"BerriAI/litellm","slug":"database-url-not-set","errorCode":null,"errorMessage":"DATABASE_URL not set","messagePattern":"DATABASE_URL not set","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/db/check_migration.py","lineNumber":97,"sourceCode":"            print(\"Changes to DB Schema detected\")  # noqa: T201\n            print(\"Required SQL commands:\")  # noqa: T201\n            for command in sql_commands:\n                print(command)  # noqa: T201\n            return True, sql_commands\n        else:\n            return False, []\n    except subprocess.CalledProcessError as e:\n        error_message: Final = f\"Failed to generate migration diff. Error: {e.stderr}\"\n        print(error_message)  # noqa: T201\n        return False, []\n\n\ndef check_prisma_schema_diff(db_url: str | None = None) -> None:\n    \"\"\"Main function to run the Prisma schema diff check.\"\"\"\n    if db_url is None:\n        db_url = os.getenv(\"DATABASE_URL\")\n        if db_url is None:\n            raise Exception(\"DATABASE_URL not set\")\n    has_diff, message = check_prisma_schema_diff_helper(db_url)\n    if has_diff:\n        verbose_logger.exception(\n            \"🚨🚨🚨 prisma schema out of sync with db. Consider running these sql_commands to sync the two - %s\",\n            message,\n        )\n","sourceCodeStart":79,"sourceCodeEnd":104,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/db/check_migration.py#L79-L104","documentation":"Raised in check_prisma_schema_diff when no database URL is available: the passed db_url is None and the DATABASE_URL environment variable is unset. Prisma schema diffing requires a live database connection string; the proxy's migration check cannot run at all without it, hence the immediate ValueError.","triggerScenarios":"Thrown at litellm/proxy/db/check_migration.py:97 when the library encounters an invalid state.","commonSituations":"The migration check ran without DATABASE_URL configured.","solutions":["Set the DATABASE_URL environment variable before running the migration check."],"exampleFix":"export DATABASE_URL=postgresql://user:pass@host:5432/litellm","handlingStrategy":"validation","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"}