prisma migrate dev hangs using Prisma Postgress
It just hangs on this message indefinitely. This was previously working for us without any issue.
5 Replies
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:
Common Causes & Solutions:
1. Missing directUrl in datasource:
For managed Postgres services (like Supabase or Prisma Accelerate), you often need to specify both
By default, some services provide a connection string with port 6543. Changing this to 5432 (the standard Postgres port) in your
- 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.
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:
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.
Seems to no longer hang, but now returns this instead:
With no more information. Is this something on Prisma Postgress side or something we've got set up wrong?
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
sent it to you
@Nurul please let me know if this is something you can help with because currently we are blocked on this
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