Remote console doesn't seem to have access to all applications in an umbrella app
johnhamelink opened this issue · comments
John Hamelink commented
Hey there,
When using remote_console
, I don't seem to be able to use Ecto, as the DB application hasn't started? To give a little more context, my exrm release consists of an umbrella app with 2 main applications: api
and db
. DB.Repo
is inside the db
application
deploy@ip-10-0-2-126:/home/ubuntu$ /opt/api/bin/api remote_console
Interactive Elixir (1.3.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(remshafd48246-api@127.0.0.1)1> DB.Repo.one(DB.Session)
** (ArgumentError) repo DB.Repo is not started, please ensure it is part of your supervision tree
lib/ecto/query/planner.ex:64: Ecto.Query.Planner.query_lookup/5
lib/ecto/query/planner.ex:48: Ecto.Query.Planner.query_with_cache/6
lib/ecto/repo/queryable.ex:119: Ecto.Repo.Queryable.execute/5
lib/ecto/repo/queryable.ex:40: Ecto.Repo.Queryable.all/4
lib/ecto/repo/queryable.ex:64: Ecto.Repo.Queryable.one/4
iex(remshafd48246-api@127.0.0.1)1>
John Hamelink commented
Update: instead of trying to fix this or waiting for help, I decided to just bite the bullet and take the opportunity to move to distillery, and it works fine there (and wasn't too hard to move either by the way).