Prisma Error Codes

Prisma Error Codes: Complete reference of Prisma Client error codes (P2xxx series)… Searchable index with fixes, code examples, and official sources.

22 error codes Prisma Last verified 2026-08-19

All 22 error codes

P2002 Unique Constraint Failed Unique constraint failed on the {constraint} P3018 A Migration Failed to Apply A migration failed to apply. New migrations cannot be applied before the error is recovered from. Read... P2025 Required Record Not Found An operation failed because it depends on one or more records that were required but not found. {cause} P3005 Database Schema Is Not Empty The database schema is not empty. Read more about how to baseline an existing production database:... P3014 Could Not Create the Shadow Database "Prisma Migrate could not create the shadow database. Please make sure the database user has permission to... P2003 Foreign Key Constraint Failed Foreign key constraint failed on the field: {field_name} P3009 Failed Migrations Found in Target Database migrate found failed migrations in the target database, new migrations will not be applied. Read more... P2034 Transaction Write Conflict or Deadlock Transaction failed due to a write conflict or a deadlock. Please retry your transaction P2021 Table Does Not Exist The table {table} does not exist in the current database. P3001 Migration Requires Destructive Changes Migration possible with destructive changes and possible data loss: {migration_engine_destructive_details} P2024 Connection Pool Timeout Timed out fetching a new connection from the connection pool. (More info: http://pris.ly/d/connection-pool... P3019 Datasource Provider Mismatch The datasource provider {provider} specified in your schema does not match the one specified in the... P3000 Failed to Create Database Failed to create database: {database_error} P2001 Record Not Found in Where Condition The record searched for in the where condition ({model_name}.{argument_name} = {argument_value}) does not exist P2011 Null Constraint Violation Null constraint violation on the {constraint} P3010 Migration Name Too Long The name of the migration is too long. It must not be longer than 200 characters (bytes). P2004 Constraint Failed on the Database A constraint failed on the database: {database_error} P3015 Could Not Find the Migration File Could not find the migration file at {migration_file_path}. Please delete the directory or restore the... P2006 Provided Value Is Not Valid The provided value {field_value} for {model_name} field {field_name} is not valid P3008 Migration Already Recorded as Applied The migration {migration_name} is already recorded as applied in the database. P2013 Missing Required Argument Missing the required argument {argument_name} for field {field_name} on {object_name}. P2014 Required Relation Violation The change you are trying to make would violate the required relation '{relation_name}' between the...

Official Sources