BerriAI/litellm · error · RuntimeError

Migration failed due to permission error. Migration {migrati

Error message

Migration failed due to permission error. Migration {migration_name} was NOT applied. Please grant necessary database permissions and retry.

What it means

Error "Migration failed due to permission error. Migration {migration_name} was NOT applied. Please grant necessary database permissions and retry." thrown in BerriAI/litellm.

Source

Thrown at litellm-proxy-extras/litellm_proxy_extras/utils.py:909

                                    f"Please check database user privileges. Error: {e.stderr}"
                                )

                                # Mark as rolled back and exit with error
                                if migration_match:
                                    try:
                                        ProxyExtrasDBManager._roll_back_migration(
                                            migration_name
                                        )
                                        logger.info(
                                            f"Migration {migration_name} marked as rolled back"
                                        )
                                    except Exception as rollback_error:
                                        logger.warning(
                                            f"Failed to mark migration as rolled back: {rollback_error}"
                                        )

                                # Re-raise the error to prevent silent failures
                                raise RuntimeError(
                                    f"Migration failed due to permission error. Migration {migration_name} "
                                    f"was NOT applied. Please grant necessary database permissions and retry."
                                ) from e

                            elif ProxyExtrasDBManager._is_idempotent_error(e.stderr):
                                # Idempotent errors mean the migration has effectively been applied
                                logger.info(
                                    "Migration failed due to idempotent error (e.g., column already exists), "
                                    "resolving as applied"
                                )
                                # Extract the migration name from the error message
                                migration_match = re.search(
                                    r"Migration name: (\d+_.*)", e.stderr
                                )
                                if migration_match:
                                    migration_name = migration_match.group(1)
                                    try:
                                        logger.info(

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Grant the necessary database permissions, then rerun the migration so {migration_name} is applied.
  2. Mark state correctly afterward with prisma migrate resolve if partially applied.

When it happens

Trigger: Thrown at litellm-proxy-extras/litellm_proxy_extras/utils.py:909 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/1c53ee49a70ffd5f. Report an issue: GitHub.