I recently updated my operating system, and now I'm facing this error when running my server. Previously, everything was working fine. Here's the error message:
(Mix) Could not start application main: Main.Application.start(:normal, []) returned an error: shutdown: failed to start child: Oban (EXIT) shutdown: failed to start child: {:via, Registry, {Oban.Registry, {Oban, Oban.Nursery}}} (EXIT) shutdown: failed to start child: {Oban.Registry, {Oban, Foreman}} (EXIT) an exception was raised: ** (ArgumentError) expected :strategy option to be given (elixir 1.12.2) lib/dynamic_supervisor.ex:516: DynamicSupervisor.init/1
Here is the configuration in my application.ex
file:
{Oban, Application.fetch_env!(:main, Oban)}
And this is my configuration in the config.exs
file:
config :main, Oban, repo: Data.Repo, queues: [ events: 10, campaigns: 5, mindbody_import: 5, at_risk_chaflow: 1, auto_close_conversations: 1 ], plugins: [ {Oban.Plugins.Cron, crontab: [{"59 11 * * SUN", Main.WeeklyReports}]} ]
The error seems related to DynamicSupervisor
expecting a :strategy
option, but I am unsure how to resolve it.
Environment Details:
Elixir version: 1.12.2
Oban version: 2.18.3
MacOS Sequoia: 15.1.1
What could have gone wrong here? How do I fix this issue and get the server running again?
Any help or guidance is greatly appreciated!
I was just trying to update the OS, and this happened
You need to upgrade to Elixir 1.14+ to use Oban 1.28.x as stated on the requirements page: https://github.com/oban-bg/oban?tab=readme-ov-file#requirements
Oban requires:
- Elixir 1.14+
- Erlang 24+