question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Supabase: db error: ERROR: unexpected response from login query

See original GitHub issue

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

  1. Go to Supabase
  2. Create or login account
  3. Create an project
  4. Go to Database > Connection Pooling
  5. Scroll to bottom and copy Connection string
  6. Replace DATABASE_URL in environment variable
  7. Run npx prisma migrate dev
  8. 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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
pyonercommented, Oct 19, 2021

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.

This helped me to resolve the issue! Many thanks!

Migration works on the port 5432, but doesn’t work on 6543

1reaction
brandonpsmithcommented, Dec 15, 2022

@janpio done

Read more comments on GitHub >

github_iconTop Results From Across the Web

db error: FATAL: unexpected response from login query #14069
Create a database on supabase and use the url connection-string,; Run the yarn prisma generate command. Run the yarn prisma migrate dev command....
Read more >
closing because: unexpected response from login query ...
Okay, so the issue was that I was trying to log in as one of the admin_users (aakashverma) but I hadn't mentioned them...
Read more >
After resetting database, PgBouncer error unexpected ... - GitLab
After getting the database setup, they tried to implement pgbouncer again and are now seeing Pooler Error: unexpected response from login query ......
Read more >
Supabase Documentation
supabase -js always returns a data object (for success), and an error response (for unsuccessful requests). This provides a simple interface to get...
Read more >
instaloader.exceptions.connectionexception: login error: unexpected ...
I am getting db error: ERROR: unexpected response from login query when try to use supabase as database. This only happens when accessing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found