When I run mix edeliver migrate production
I get this error:
production node:
user : deploy
host : myIP
path : /home/deploy
response: RPC to 'bot@127.0.0.1' failed: {'EXIT',
{#{'__exception__' => true,
'__struct__' =>
'Elixir.DBConnection.ConnectionError',
message =>
<<"connection not available because of disconnection">>},
[{'Elixir.DBConnection',checkout,2,
[{file,"lib/db_connection.ex"},{line,926}]},
{'Elixir.DBConnection',run,3,
[{file,"lib/db_connection.ex"},{line,742}]},
{'Elixir.DBConnection',run_meter,3,
[{file,"lib/db_connection.ex"},
{line,1133}]},
{'Elixir.DBConnection',prepare_execute,4,
[{file,"lib/db_connection.ex"},{line,584}]},
{'Elixir.Ecto.Adapters.Postgres.Connection',
execute,4,
[{file,
"lib/ecto/adapters/postgres/connection.ex"},
{line,86}]},
{'Elixir.Ecto.Adapters.SQL',sql_call,6,
[{file,"lib/ecto/adapters/sql.ex"},
{line,256}]},
{'Elixir.Ecto.Adapters.SQL','query!',5,
[{file,"lib/ecto/adapters/sql.ex"},
{line,198}]},
{'Elixir.Ecto.Adapters.Postgres',
'-execute_ddl/3-fun-0-',4,
[{file,"lib/ecto/adapters/postgres.ex"},
{line,85}]}]}}
I did remote_console and Application.get_all_env(:example)
to check DB details and they are correct. I am deploying another phoenix application on the same server and database works.
I tried changing pool size on both applications, didn't help.
I think I probably did something small wrong but can't pinpoint due to wired error.
Ok, so over a year later and I still keep running into these vague message migration errors when deploying with edeliver/distilery.
I found the best solution to be enabling remote DB access and modifying dev.exs
config to temporarily use production DB. Then running mix ecto.migrate
shows the actual error, which in my current case was:
permission denied to create extension "pg_trgm"