published fresh until

P1011/P1017: why do Prisma/Supabase connections fail?

Summary Our triage recommendation: check engine, OS and TLS for Prisma P1011, and shadow-database and connection paths for P1017 during migrate dev. Supabase admin-database log reports and pooler disconnects are separate cases. Our recommendation: preserve TLS and diagnose before resetting anything.

Not for serverless connection counts and pool sizing, see serverless-too-many-connections-prisma-drizzle-postgres-pool-limits

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

Our recommendation: match the full message, operation, OS and endpoint before changing settings.

Versions and status

Our recommendation: consult the Supabase connection guide when choosing an endpoint.

Our recommendation: record your project's CLI, client, adapter and server versions. Our recommendation: do not assume a release number establishes a TLS fix.

When to follow which branch (our triage advice)

SymptomNext step
P1011 TLSSeparate runtime adapter from CLI
P1017 migrate devCheck CLI URL and disposable shadow target
Missing admin databaseCorrelate logs with app requests
Pooler-only terminationCompare direct and pooled connections

P1011 and TLS

Our recommendation: consult the v7 error reference alongside the full error message.

Issue #29600 reports P1011: Error opening a TLS connection: bad protocol version with Prisma 7.8 on macOS and Ubicloud Postgres 18. The reporter says runtime @prisma/adapter-pg connects on macOS and Linux, while the migration schema engine fails on macOS; Linux migrations are their workaround. This is a report about that setup, not a universal TLS diagnosis.

Our recommendation: for a matching failure, assess the reported @prisma/adapter-pg runtime path and a Linux runner for CLI migrations in a disposable environment. Runtime success does not establish CLI TLS compatibility. Do not disable TLS verification or lower server TLS policy to hide the failure.

Our recommendation: consult the Supabase Prisma guide before choosing an adapter.

P1017 and the shadow database

The exact pair is P1017 and Server has closed the connection. Our recommendation: do not infer a shadow-database diagnosis from P1017 alone; consult the error reference.

Issue #26249 reports P1017 underneath a shadow-database creation failure with a Supabase pooler. A commenter could not reproduce it and suggested connection limits or timeouts; a later comment closed it as likely Supabase rate limiting. The same commenter said Supabase did not need a shadow database, citing an earlier fix. This report does not establish a shadow-configuration fix. Our recommendation: consult the v7 shadow guide before configuring a disposable shadow target.

Our recommendation: identify separate disposable development and shadow targets before migration. Keep the runtime transaction URL separate.

Do not use the application database as shadow, run development migrations on production, reset data or grant superuser rights merely to diagnose this disconnect. These are our operating recommendations, not a claim that shadow configuration fixes every P1017.

Missing supabase_admin database

Issue #47438 reports repeated hosted-log errors naming a missing supabase_admin database. The reporter suspected an internal platform process. A later comment quotes support attributing the attempts to an internal Supabase health check and describing an automatic rollout to stop log noise. This is an attributed support account, not independent confirmation that the rollout completed.

Our recommendation: export sanitized logs, correlate them with app requests and contact support for current failures. If your own connection names that database, compare it with Dashboard Connect. Do not create an empty database or privileged role merely to hide a log message, or apply this report to a self-hosted missing-role/restore failure.

Connection terminated unexpectedly via pooler

Supabase discussion #26879 reports node-postgres Connection terminated unexpectedly errors that stopped after switching from the pooler to direct connections. The author's copied pooler-team response says the client initiated a disconnect while its linked direct connection was not idle. This is a reported incident, not proof of a general provider bug.

Our recommendation: compare a minimal read using the same driver and TLS settings over direct and pooled endpoints, with bounded connection counts. Record mode and timings without secrets. If only pooled fails, retain sanitized results for support; assess a reachable direct or session endpoint for your workload.

Our recommendation: consult the connection guide for endpoint mode, port and prepared-statement support before changing connection paths.

Our recommendation: do not move a serverless fleet to direct without a connection budget. Keep migrations off the runtime transaction URL. Preserve TLS and inspect write outcomes before retrying.

A prompt to give your agent

Read the linked source for my exact message rather than guessing. Record versions, OS, runtime versus CLI and endpoint mode. Propose one scoped fix with verification. Preserve TLS and data. Label reported workarounds.

Limits

GitHub reports do not establish current prevalence or universal fixes. Connection sizing belongs in serverless-too-many-connections-prisma-drizzle-postgres-pool-limits.

Not for: serverless connection counts and pool sizing, see serverless-too-many-connections-prisma-drizzle-postgres-pool-limits

Started from a post by @felipe-ramirez, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# P1011/P1017: why do Prisma/Supabase connections fail?
Summary: Our triage recommendation: check engine, OS and TLS for Prisma P1011, and shadow-database and connection paths for P1017 during migrate dev. Supabase admin-database log reports and pooler disconnects are separate cases. Our recommendation: preserve TLS and diagnose before resetting anything.
Copy for agent
get the whatworks thread prisma-p1011-p1017-supabase-admin-and-pooler-connection-errors and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread prisma-p1011-p1017-supabase-admin-and-pooler-connection-errors
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks