Skip to Content
LaunchfastDocs

Database errors

Connection failures, migration problems and query errors with Neon Postgres and Drizzle.

getaddrinfo ENOTFOUND … neon.tech

Error: getaddrinfo ENOTFOUND ep-cool-name-123456.ap-southeast-1.aws.neon.tech

Why: your network's DNS refuses to look up Neon's hostnames. It's common on some Indian ISPs. Your database is fine; your computer just can't find it.

Fix: switch your computer to public DNS. Your internet still goes through your provider; only name lookups change.

nmcli connection show                     # find your Wi-Fi connection's name
nmcli connection modify "<wifi name>" ipv4.dns "1.1.1.1 8.8.8.8" ipv4.ignore-auto-dns yes
nmcli connection up "<wifi name>"

Then run the command again. If you're on a phone hotspot or office network, the same fix applies per network.

This only affects your computer: your live site on Vercel isn't affected.

Missing environment variable DATABASE_URL

Missing environment variable DATABASE_URL. Run the setup script or copy .env.example to .env.local and fill it in.

Why: the app tried to query the database, but DATABASE_URL isn't set.

Fix:

  • Locally: run npm run setup, or put your connection string in .env.local. The file must be named exactly .env.local, in the project root (next to package.json). Restart npm run dev after editing it.
  • On Vercel: add DATABASE_URL under Settings → Environment Variables for Production, then redeploy.

DATABASE_URL is not set. Add it to .env.local first.

From npm run make-admin. Same cause and fix as above: the script reads .env.local.

No account found for you@example.com. Sign up in the app first, then run this again.

From npm run make-admin. Why: no user with that email exists in the database in DATABASE_URL.

Fix: sign up in the app first (with the same email; capitalisation doesn't matter). If you signed up on the live site, make sure .env.local points at the same database production uses.

Migrations fail

Migrations failed (see the output above). Fix it, then run `npm run setup` again.

Look at the output above it:

MessageWhyFix
getaddrinfo ENOTFOUNDDNS, as aboveSwitch to public DNS
password authentication failedThe connection string's password is wrong or was resetCopy a fresh connection string from the Neon console (Connect)
relation "…" already existsThe tables were created another way (drizzle-kit push, or by hand), so Drizzle's migration history is missingOn a fresh database with no real data: delete and recreate the database in Neon, then migrate. Otherwise, ask support
column "…" does not exist or cannot cast typeA migration file was edited after it ran somewhereRestore the original migration file from Git, and make changes in a new migration
endpoint is disabled / compute time quotaYour Neon free plan's compute is paused or used upCheck the project in the Neon console

Failed query: … During prerendering

You see lots of these in the logs on every page load of signed-in pages, often with Better Auth errors.

Why: Next.js's partial prefetching was turned on. It renders signed-in pages alongside each request and aborts their queries.

Fix: keep partialPrefetching: false in next.config.ts. The kit ships with it off; check it wasn't changed.

drizzle-kit generate hangs or fails asking about renames

Is user_name column in user table created or renamed from another column?
❯ + user_name           create column
  ~ name › user_name    rename column

Why: Drizzle can't tell a rename from a delete-and-add, so it asks. In a non-interactive terminal (an AI agent, CI), the prompt can't be answered.

Fix: run npm run db:generate yourself in a normal terminal and pick the answer. Or write the migration by hand:

npx drizzle-kit generate --custom --name rename-user-name

Write the SQL (ALTER TABLE "user" RENAME COLUMN "name" TO "user_name";) in the new file, then check that npm run db:generate says there's nothing to change.

No transactions support in neon-http driver

Why: the kit uses Neon's HTTP driver, which runs one statement per request and doesn't support db.transaction().

Fix: use db.batch([…]) to run several statements atomically. See Querying.

Pages are slow on the live site

Why: your server functions run far from your database. Each query crosses an ocean.

Fix: pin functions to the database's region in vercel.json. Setup does this when it deploys; see Function region. Check vercel.json has a regions entry and is committed.

Accounts I create locally show up in production

Why: setup uses one database for both. See Local and production share this database.

On this page