Warning: could not find Ecto repos in any of the apps: [:hello_phx]

This question related to Umbrella/Ecto and might related to Phoenix.

$ mix ecto.create
warning: could not find Ecto repos in any of the apps: [:hello_phx].

You can avoid this warning by passing the -r flag or by setting the
repositories managed by those applications in your config/config.exs:

    config :hello_phx, ecto_repos: [...]

Reproduce steps:

1   mix new hello_umbrella --umbrella
  1 cd hello_umbrella/
  2 cd apps
  3 mix phx.new hello_phx
  4 cd hello_phx/
  5 mix ecto.create

If need the code, here: https://github.com/ajaxdone/umbrella_ecto_issue

Any idea? If only create the Phoenix project without Umbrella, all works fine.

Your steps look as if they where the wrong way around…

Also in your linked github repository there is only a tar file… Usually I’d expect to see your actual files such that I can browse them through github without needing to download them.

But in general, your posted error message tells you exactly what to do. Have you checked if the setting is there?


mix new hello_umbrella --umbrella
cd hello_umbrella/apps
mix phx.new.web
mix phx.new.ecto

Check out https://hexdocs.pm/phoenix/Mix.Tasks.Phx.New.Ecto.html#content and https://hexdocs.pm/phoenix/Mix.Tasks.Phx.New.Web.html#content for more info about these tasks.

@NobbZ, Sorry pasted fish history directly that is reversed order, should run : history -R to get proper order.

Settings are there.

@idi527, I tried what you suggested, by still not very smooth, it failed somewhere else.

But the document really helpes, https://hexdocs.pm/phoenix/Mix.Tasks.Phx.New.html#content

What I did like this:

mix phx.new hello_phx --umbrella

And it does what exactly I want.
Thanks for helping out!

Settings are where? As I said, I can’t browse that tarball on the GitHub UI and I do not download and untar random stuff from the net without eyeballing first or trusting the author(s).

I deleted the tar file. thanks.

In my case it turned out that the “config” directory was under the /lib my my bad, instead it should have been on root ("/") level.

Ensured the below and now it creates the db without issues.

Hope it helps someone, someday.