[Supabase][DigitalOcean] Deployment of electric-sync-service fails with a connection error
Following the guide the deployment the electric-sync-service to DigitalOcean fails with a connection error:
Steps to repro:
- [X] Crete a new Supabase project
- [X] Initiate DigitalOcean deployment going to https://cloud.digitalocean.com/apps/new?repo=https://github.com/electric-sql/deploy-to-do/tree/service-only
- [X] DATABASE_URL set to Direct database access via IPv4 ->
postgresql://postgres:[YOUR-PASSWORD]@db.[PROJECT_ID].supabase.co:5432/postgres - [X] the rest
┌────────────────────┐
[electric] [2024-02-10 12:08:00] ▓ │ CONNECTION ERROR │
[electric] [2024-02-10 12:08:00] ▓ ┕━━━━━━━━━━━━━━━━━━━━┙
[electric] [2024-02-10 12:08:00] ▓
[electric] [2024-02-10 12:08:00] ▓ Failed to initialize Postgres state:
[electric] [2024-02-10 12:08:00] ▓ {:error, :ehostunreach}
[electric] [2024-02-10 12:08:00] ▓
[electric] [2024-02-10 12:08:00] ▓ Double-check the value of DATABASE_URL and make sure your database
[electric] [2024-02-10 12:08:00] ▓ is running and can be reached using the connection URL in DATABASE_URL.
[electric] [2024-02-10 12:08:00] 12:08:00.063 pid=<0.2807.0> [error] GenServer #PID<0.2807.0> terminating
[electric] [2024-02-10 12:08:00] ** (stop) :ehostunreach
[electric] [2024-02-10 12:08:00] Last message (from #PID<0.2803.0>): {:command, :epgsql_cmd_connect, %{database: ~c"postgres", host: {9728, 7964, 249, 19723, 33092, 30856, 56748, 3882}, nulls: [nil, :null, :undefined], password: #Function<0.69625977/0 in :epgsql_cmd_connect.hide_password/1>, port: 5432, ssl: true, ssl_opts: [server_name_indication: ~c"db.REDACTED_PROJECT_ID.supabase.co"], tcp_opts: [:inet6], timeout: 5000, username: ~c"postgres"}}
[electric] [2024-02-10 12:08:00] 12:08:00.063 pid=<0.2803.0> origin=postgres_1 [error] Initialization of Postgres state failed with reason: {:error, :ehostunreach}.
[electric] [2024-02-10 12:08:00] 12:08:00.063 pid=<0.2803.0> origin=postgres_1 [info] schedule retry: 2000
[electric] [2024-02-10 12:08:02] 12:08:02.064 pid=<0.2803.0> origin=postgres_1 [info] Electric.Replication.Postgres.Client.with_conn(%{database: ~c"postgres", host: ~c"db.REDACTED_PROJECT_ID.supabase.co", ip_addr: ~c"2600:1f1c:f9:4d0b:8144:7888:ddac:f2a", ipv6: true, nulls: [nil, :null, :undefined], password: ~c"******", port: 5432, ssl: true, ssl_opts: [server_name_indication: ~c"db.REDACTED_PROJECT_ID.supabase.co"], tcp_opts: [:inet6], timeout: 5000, username: ~c"postgres"})
[electric] [2024-02-10 12:08:02] 12:08:02.065 pid=<0.2808.0> [error] GenServer #PID<0.2808.0> terminating
Friendly Reminder: Have you ever paid for ipv4 add-on for supabase? See https://supabase.com/docs/guides/platform/ipv4-address for more information
@atanaskanchev I've reached out to DigitalOcean's support and got a response from them:
IPv6 isn't supported in app platform. [...] As an alternative you could use our managed database service which would work with that still, or possibly running that on a droplet instead which does support IPv6.
What version of PostgreSQL you have at Supabase, @atanaskanchev ?