Terminal or Vercel runtime logs
NeonDbError: null value in column "…" of relation "…" violates not-null constraint
- What it means
- The database refused to save a row because a required column was left empty (`null`).
- Likely causes
- Form input wasn't validated with a schema before running the
INSERTorUPDATEquery. - A form field's
nameattribute in HTML doesn't match the field name read in the Server Action.
- Form input wasn't validated with a schema before running the
- Prevention
- Validate every Server Action input with a schema before running any database query.
Copy for your agent
The database threw `null value in column violates not-null constraint`. Validate the input with a schema in the Server Action before touching the database, and return a friendly field error if it's empty.
Was this page helpful?