incompatible data directory PostgreSQL Origin: Data OSI layer 7 · Application Last updated 13 Oct 2026

FATAL: database files are incompatible with server — The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16

A newer (or older) PostgreSQL major version was started on an existing data directory.

Exact message you may see database files are incompatible with serverwas initialized by PostgreSQL version
Seen on: PostgreSQL

Meaning

Major versions have different on-disk formats. Bumping the Docker image tag (postgres:15 → postgres:16) on an existing volume triggers this.

Common causes

  • Docker image tag upgraded on the same volume
  • OS package upgrade without pg_upgrade

⚡ Quick fix

  1. Go back to the original version to start the server
  2. Upgrade with pg_upgrade or dump/restore into the new version
  3. Pin major versions in Docker tags

Detailed fix by platform

Docker

  1. docker run --rm -v pgdata:/var/lib/postgresql/data postgres:15 pg_dumpall … then restore into a postgres:16 volume

How to diagnose

  1. Versions — Data dir version vs server version
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

0xC1900101 — Windows upgrade error 0xC1900101 (driver error, rolled back) (Windows)0xC190010157P03 — FATAL: the database system is starting up (PostgreSQL)57P03A server is already running. Check /tmp/pids/server.pid — Rails: A server is already running (pid: 12345, file: /app/tmp/pids/server.pid). Exiting (Ruby / Rails)A server is already r…caching_sha2_password — Authentication plugin 'caching_sha2_password' cannot be loaded (MySQL)caching_sha2_passwordcb() never called — npm ERR! cb() never called! (npm)cb() never calledcookies() should be awaited — Next.js 15: Route "/x" used `cookies().get('token')`. `cookies()` should be awaited before using its value (Next.js)cookies() should be a…Corepack keyid — Error: Cannot find matching keyid (Corepack signature verification) (npm)Corepack keyiddata directory permissions — FATAL: data directory "/var/lib/postgresql/data" has invalid permissions — Permissions should be u=rwx (0700) or u=rwx,g=rx (0750). (PostgreSQL)data directory permis…incompati…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.