7

When I use the Postgres database on Supabase I run the following command, npx prisma migrate dev --name init, but I get the following error (first command in screenshot):

Error: db error: FATAL: bouncer config error
   0: migration_core::state::DevDiagnostic
             at migration-engine/core/src/state.rs:251

When I use railway.app, with a Postgres database it migrates successfully (second command in screenshot).

screenshot of prisma command, first is supabase, bottom is railway.app

1 Answer 1

30

I fixed this error on my end by replacing the port number of my connection string from 6543 to 5432.

Reason: 6543 is the pooled port number which should not be used when migrating, instead the non-pooled connection string using 5432 should be used

Hope this helps!

Source: Second paragraph of the section "Connection pooling with Supabase" https://supabase.com/docs/guides/integrations/prisma#connection-pooling-with-supabase

1
  • 1
    Alternatively: You can use "directUrl" in the "datasource db"-settings of the schema and set the Url there. Nov 19, 2023 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.