electric-sql / electric

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

Sync service 12.0.1 fails to connect to the database with {:case_clause, :undefined} error #1395

Closed alco closed 3 months ago

alco commented 3 months ago

Full server log when trying to run electricsql/electric:0.12.1 on DO with DO's managed Postgres:

[2024-06-20 14:37:24] 14:37:24.179 pid=<0.3055.0> [info] Starting ElectricSQL 0.12.1 in direct_writes mode.
[2024-06-20 14:37:24] 14:37:24.193 pid=<0.3056.0> [info] Running Electric.Plug.Router with Bandit 1.5.3 at :::5133 (http)
[2024-06-20 14:37:24] ▓ ┌────────────────────────┐
[2024-06-20 14:37:24] ▓ │  INITIALISATION ERROR  │
[2024-06-20 14:37:24] ▓ ┕━━━━━━━━━━━━━━━━━━━━━━━━┙
[2024-06-20 14:37:24] ▓ 
[2024-06-20 14:37:24] ▓ Failed to start child Electric.Replication.PostgresConnectorMng:
[2024-06-20 14:37:24] ▓   {{:case_clause, :undefined}, [{Electric.Replication.PostgresConnectorMng, :get_verify_peer_opts, 0, [file: ~c"lib/electric/replication/postgres_manager.ex", line: 358]}, {Electric.Replication.PostgresConnectorMng, :maybe_verify_peer, 1, [file: ~c"lib/electric/replication/postgres_manager.ex", line: 350]}, {Keyword, :update!, 4, [file: ~c"lib/keyword.ex", line: 1144]}, {Keyword, :update!, 4, [file: ~c"lib/keyword.ex", line: 1148]}, {Electric.Replication.PostgresConnectorMng, :update_connector_config, 2, [file: ~c"lib/electric/replication/postgres_manager.ex", line: 119]}, {Electric.Replication.PostgresConnectorMng, :init, 1, [file: ~c"lib/electric/replication/postgres_manager.ex", line: 94]}, {:gen_server, :init_it, 2, [file: ~c"gen_server.erl", line: 2057]}, {:gen_server, :init_it, 6, [file: ~c"gen_server.erl", line: 2012]}]}
[2024-06-20 14:37:24] ▓ 
[2024-06-20 14:37:24] ▓ Please file a new issue on GitHub[1], including the contents of this error.
[2024-06-20 14:37:24] ▓ 
[2024-06-20 14:37:24] ▓ [1]: https://github.com/electric-sql/electric/issues
[2024-06-20 14:37:24] 
[2024-06-20 14:37:24] ••• Shutting down •••
[2024-06-20 14:37:24] 
[2024-06-20 14:37:24] [os_mon] memory supervisor port (memsup): Erlang has closed
[2024-06-20 14:37:24] [os_mon] cpu supervisor port (cpu_sup): Erlang has closed
linear[bot] commented 3 months ago

VAX-1987 Sync service 12.0.1 fails to connect to the database with {:case_clause, :undefined} error

alco commented 3 months ago

This is caused by an issue in Erlang. It was introduced in OTP 26.2. Electric's sync service had been using OTP 25.x up until version 0.12.1 in which we upgrade to OTP 27.0.