prisma: Supabase: db error: ERROR: unexpected response from login query
Bug description
I am getting db error: ERROR: unexpected response from login query when try to use supabase as database. This only happens when accessing an external database, while testing with a local database under docker worked perfectly.
How to reproduce
- Go to Supabase
- Create or login account
- Create an project
- Go to Database > Connection Pooling
- Scroll to bottom and copy Connection string
- Replace DATABASE_URL in environment variable
- Run
npx prisma migrate dev - See error
Expected behavior
Prisma CLI executes the given commands without any error
Prisma information
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
id Int @id @default(autoincrement())
username String?
}
Environment & setup
// .env
DATABASE_URL="postgresql://XXXX:XXXX@XXX.supabase.co:6543/XXX?pbbouncer=true"
Prisma Version
prisma : 3.1.1
@prisma/client : 3.1.1
Current platform : debian-openssl-1.1.x
Query Engine (Node-API) : libquery-engine c22652b7e418506fab23052d569b85d3aec4883f (at node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node)
Migration Engine : migration-engine-cli c22652b7e418506fab23052d569b85d3aec4883f (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core c22652b7e418506fab23052d569b85d3aec4883f (at node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary : prisma-fmt c22652b7e418506fab23052d569b85d3aec4883f (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Default Engines Hash : c22652b7e418506fab23052d569b85d3aec4883f
Studio : 0.423.0
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 19 (7 by maintainers)
This helped me to resolve the issue! Many thanks!
Migration works on the port
5432, but doesn’t work on6543@janpio done
Hello! I also get this error!
I use the connection string from Settings > Database > Connection Pooling
Not same error, but migration progression failed due to supabase Timeout. I will attach screenshoot tonight
Can you try the other connection string that Supabase gives you under
Settings -> Database -> Connection String?We know this is pretty confusing, but can’t really think of a way to nicely surface this information when you use Prisma with the wrong (pooled) connection string to run Prisma Migrate.