I’ve been running my Phoenix app with Oban (not Pro) inside my devcontainer recently, but every 2nd to 3rd time when I make a code change and need to recompile 200+ modules, the Oban.Registry crashes which then terminates my application.
This is a typical output of such a crash:
Compiling 273 files (.ex)
[error] GenServer {Oban.Registry, {Oban, Oban.Stager}} terminating
** (UndefinedFunctionError) function MyApp.Repo.transaction/2 is undefined (module MyApp.Repo is not available)
(MyApp 1.3.61) MyApp.Repo.transaction(#Function<4.61619042/0 in Oban.Stager.stage_and_notify/2>, [prefix: "public", log: false, oban: true, telemetry_options: [oban_conf: %Oban.Config{dispatch_cooldown: 5, engine: Oban.Engines.Basic, get_dynamic_repo: nil, insert_trigger: true, log: false, name: Oban, node: "16a78d4bc670", notifier: {Oban.Notifiers.PG, []}, peer: {Oban.Peers.Database, []}, plugins: [{Oban.Plugins.Cron, [crontab: []]}, {Oban.Plugins.Pruner, []}], prefix: "public", queues: [default: [limit: 10], backups: [limit: 5], social_feeds: [limit: 5]], repo: MyApp.Repo, shutdown_grace_period: 15000, stage_interval: 1000, testing: :disabled}]])
(oban 2.21.1) lib/oban/repo.ex:156: Oban.Repo.transaction/4
(oban 2.21.1) lib/oban/stager.ex:85: Oban.Stager.stage_and_notify/2
(oban 2.21.1) lib/oban/stager.ex:59: anonymous fn/2 in Oban.Stager.handle_info/2
(telemetry 1.4.1) /workspace/deps/devcontainer/telemetry/src/telemetry.erl:359: :telemetry.span/3
(oban 2.21.1) lib/oban/stager.ex:58: Oban.Stager.handle_info/2
(stdlib 7.2.1) gen_server.erl:2434: :gen_server.try_handle_info/3
(stdlib 7.2.1) gen_server.erl:2420: :gen_server.handle_msg/3
(stdlib 7.2.1) proc_lib.erl:333: :proc_lib.init_p_do_apply/3
Last message: :stage
State: %Oban.Stager{conf: %Oban.Config{dispatch_cooldown: 5, engine: Oban.Engines.Basic, get_dynamic_repo: nil, insert_trigger: true, log: false, name: Oban, node: "16a78d4bc670", notifier: {Oban.Notifiers.PG, []}, peer: {Oban.Peers.Database, []}, plugins: [{Oban.Plugins.Cron, [crontab: []]}, {Oban.Plugins.Pruner, []}], prefix: "public", queues: [default: [limit: 10], backups: [limit: 5], social_feeds: [limit: 5]], repo: MyApp.Repo, shutdown_grace_period: 15000, stage_interval: 1000, testing: :disabled}, timer: #Reference<0.2559755388.3220963335.234290>, interval: 1000, limit: 5000, mode: :global}
*** -> The error above repeats a few times
[notice] Application my_app exited: shutdown
I already tried wrapping the Oban Supervisor in my own Supervisor that has a higher restart retry count and also an exponential backoff for restarting the Oban.Registry, but that didn’t help either.
I don’t experience this outside of my devcontainer, so I’m not sure what causes this.






















