Skip to content

fix(deploy): tolerate P1002 (migrate advisory lock timeout)#32

Merged
abdout merged 1 commit into
mainfrom
fix/migrate-tolerate-p1002
May 10, 2026
Merged

fix(deploy): tolerate P1002 (migrate advisory lock timeout)#32
abdout merged 1 commit into
mainfrom
fix/migrate-tolerate-p1002

Conversation

@abdout
Copy link
Copy Markdown
Contributor

@abdout abdout commented May 10, 2026

Hotfix.

Most recent deploys are failing with P1002 — Prisma timed out trying to acquire its migrate advisory lock (pg_advisory_lock(72707369), 10s timeout). Likely a previous failed deploy left the lock orphaned, or two deploys raced.

Add a graceful skip for P1002 alongside the P3005 path. Skipping is safe — the next deploy retries, and _prisma_migrations prevents double-application even with a stale lock.

The warning includes the manual unlock SQL if it persists:

SELECT pg_advisory_unlock(72707369);

🤖 Generated with Claude Code

Most recent deploys started failing with P1002 — Prisma timed out
trying to acquire its migrate advisory lock (pg_advisory_lock(72707369),
10s timeout). This usually means a previous deploy crashed without
releasing the lock, or two deploys are racing to apply migrations.

Skipping is safe: the next deploy retries, and _prisma_migrations
prevents double-application even if a stale lock corrupts state.

The warning prints the manual unlock SQL operators can use if it
persists across more than a couple deploys:

  SELECT pg_advisory_unlock(72707369);

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mkan Ready Ready Preview, Comment May 10, 2026 6:50am

@abdout abdout merged commit 8b43e5a into main May 10, 2026
8 checks passed
@abdout abdout deleted the fix/migrate-tolerate-p1002 branch May 10, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant