Prisma "P3014: Prisma could not create the shadow database" in CI
Prisma Migrate creates a temporary "shadow database" to detect drift and validate migrations. P3014 means it could not create one - usually the database user lacks CREATE DATABASE, common on managed databases. This is deterministic.
What this error means
prisma migrate dev (or diff) fails with P3014, explaining it could not create the shadow database and suggesting a shadowDatabaseUrl. It fails the same way until permissions or a shadow URL are provided.
Error: P3014
Prisma Migrate could not create the shadow database. Please make sure
the database user has permission to create databases. Read more about
the shadow database (and workarounds) at https://pris.ly/d/migrate-shadow
Original error: permission denied to create databaseCommon causes
User lacks CREATE DATABASE
Managed databases (RDS, Cloud SQL, Neon) often deny CREATE DATABASE to the app user, so Prisma cannot create the shadow database automatically.
No dedicated shadow database configured
Without shadowDatabaseUrl, Prisma must create/drop a shadow database itself, which the environment may not permit.
How to fix it
Provide a dedicated shadow database URL
Point Prisma at a separate empty database it is allowed to use as the shadow.
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
}Or grant CREATEDB to the CI user
- On a self-managed CI Postgres, grant the migration user
CREATEDB. - In CI you often control the database, so this is simplest there.
- Use
migrate deploy(which needs no shadow database) for applying already-generated migrations.
How to prevent it
- Configure
shadowDatabaseUrlfor environments where the user cannot create databases. - Use
migrate deployin CI for applying migrations (no shadow database needed). - This is deterministic - retrying without permission or a shadow URL fails identically.