Copy/pasting the example from the README yielded the following error:
** (Mix) Could not start application XXX: XXX.Application.start(:normal, []) returned an error: shutdown: failed to start child: WalEx.Supervisor
** (EXIT) an exception was raised:
** (Jason.DecodeError) unexpected byte at position 0: 0x65 ("e")
(jason 1.3.0) lib/jason.ex:92: Jason.decode!/2
(walex 0.7.4) lib/walex/supervisor.ex:40: WalEx.Supervisor.init/1
(stdlib 3.16) supervisor.erl:330: :supervisor.init/1
(stdlib 3.16) gen_server.erl:423: :gen_server.init_it/2
(stdlib 3.16) gen_server.erl:390: :gen_server.init_it/6
(stdlib 3.16) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
The relevant part of my :walex config:
config :walex,
db_host: "localhost",
db_user: "postgres",
db_name: "postgres",
// omitting some stuff
max_replication_lag_in_mb: 0,
publications: ["example"], // this line causes the error
// more unrelated stuff
Digging into it a bit, it looks like the :publications key is being JSON decoded. The README could be updated to indicate that value should be a JSON-decodable string, or the Jason.decode() could be removed from lib/walex/supervisor.ex:40. In my case, updating the :publications value to publications: "[\"example\"]" avoids the error.
Copy/pasting the example from the README yielded the following error:
The relevant part of my
:walex
config:Digging into it a bit, it looks like the
:publications
key is being JSON decoded. The README could be updated to indicate that value should be a JSON-decodable string, or theJason.decode()
could be removed fromlib/walex/supervisor.ex:40
. In my case, updating the:publications
value topublications: "[\"example\"]"
avoids the error.