P
Prisma5mo ago
Qru

prisma migrate dev hangs using Prisma Postgress

Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "accelerate.prisma-data.net"
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "accelerate.prisma-data.net"
It just hangs on this message indefinitely. This was previously working for us without any issue.
5 Replies
Prisma AI Help
Prisma AI Help5mo ago
You opted for speed from this bot. Let's conjure up an answer right now! This issue—where prisma migrate dev hangs after printing the datasource info—has been reported by multiple users, especially when using PostgreSQL databases hosted on Supabase, AWS RDS, or Prisma Accelerate. The hang typically occurs after the message:
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "..."
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "..."
Common Causes & Solutions: 1. Missing directUrl in datasource:
For managed Postgres services (like Supabase or Prisma Accelerate), you often need to specify both url and directUrl in your schema.prisma datasource block. The directUrl should point to a session-based connection pooler (usually port 5432), while url may point to a transaction pooler (often port 6543). Example:
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}

Set DATABASE_URL to the transaction pooler and DIRECT_URL to the session pooler. This has resolved the hanging issue for many users Prisma migrate dev hangs up. 2. Incorrect port in DATABASE_URL:
By default, some services provide a connection string with port 6543. Changing this to 5432 (the standard Postgres port) in your .env file has fixed the issue for several users Prisma migrate dev hangs up. 3. General advice:
- Ensure your database is reachable and credentials are correct (you can test with a DB client). - If using Docker or a CI environment, make sure the database is fully ready before running migrations. - If the problem persists, try updating Prisma to the latest version. If you are using Prisma Accelerate, check their documentation for any specific requirements regarding connection URLs. If none of these solutions work, the knowledge sources do not provide a definiti ve fix for Prisma Accelerate specifically, but the above steps have resolved similar issues for other managed Postgres providers. 🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly. In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
Qru
QruOP5mo ago
Seems to no longer hang, but now returns this instead:
Error: Schema engine error:
unexpected message from server
Error: Schema engine error:
unexpected message from server
With no more information. Is this something on Prisma Postgress side or something we've got set up wrong?
Nurul
Nurul5mo ago
Can you share with us the email id or the GitHub handle with which you signed up? This would allow me to take a look at the logs and investigate
Qru
QruOP5mo ago
sent it to you @Nurul please let me know if this is something you can help with because currently we are blocked on this
Nurul
Nurul5mo ago
Thanks, can you do a quick check and see if the issue persists even after you restart the database? You can do that from settings in Prisma Console Environment

Did you find this page helpful?