SkillDevs / electric_dart

A Dart implementation for Electric (electric-sql.com).
Apache License 2.0
104 stars 9 forks source link

MODULE ERROR: Electric.Replication.PostgresConnector when trying to connect to Supabase #25

Closed maysayson closed 4 months ago

maysayson commented 5 months ago

Hello!

I have been trying to implement ElectricSQL with Supabase on my Flutter application using the electricsql and electricsql_cli libraries. I was able to connect to Supabase when using the 0.6.0 version of the cli library but when I try to upgrade to a more recent version, it is giving me this issue whenever I do dart run electricsql_cli start.

I am using an IPv4 network and have purchased the IPv4 add-on for my Supabase

Attaching to electric-1
electric-1  | 20:32:56.851 pid=<0.3063.0> [info] Starting ElectricSQL 0.12.0 in direct_writes mode.
electric-1  | 20:32:56.854 pid=<0.3064.0> [info] Running Electric.Plug.Router with Bandit 1.1.3 at 0.0.0.0:5133 (http)
electric-1  | 20:32:57.001 pid=<0.3378.0> origin=postgres_1 [info] Postgres.Client.with_conn(%{database: ~c"postgres", host: ~c"db.cqfxdrhfbhndsunpddnj.supabase.co", ip_addr: ~c"18.130.41.129", ipv6: false, nulls: [nil, :null, :undefined], password: ~c"******", port: 5432, ssl: true, ssl_opts: [server_name_indication: ~c"db.cqfxdrhfbhndsunpddnj.supabase.co"], timeout: 5000, username: ~c"postgres"})
electric-1  | 20:32:57.618 pid=<0.3381.0> [warning] Description: ~c"Server authenticity is not verified since certificate path validation is not enabled"
electric-1  |      Reason: ~c"The option {verify, verify_peer} and one of the options 'cacertfile' or 'cacerts' are required to enable this."
electric-1  | 
electric-1  | 20:33:00.706 pid=<0.3056.0> [info] tzdata release in place is from a file last modified Fri, 22 Oct 2021 02:20:47 GMT. Release file on server was last modified Thu, 01 Feb 2024 18:40:48 GMT.
electric-1  | 20:33:01.926 pid=<0.3051.0> [info] Tzdata has updated the release from 2021e to 2024a
electric-1  | 20:33:15.438 pid=<0.3378.0> origin=postgres_1 [info] Successfully initialized origin postgres_1 at extension version 
electric-1  | 20:33:15.452 pid=<0.3400.0> [info] Starting Proxy server listening on port 65432
electric-1  | 20:33:16.106 pid=<0.3406.0> [warning] Description: ~c"Server authenticity is not verified since certificate path validation is not enabled"
electric-1  |      Reason: ~c"The option {verify, verify_peer} and one of the options 'cacertfile' or 'cacerts' are required to enable this."
electric-1  | 
electric-1  | 20:33:16.107 pid=<0.3407.0> [warning] Description: ~c"Server authenticity is not verified since certificate path validation is not enabled"
electric-1  |      Reason: ~c"The option {verify, verify_peer} and one of the options 'cacertfile' or 'cacerts' are required to enable this."
electric-1  | 
electric-1  | 20:33:16.108 pid=<0.3413.0> [warning] Description: ~c"Server authenticity is not verified since certificate path validation is not enabled"
electric-1  |      Reason: ~c"The option {verify, verify_peer} and one of the options 'cacertfile' or 'cacerts' are required to enable this."
electric-1  | 
electric-1  | 20:33:16.109 pid=<0.3405.0> [warning] Description: ~c"Server authenticity is not verified since certificate path validation is not enabled"
electric-1  |      Reason: ~c"The option {verify, verify_peer} and one of the options 'cacertfile' or 'cacerts' are required to enable this."
electric-1  | 
electric-1  | 20:33:16.109 pid=<0.3404.0> [warning] Description: ~c"Server authenticity is not verified since certificate path validation is not enabled"
electric-1  |      Reason: ~c"The option {verify, verify_peer} and one of the options 'cacertfile' or 'cacerts' are required to enable this."
electric-1  | 
electric-1  | 20:33:16.110 pid=<0.3412.0> [warning] Description: ~c"Server authenticity is not verified since certificate path validation is not enabled"
electric-1  |      Reason: ~c"The option {verify, verify_peer} and one of the options 'cacertfile' or 'cacerts' are required to enable this."
electric-1  | 
electric-1  | 20:33:16.111 pid=<0.3408.0> [warning] Description: ~c"Server authenticity is not verified since certificate path validation is not enabled"
electric-1  |      Reason: ~c"The option {verify, verify_peer} and one of the options 'cacertfile' or 'cacerts' are required to enable this."
electric-1  | 
electric-1  | 20:33:16.150 pid=<0.3409.0> [warning] Description: ~c"Server authenticity is not verified since certificate path validation is not enabled"
electric-1  |      Reason: ~c"The option {verify, verify_peer} and one of the options 'cacertfile' or 'cacerts' are required to enable this."
electric-1  | 
electric-1  | 20:33:16.152 pid=<0.3411.0> [warning] Description: ~c"Server authenticity is not verified since certificate path validation is not enabled"
electric-1  |      Reason: ~c"The option {verify, verify_peer} and one of the options 'cacertfile' or 'cacerts' are required to enable this."
electric-1  | 
electric-1  | 20:33:16.155 pid=<0.3410.0> [warning] Description: ~c"Server authenticity is not verified since certificate path validation is not enabled"
electric-1  |      Reason: ~c"The option {verify, verify_peer} and one of the options 'cacertfile' or 'cacerts' are required to enable this."
electric-1  | 
electric-1  | 20:33:18.471 pid=<0.3378.0> origin=postgres_1 [error] PostgresConnectorSup failed to start child Electric.Satellite.ClientReconnectionInfo with reason: {%DBConnection.ConnectionError{message: "connection not available and request was dropped from queue after 2999ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:\n\n  1. Ensuring your database is available and that you can connect to it\n  2. Tracking down slow queries and making sure they are running fast enough\n  3. Increasing the pool_size (although this increases resource consumption)\n  4. Allowing requests to wait longer by increasing :queue_target and :queue_interval\n\nSee DBConnection.start_link/2 for more information\n", severity: :error, reason: :queue_timeout}, [{DBConnection, :run, 3, [file: ~c"lib/db_connection.ex", line: 960, error_info: %{module: Exception}]}, {Electric.Satellite.ClientReconnectionInfo, :init, 1, [file: ~c"lib/electric/satellite/client_reconnection_info.ex", line: 1028]}, {:gen_server, :init_it, 2, [file: ~c"gen_server.erl", line: 851]}, {:gen_server, :init_it, 6, [file: ~c"gen_server.erl", line: 814]}, {:proc_lib, :init_p_do_apply, 3, [file: ~c"proc_lib.erl", line: 240]}]}.
electric-1  | ▓ ┌────────────────────────────────────────────────────────┐
electric-1  | ▓ │  MODULE ERROR: Electric.Replication.PostgresConnector  │
electric-1  | ▓ ┕━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┙
electric-1  | ▓ 
electric-1  | ▓ Failed to start child Electric.Satellite.ClientReconnectionInfo:
electric-1  | ▓   {%DBConnection.ConnectionError{message: "connection not available and request was dropped from queue after 2999ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:\n\n  1. Ensuring your database is available and that you can connect to it\n  2. Tracking down slow queries and making sure they are running fast enough\n  3. Increasing the pool_size (although this increases resource consumption)\n  4. Allowing requests to wait longer by increasing :queue_target and :queue_interval\n\nSee DBConnection.start_link/2 for more information\n", severity: :error, reason: :queue_timeout}, [{DBConnection, :run, 3, [file: ~c"lib/db_connection.ex", line: 960, error_info: %{module: Exception}]}, {Electric.Satellite.ClientReconnectionInfo, :init, 1, [file: ~c"lib/electric/satellite/client_reconnection_info.ex", line: 1028]}, {:gen_server, :init_it, 2, [file: ~c"gen_server.erl", line: 851]}, {:gen_server, :init_it, 6, [file: ~c"gen_server.erl", line: 814]}, {:proc_lib, :init_p_do_apply, 3, [file: ~c"proc_lib.erl", line: 240]}]}
electric-1  | ▓ 
electric-1  | ▓ Please file a new issue on GitHub[1], including the contents of this error.
electric-1  | ▓ 
electric-1  | ▓ [1]: https://github.com/electric-sql/electric/issues
electric-1  | 
electric-1  | ••• Shutting down •••
electric-1  | 
electric-1  | [os_mon] cpu supervisor port (cpu_sup): Erlang has closed
electric-1  | [os_mon] memory supervisor port (memsup): Erlang has closed
electric-1 exited with code 1

Thank you for the help

davidmartos96 commented 5 months ago

@maysayson Hello! I assume you have followed the official Supabase guide here: https://electric-sql.com/docs/deployment/supabase

For this kind of error you might have better luck asking either on the official Discord server or on the official Electric GitHub repository.

We would only be able to help you with client related issues on Flutter/Dart.

maysayson commented 4 months ago

Got it! Thank you for the fast response and for your hard work!

davidmartos96 commented 4 months ago

@maysayson I assume this can be closed now that you resolved the issue on the official repository.