JDanielMartinez
** (RuntimeError) could not lookup Ecto repo Repo because it was not started or it does not exist
Hi! May someone helps me, please!
I have two apps into an umbrella project: the first one is Database, which manages queries, and the secon one is an app, which uses some functions from the Database app to check information from the database. I am getting the next error when trying to run tests for functions in the second one which uses functions from the Database app:
** (RuntimeError) could not lookup Ecto repo Repo because it was not started or it does not exist
and this is the setup that I have for my tests:
setup do
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Repo)
end
Most Liked
dogweather
We just solved this problem. In our case, the test database had unexpected data. (!!) It might have had a slightly different schema than expected.
The fix was to recreate the test database with MIX_ENV=test mix ecto.reset.
It was a frustrating experience.
dalerka
I’m also experiencing this issue. and @dogweather’s solution didn’t help.
Can anyone please suggest how to fix this?
This is really weird.
My app is simple (non-umbrella) with the following relevant deps:
{:phoenix, “~> 1.5.1”},
{:phoenix_ecto, “~> 4.1”},
{:ecto_sql, “~> 3.4”},
{:postgrex, “>= 0.0.0”},
BTW, my OS :
Linux 4.15.0-1-amd64 #1 SMP Debian 4.15.4-1~mx17+1 (2018-02-23) x86_64 GNU/Linux
Distributor ID: MX
Description: MX 18.3 Continuum
Release: 18.3
Codename: Continuum
UPDATE: tried the following, but issue persists, preventing me from further development of my app:
mix deps.update --all # Ok
mix ecto.reset # Fail: this keeps throwing the same error (the current topic)
Also dropped both my_dev and my_test DBs via psql then ran mix ecto.reset to no success.
vrod
This comes up sometimes depending on how you are using your repo. Sometimes you just need to start it, e.g.
MyApp.Repo.start_link()
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









