LoginSignup
4
3

More than 1 year has passed since last update.

SupabaseにPrismaからマイグレーションした際のbouncer config error

Posted at

初歩的なミスですが同じように困る人もいるかもしれないのでメモ程度に残しておきます。

環境:Prisma Client 4.13

npx prisma migrate dev --name init
コマンドを実行してマイグレーションを実行したところ、以下のエラーが発生しました。

Error: db error: FATAL: bouncer config error
   0: schema_core::state::DevDiagnostic
             at schema-engine/core/src/state.rs:266

原因と対策

DATABASE_URLで設定しているSupabaseのポート番号が間違っていた(6543になっていた)ことが原因でした。
公式サイトの情報をもとに以下の形式に合わせてポート番号5432を指定することで解決しました。

.env
DATABASE_URL="postgres://postgres:[YOUR-PASSWORD]@db.[YOUR-PROJECT-REF].supabase.co:5432/postgres"

6543はコネクションプール用のポート番号なので、Supabaseから接続情報をコピーしてくる際に誤ってConnection stringではなくConnection Poolingの方からコピーしてしまったようでした:joy:

参考

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3