Closed stochastic-thread closed 8 years ago
relevant output, sorry for the massive copy/paste above:
C:\Users\arthu\Code\elixir\phoenix\holly>mix phoenix.server
[info] Running Holly.Endpoint with Cowboy using http on port 4000
[info] Application holly exited: Holly.start(:normal, []) returned an error: shutdown: failed to start child: Holly.Repo
** (EXIT) shutdown: failed to start child: Ecto.Adapters.Postgres
** (EXIT) an exception was raised:
** (RuntimeError) could not find Ecto.Adapters.Postgres.Connection.
Please verify you have added :postgrex as a dependency:
{:postgrex, ">= 0.0.0"}
And remember to recompile Ecto afterwards by cleaning the current build:
mix deps.clean ecto
(ecto) lib/ecto/adapters/sql.ex:420: Ecto.Adapters.SQL.start_link/4
(stdlib) supervisor.erl:343: :supervisor.do_start_child/2
(stdlib) supervisor.erl:326: :supervisor.start_children/3
(stdlib) supervisor.erl:292: :supervisor.init_children/2
(stdlib) gen_server.erl:328: :gen_server.init_it/6
(stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
[info] Application postgrex exited: :stopped
=INFO REPORT==== 21-Jan-2016::20:10:11 ===
application: logger
exited: stopped
type: temporary
** (Mix) Could not start application holly: Holly.start(:normal, []) returned an error: shutdown: failed to start child: Holly.Repo
** (EXIT) shutdown: failed to start child: Ecto.Adapters.Postgres
** (EXIT) an exception was raised:
** (RuntimeError) could not find Ecto.Adapters.Postgres.Connection.
Please verify you have added :postgrex as a dependency:
{:postgrex, ">= 0.0.0"}
And remember to recompile Ecto afterwards by cleaning the current build:
mix deps.clean ecto
(ecto) lib/ecto/adapters/sql.ex:420: Ecto.Adapters.SQL.start_link/4
(stdlib) supervisor.erl:343: :supervisor.do_start_child/2
(stdlib) supervisor.erl:326: :supervisor.start_children/3
(stdlib) supervisor.erl:292: :supervisor.init_children/2
(stdlib) gen_server.erl:328: :gen_server.init_it/6
(stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Done. Ecto 1.1.2 is out with proper deps.
Cool, thanks! :+1:
Hi! I'm experimenting this same issue with ecto 2.2.4 after generating a production release in an umbrella project containing an application generated using mix phx.new.ecto my_repo
.
The thing is that if I generate the release on my development machine, and then y run the release in the foreground, it works fine.
On the other hand, if I generate the release and deploy it to my production server (using distillery and edeliver) and I try to run the umbrella release the same way, it doesn't start throwing the following error:
=CRASH REPORT==== 27-Sep-2017::20:02:10 ===
crasher:
initial call: supervisor:'Elixir.Ecto.Repo.Supervisor'/1
pid: <0.1342.0>
registered_name: []
exception error: #{'__exception__' => true,
'__struct__' => 'Elixir.RuntimeError',
message =>
<<"could not find Ecto.Adapters.Postgres.Connection.\n\nPlease verify you have added :postgrex as a dependency:\n\n {:postgrex, \">= 0.0.0\"}\n\nAnd remember to recompile Ecto afterwards by cleaning the current build:\n\n mix deps.clean --build ecto\n">>}
in function 'Elixir.Ecto.Adapters.SQL':child_spec/4 (lib/ecto/adapters/sql.ex, line 355)
in call from 'Elixir.Ecto.Repo.Supervisor':init/1 (lib/ecto/repo/supervisor.ex, line 123)
in call from supervisor:init/1 (supervisor.erl, line 294)
in call from gen_server:init_it/2 (gen_server.erl, line 365)
in call from gen_server:init_it/6 (gen_server.erl, line 333)
ancestors: ['Elixir.MyRepo.Supervisor',<0.1340.0>]
message_queue_len: 0
messages: []
links: [<0.1341.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 987
stack_size: 27
reductions: 752
neighbours:
=SUPERVISOR REPORT==== 27-Sep-2017::20:02:10 ===
Supervisor: {local,'Elixir.MyRepo.Supervisor'}
Context: start_error
Reason: {#{'__exception__' => true,
'__struct__' => 'Elixir.RuntimeError',
message =>
<<"could not find Ecto.Adapters.Postgres.Connection.\n\nPlease verify you have added :postgrex as a dependency:\n\n {:postgrex, \">= 0.0.0\"}\n\nAnd remember to recompile Ecto afterwards by cleaning the current build:\n\n mix deps.clean --build ecto\n">>},
[{'Elixir.Ecto.Adapters.SQL',child_spec,4,
[{file,"lib/ecto/adapters/sql.ex"},{line,355}]},
{'Elixir.Ecto.Repo.Supervisor',init,1,
[{file,"lib/ecto/repo/supervisor.ex"},{line,123}]},
{supervisor,init,1,[{file,"supervisor.erl"},{line,294}]},
{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}]}]}
Offender: [{pid,undefined},
{id,'Elixir.MyRepo.Repo'},
{mfargs,{'Elixir.MyRepo.Repo',start_link,[]}},
{restart_type,permanent},
{shutdown,infinity},
{child_type,supervisor}]
20:02:10.574 [info] Application my_repo exited: MyRepo.Application.start(:normal, []) returned an error: shutdown: failed to start child: MyRepo.Repo
** (EXIT) an exception was raised:
** (RuntimeError) could not find Ecto.Adapters.Postgres.Connection.
Please verify you have added :postgrex as a dependency:
{:postgrex, ">= 0.0.0"}
And remember to recompile Ecto afterwards by cleaning the current build:
mix deps.clean --build ecto
(ecto) lib/ecto/adapters/sql.ex:355: Ecto.Adapters.SQL.child_spec/4
(ecto) lib/ecto/repo/supervisor.ex:123: Ecto.Repo.Supervisor.init/1
(stdlib) supervisor.erl:294: :supervisor.init/1
(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,my_repo,{{shutdown,{failed_to_start_child,'Elixir.MyRepo.Repo',{#{'__exception__' => true,'__struct__' => 'Elixir.RuntimeError',message => <<\"could not find Ecto.Adapters.Postgres.Connection.\n\nPlease verify you have added :postgrex as a dependency:\n\n {:postgrex, \\">= 0.0.0\\"}\n\nAnd remember to recompile Ecto afterwards by cleaning the current build:\n\n mix deps.clean --build ecto\n\">>},[{'Elixir.Ecto.Adapters.SQL',child_spec,4,[{file,\"lib/ecto/adapters/sql.ex\"},{line,355}]},{'Elixir.Ecto.Repo.Supervisor',init,1,[{file,\"lib/ecto/repo/supervisor.ex\"},{line,123}]},{supervisor,init,1,[{file,\"supervisor.erl\"},{line,294}]},{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.MyRepo.Application',start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,my_repo,{{shutdown,{failed_to_start_child,'Elixir.MyRepo.Repo',{#{'__exception__' => true,'__struct__' =>
Crash dump is being written to: erl_crash.dump...done
What might be going wrong? Thanks in advance :)
I would start by checking if the postgrex
application is available when compiling Ecto and when building the release.
Thanks Jose for the response.
What’s the best approach to do that? Thanks in advance :)
Hi, with a brand new Phoenix project I am experiencing an error where the app is unable to find the Ecto.Adapters.Postgres.Connection module. I was able to build and compile (and run) a Phoenix app yesterday so I suspect that this could be a transient issue but that seems very strange to me.
I have posted the complete output of creating the project and compiling it, attempting to run it near the end. Will xpost issue to phoenix repo as well.