electric-sql / electric

Sync little subsets of your Postgres data into local apps and services.
https://electric-sql.com
Apache License 2.0
6.22k stars 147 forks source link

electric-sql generate stuck while using Supabase #863

Closed marksteve closed 3 months ago

marksteve commented 8 months ago

Logs

Generating Electric client...
Service URL: http://localhost:5133
Proxy URL: postgresql://prisma:@localhost:65432/electric

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\[!NOTE\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\] ELECTRIC_PROXY wasn't being respected but I could at least do

export ELECTRIC_DATABASE_NAME=electric
export ELECTRIC_PG_PROXY_PASSWORD=$PG_PROXY_PASSWORD

electricsql/electric:0.9

02:35:17.962 pid=<0.3144.0> proxy_session_id=2 [warning] Unsupported SASL mechanism "SCRAM-SHA-256-PLUS"
02:35:18.192 pid=<0.3143.0> proxy_session_id=2 [info] Upstream connection is ready to accept queries
02:35:18.216 pid=<0.3143.0> proxy_session_id=2 [info] Matched prisma introspection query to Elixir.Electric.Postgres.Proxy.Prisma.Query.NamespaceV5_2
02:35:18.218 pid=<0.3143.0> proxy_session_id=2 [info] Matched prisma introspection query to Elixir.Electric.Postgres.Proxy.Prisma.Query.TableListV4_8
02:35:18.220 pid=<0.3143.0> proxy_session_id=2 [info] Matched prisma introspection query to Elixir.Electric.Postgres.Proxy.Prisma.Query.TypeV4_8
02:35:18.222 pid=<0.3143.0> proxy_session_id=2 [info] Matched prisma introspection query to Elixir.Electric.Postgres.Proxy.Prisma.Query.ColumnV4_8
02:35:18.225 pid=<0.3143.0> proxy_session_id=2 [info] Matched prisma introspection query to Elixir.Electric.Postgres.Proxy.Prisma.Query.ForeignKeyV4_8
02:35:18.227 pid=<0.3143.0> proxy_session_id=2 [info] Matched prisma introspection query to Elixir.Electric.Postgres.Proxy.Prisma.Query.IndexV4_8
02:35:18.229 pid=<0.3143.0> proxy_session_id=2 [info] Matched prisma introspection query to Elixir.Electric.Postgres.Proxy.Prisma.Query.ViewV4_8
02:35:18.230 pid=<0.3143.0> proxy_session_id=2 [info] Matched prisma introspection query to Elixir.Electric.Postgres.Proxy.Prisma.Query.FunctionV5_2
02:35:18.231 pid=<0.3143.0> proxy_session_id=2 [info] Matched prisma introspection query to Elixir.Electric.Postgres.Proxy.Prisma.Query.ExtensionV5_2
02:35:18.233 pid=<0.3143.0> proxy_session_id=2 [info] Matched prisma introspection query to Elixir.Electric.Postgres.Proxy.Prisma.Query.SequenceV5_2
linear[bot] commented 8 months ago

VAX-1556 electric-sql generate stuck while using Supabase

alco commented 8 months ago

Hey @marksteve :wave:

Looks like you're using the new client API but it's connecting to localhost. Are you working with self-hosted Supabase?

marksteve commented 8 months ago

@alco Nope. The proxy is connected to hosted Supabase. Side note: Took me a while to notice but there were times my IP got blocked by Supabase. Something that might be useful to add in the documentation!

alco commented 8 months ago

@marksteve So have you tracked the hanging of the proxy to Supabase blocking your IP? Did you managed to generate a client after rerunning npx electric-sql generate?

marksteve commented 8 months ago

@alco Ah sorry that was a different issue. The proxy connects to Supabase properly to set up the electric schema and subscribe to the replication but it just hangs when I try to generate.

I'm try to replicate now but I'm encountering a different issue... I'll created a separate issue: #888

alco commented 8 months ago

@alco Nope. The proxy is connected to hosted Supabase. Side note: Took me a while to notice but there were times my IP got blocked by Supabase. Something that might be useful to add in the documentation!

I believe this is caused by Supabase dropping IPv4 support for direct database connections recently. Make sure you can reach the DB with psql from your network. If that works, you'll need to enable IPv6 support for the Docker daemon as explained in this guide and recreate the Docker network that our CLI has created by running npm run backend:down.

If your home router or ISP does not support IPv6, you'll have to resort to using a VPN.