添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
PrismaClientKnownRequestError

Prisma Client throws a PrismaClientKnownRequestError exception if the query engine returns a known error related to the request - for example, a unique constraint violation.

Property Description
code A Prisma-specific error code .
meta Additional information about the error - for example, the field that caused the error: { target: [ 'email' ] }
message Error message associated with error code .
clientVersion Version of Prisma Client (for example, 2.19.0 )

PrismaClientUnknownRequestError

Prisma Client throws a PrismaClientUnknownRequestError exception if the query engine returns an error related to a request that does not have an error code.

Property Description
message Error message associated with error code .
clientVersion Version of Prisma Client (for example, 2.19.0 )

PrismaClientRustPanicError

Prisma Client throws a PrismaClientRustPanicError exception if the underlying engine crashes and exits with a non-zero exit code. In this case, Prisma Client or the whole Node process must be restarted.

Property Description
message Error message associated with error code .
clientVersion Version of Prisma Client (for example, 2.19.0 )

PrismaClientInitializationError

Prisma Client throws a PrismaClientInitializationError exception if something goes wrong when the query engine is started and the connection to the database is created. This happens either:

  • When prisma.$connect() is called OR
  • When the first query is executed

Errors that can occur include:

  • The provided credentials for the database are invalid
  • There is no database server running under the provided hostname and port
  • The port that the query engine HTTP server wants to bind to is already taken
  • A missing or inaccessible environment variable
  • The query engine binary for the current platform could not be found ( generator block)
Property Description
errorCode A Prisma-specific error code.
message Error message associated with error code .
clientVersion Version of Prisma Client (for example, 2.19.0 )

PrismaClientValidationError

Prisma Client throws a PrismaClientValidationError exception if validation fails - for example:

  • Missing field - for example, an empty data: {} property when creating a new record
  • Incorrect field type provided (for example, setting a Boolean field to "Hello, I like cheese and gold!" )
Property Description
message Error message.
clientVersion Version of Prisma Client (for example, 2.19.0 )

P1003

"Database {database_file_name} does not exist at {database_file_path}"

"Database {database_name}.{database_schema_name} does not exist on the database server at {database_host}:{database_port} ."

"Database {database_name} does not exist on the database server at {database_host}:{database_port} ."

P1012

Note: If you get error code P1012 after you upgrade Prisma to version 4.0.0 or later, see the version 4.0.0 upgrade guide . A schema that was valid before version 4.0.0 might be invalid in version 4.0.0 and later. The upgrade guide explains how to update your schema to make it valid.

"{full_error}"

Possible P1012 error messages:

  • "Argument {} is missing."
  • "Function {} takes {} arguments, but received {}."
  • "Argument {} is missing in attribute @{} ."
  • "Argument {} is missing in data source block {} ."
  • "Argument {} is missing in generator block {} ."
  • "Error parsing attribute @{} : {}"
  • "Attribute @{} is defined twice."
  • "The model with database name {} could not be defined because another model with this name exists: {} "
  • " {} is a reserved scalar type name and can not be used."
  • "The {} {} cannot be defined because a {} with that name already exists."
  • "Key {} is already defined in {}."
  • "Argument {} is already specified as unnamed argument."
  • "Argument {} is already specified."
  • "No such argument.""
  • "Field {} is already defined on model {} ."
  • "Field {} in model {} can't be a list. The current connector does not support lists of primitive types."
  • "The index name {} is declared multiple times. With the current connector index names have to be globally unique."
  • "Value {} is already defined on enum {} ."
  • "Attribute not known: @{} ."
  • "Function not known: {} ."
  • "Datasource provider not known: {} ."
  • "shadowDatabaseUrl is the same as url for datasource {} . Please specify a different database as shadow database."
  • "The preview feature {} is not known. Expected one of: {}"
  • " {} is not a valid value for {}."
  • "Type {} is neither a built-in type, nor refers to another model, custom type, or enum."
  • "Type {} is not a built-in type."
  • "Unexpected token. Expected one of: {}"
  • "Environment variable not found: {}."
  • "Expected a {} value, but received {} value {} ."
  • "Expected a {} value, but failed while parsing {} : {}."
  • "Error validating model {} : {}"
  • "Error validating field {} in model {} : {}"
  • "Error validating datasource {datasource} : {message}""
  • "Error validating enum {} : {}"
  • "Error validating: {}"

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: {error_code}
{inner_error}"

P3018

"A migration failed to apply. New migrations cannot be applied before the error is recovered from. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve

Migration name: {migration_name}

Database error code: {database_error_code}

Database error:
{database_error} "

P3019

"The datasource provider {provider} specified in your schema does not match the one specified in the migration_lock.toml, {expected_provider} . Please remove your current migration directory and start a new migration history with prisma migrate dev. Read more: https://pris.ly/d/migrate-provider-switch "