Umami Migration Failed (Prisma P3009 / P3018 Error)

Share
Workaround available Self-hosted (Docker, Node.js, Railway, Vercel) Updated November 13, 2026Based on 4 user reportsHow we research

Quick answer

When an upgrade migration fails, Prisma marks it failed (P3018) and blocks every later one (P3009), so the build stops at check-db. Restore free disk space, mark the failed migration rolled back, and rerun it; on big tables run the heavy update in batches.

Most likely fix: Back up and free disk space first

How to fix it

Try these in order — the most common fix is first.

  1. 1. Back up and free disk space first

    1. Take a full database backup before touching migrations
    2. Check free disk space; large migrations need temporary space and can take 10+ minutes
    3. Resize the volume if it is near full
    Did this fix it?
  2. 2. Retry the migration

    1. Restart Umami once; some users report the remaining migrations then complete
    2. If you use a pooled DATABASE_URL, set DIRECT_DATABASE_URL to a direct PostgreSQL connection for migrations
    Did this fix it?
  3. 3. Resolve the failed migration

    1. Run npx prisma migrate status to see which migration failed
    2. If it made no changes, run npx prisma migrate resolve --rolled-back <migration_name>
    3. Run npx prisma migrate deploy again
    Did this fix it?
  4. 4. Run the heavy migration manually in batches

    1. Create helper indexes with CREATE INDEX CONCURRENTLY on website_event
    2. Apply the column/data changes from the migration SQL in batches (e.g. 2,000 rows at a time) instead of one UPDATE
    3. Mark it applied with npx prisma migrate resolve --applied <migration_name>
    4. Run npx prisma migrate deploy for the remaining migrations
    Did this fix it?

Symptoms

The build or container exits during check-db with 'migrate found failed migrations' (P3009), 'deadlock detected' (40P01) or a timeout, often on 09_update_hostname_region. Sometimes the disk fills up during the upgrade.

Why it happens

  • Large website_event table makes the migration slow and lock-heavy
  • Database instance too small (e.g. t3.micro) or out of disk space
  • A previous attempt left a failed row in _prisma_migrations
  • Connection pooler (pgbouncer) used for migrations instead of a direct connection
  • MariaDB incompatibility with MySQL-specific functions in v2 migrations

This guide also covers

  • umami migration failed
  • umami p3009
  • umami p3018
  • umami check-db failed
  • umami 09_update_hostname_region

Still not working?

If Umami keeps failing, you're not alone. See every Umami problem users report or the alternatives people switch to.

Done fighting Umami? Our small team builds your own Umami alternative, made for how you work. On your domain or hosted by us. Price agreed together.

Get a quote
Fixed it? Share this guide

The same problem in other apps

All not loading, error messages & connection guides →

Other Umami errors

All 12 Umami errors and fixes →