amarandon
Hello everybody,
Sometimes my test suite fails with errors like this:
** (RuntimeError) could not lookup Manager.Repo because it was not started or it does not exist
On my colleague’s machine it happens a lot, much less on my machine and almost never on our CI server. So I guess it’s some kind of race condition but I don’t know what’s causing it. The ecto repo is the first child of our top-level supervisor but apparently that’s not always enough.
Is there a way to ensure the ecto repo is correctly started before trying to run any test?
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
Hi all,
I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
I’m very new to Elixir, so sorry if this is a silly question:
I am wondering what happens to the mailbox of a process when the machine i...
New
How do I tell Hologram not to escape HTML when substituting into templates?
{Textile.render(@product.long_description)}
escapes the HTM...
New
Background
When trying to execute mix release on a Windows 11 machine for a Phoenix project I get the following error:
* assembling mark...
New
Hi,
we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
I’d like to create a file with 600 permissions (rw-------), but there’s a race condition if I create it and then change the permissions. ...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
Hi everyone :waving_hand:
I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #code-sync
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #elixirconf-us
- #podcasts-by-brainlid
- #blog-post
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #elixirconf-eu
- #processes
- #security
- #api
- #forms
- #performance










Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
hubertlepicki
Tell us more about your app. Is this umbrella project by any chance and the failing tests come from different app than the one which defined Repo?
shamanime
I also have this issue from time to time.
I’m sure it started after upgrading libraries but I didn’t bother inspecting it yet. Might do it tomorrow.
Your colleague is not alone.
amarandon
It is an umbrella app in which only one app has a repo. Failing tests are from the app that has the repo.
The problem occurs both when we run tests from the umbrella top level directory and we run them from the app subdirectory.
That being said, that app which has a repo and failing tests also specifies another app, which also has its own repo, as a
:pathdependency in itsmix.exsdeps entry. I don’t see any reference to that other app in the tests errors though.andreapavoni
Same problem for me. I have an umbrella app that I’m trying to migrate from Ecto 2.x to Ecto 3.x
Running the tests on the single apps (10+ apps) works as expected.
Running the tests from the umbrella gives several errors on all the apps, like this:
** (RuntimeError) could not lookup SomeApp.Repo because it was not started or it does not existChecked configs and settings, it looks like all is correct, after all they all passed (1000+ tests) before migration to ecto 3.x and, as I said, tests are failing only when I run them from the umbrella.
josevalim
What is most likely happening is that your supervision tree is restarting, temporarily bringing down the ecto repo supervisor. You can verify it by adding this to your repo:
andreapavoni
Hi @josevalim thank you for your quick reply.
Sorry for delay, but the next day I went on vacation and I didn’t tried.
Now that I’m back to work, I tried your suggestion and added the
putson all theRepomodules in the apps of the umbrella. What I’ve noted is that the messageSTARTING X REPOfor each app is displayed at the very beginning of the test run (mix teston the umbrella app), but then I get the same errors when tests are executed.So, your hypothesis is correct, do you have any suggestions on how to fix this?
Thank you in advance.
josevalim
You need to figure out what is causing your supervision tree to restart and change it accordingly so it doesn’t restart all the time. You can enable handle_sasl_reports in Logger to get more complete reports.