0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SupabaseとHasuraの接続で詰まったところ

Last updated at Posted at 2025-05-05

状況

公式の手順を参考にSupabaseとHasuraを接続させようとしていたところ、次の様なエラーが出た。

[
	{
		"definition": "...",
		"message": "connection to server at ... , port 5432 failed: Network is unreachable\n\tIs the server running on that host and accepting TCP/IP connections?\n",
		"name": "source ...",
		"reason": "Inconsistent object: connection error",
		"type": "source"
	}
]

※一部マスクしています

原因

  • SupabaseのデフォルトDBはIPv6アドレスでのみ接続を受け付けるようになっている
  • 一方、HasuraはIPv4しか使えず、IPv6ではネットワークに到達できない
  • そのため、「Network is unreachable」や「Is the server running on that host and accepting TCP/IP connections?」というエラーが発生する

解決策

Supabaseの「Session Pooler」機能で、IPv4互換の接続URLを使用する

  1. Supabaseダッシュボードの「Database」→「Settings」→「Session Pooler」から「IPv4互換のURL」を取得
  2. そのURLをDATABASE_URLに設定する

image.png

その他参考

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?