I have a Phoenix application I am developing on OSX and using distillery and e-deliver to deploy to my Debian server.
I’m using https://github.com/aposto/plug_session_redis to store session data which works fine locally but it’s failing to start on the server. Redis is running on both and I can connect using redis-cli
,
My config (notice the single quotes around localhost, double quotes does not work):
config :plug_session_redis, :config,
name: :sessions,
pool: [size: 2, max_overflow: 5],
redis: [host: 'localhost', port: 6379]
=====
===== LOGGING STARTED Fri May 11 02:05:54 UTC 2018
=====
Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]
02:05:57.574 [error] GenServer #PID<0.2077.0> terminating
** (MatchError) no match of right hand side value: {:error, {:EXIT, {:undef, [{:redo, :start_link, [:undefined, [host: 'localhost', port: 6379]], []}, {:supervisor, :do_start_child_i, 3, [file: 'supervisor.erl', line: 381]}, {:supervisor, :handle_call, 3, [file: 'supervisor.erl', line: 406]}, {:gen_server, :try_handle_call, 4, [file: 'gen_server.erl', line: 636]}, {:gen_server, :handle_msg, 6, [file: 'gen_server.erl', line: 665]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}}
(poolboy) src/poolboy.erl:275: :poolboy.new_worker/1
(poolboy) src/poolboy.erl:296: :poolboy.prepopulate/3
(poolboy) src/poolboy.erl:145: :poolboy.init/3
(stdlib) gen_server.erl:365: :gen_server.init_it/2
(stdlib) gen_server.erl:333: :gen_server.init_it/6
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: {:EXIT, #PID<0.2076.0>, {{:badmatch, {:error, {:EXIT, {:undef, [{:redo, :start_link, [:undefined, [host: 'localhost', port: 6379]], []}, {:supervisor, :do_start_child_i, 3, [file: 'supervisor.erl', line: 381]}, {:supervisor, :handle_call, 3, [file: 'supervisor.erl', line: 406]}, {:gen_server, :try_handle_call, 4, [file: 'gen_server.erl', line: 636]}, {:gen_server, :handle_msg, 6, [file: 'gen_server.erl', line: 665]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}}}, [{:poolboy, :new_worker, 1, [file: 'src/poolboy.erl', line: 275]}, {:poolboy, :prepopulate, 3, [file: 'src/poolboy.erl', line: 296]}, {:poolboy, :init, 3, [file: 'src/poolboy.erl', line: 145]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 365]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 333]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}
02:05:57.576 [info] Application plug_session_redis exited: PlugSessionRedis.start(:normal, []) returned an error: shutdown: failed to start child: :sessions
** (EXIT) an exception was raised:
** (MatchError) no match of right hand side value: {:error, {:EXIT, {:undef, [{:redo, :start_link, [:undefined, [host: 'localhost', port: 6379]], []}, {:supervisor, :do_start_child_i, 3, [file: 'supervisor.erl', line: 381]}, {:supervisor, :handle_call, 3, [file: 'supervisor.erl', line: 406]}, {:gen_server, :try_handle_call, 4, [file: 'gen_server.erl', line: 636]}, {:gen_server, :handle_msg, 6, [file: 'gen_server.erl', line: 665]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}}
(poolboy) src/poolboy.erl:275: :poolboy.new_worker/1
(poolboy) src/poolboy.erl:296: :poolboy.prepopulate/3
(poolboy) src/poolboy.erl:145: :poolboy.init/3
(stdlib) gen_server.erl:365: :gen_server.init_it/2
(stdlib) gen_server.erl:333: :gen_server.init_it/6
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
{"Kernel pid terminated",application_controller,"{application_start_failure,plug_session_redis,{{shutdown,{failed_to_start_child,sessions,{{badmatch,{error,{'EXIT',{undef,[{redo,start_link,[undefined,[{host,\"localhost\"},{port,6379}]],[]},{supervisor,do_start_child_i,3,[{file,\"supervisor.erl\"},{line,381}]},{supervisor,handle_call,3,[{file,\"supervisor.erl\"},{line,406}]},{gen_server,try_handle_call,4,[{file,\"gen_server.erl\"},{line,636}]},{gen_server,handle_msg,6,[{file,\"gen_server.erl\"},{line,665}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,247}]}]}}}},[{poolboy,new_worker,1,[{file,\"src/poolboy.erl\"},{line,275}]},{poolboy,prepopulate,3,[{file,\"src/poolboy.erl\"},{line,296}]},{poolboy,init,3,[{file,\"src/poolboy.erl\"},{line,145}]},{gen_server,init_it,2,[{file,\"gen_server.erl\"},{line,365}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,333}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,247}]}]}}},{'Elixir.PlugSessionRedis',start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,plug_session_redis,{{shutdown,{failed_to_start_child,sessions,{{badmatch,{error,{'EXIT',{undef,[{redo,start_link,[undef
Crash dump is being written to: erl_crash.dump...done