Skip to content

PostgreSQL container fails to start with postgres:18 due to incorrect volume mount path #28281

@swalihkolakkadan

Description

@swalihkolakkadan

Issue Summary

While setting up the project locally with yarn dx, the PostgreSQL container (prisma-postgres-1) fails to start and keeps restarting. The root cause is that the volume in
packages/prisma/docker-compose.yml is mounted at /var/lib/postgresql/data, but Postgres 18 no longer uses that path — it now stores data under /var/lib/postgresql/18/main (see docker-library/postgres#1259).

This means the volume mount needs to be at /var/lib/postgresql instead, so the data actually gets persisted.

Steps to Reproduce

  1. Clone the repo and run yarn install
  2. Run yarn dx
  3. @calcom/prisma#db-up fails — the postgres container is marked unhealthy
  4. Running docker logs prisma-postgres-1 shows the error about incompatible data directory

Actual Results

The container goes into a restart loop. Logs show:

Error: in 18+, these Docker images are configured to store database data in a
format which is compatible with "pg_ctlcluster" (specifically, using
major-version-specific directory names).
Counter to that, there appears to be PostgreSQL data in:
/var/lib/postgresql/data (unused mount/volume)

   The suggested container configuration for 18+ is to place a single mount
   at /var/lib/postgresql

Expected Results

yarn dx should start postgres without issues and data should persist across restarts.

Technical details

The fix is a one-liner in
packages/prisma/docker-compose.yml
Existing users would also need to clear the old volume with docker compose -f packages/prisma/docker-compose.yml down -v before restarting.

Evidence

After applying the fix, the container starts fine:

$ docker ps --filter "name=prisma"
NAMES STATUS PORTS
prisma-postgres-1 Up 35 seconds (healthy) 0.0.0.0:5450->5432/tcp

Happy to open a PR for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions