Can't start DynamicSupervisor

Getting this error when I try to start the new module-based DynamicSupervisor:

20:31:36.393 [info] Application poof_manager exited: Poof.Manager.Application.start(:normal, []) returned an error: shutdown: failed to start child: Poof.Manager.Server.Create.VM.Supervisor
** (EXIT) Poof.Manager.Server.Create.VM.Supervisor.init/1 returned a bad value: {:ok, %{extra_arguments: [], intensity: 3, max_children: :infinity, period: 5, strategy: :one_for_one}}

defmodule Poof.Manager.Server.Create.VM.Supervisor do

  use DynamicSupervisor

  @name __MODULE__

  def start_link(args) do
    opts = [name: @name]
    Supervisor.start_link(@name, args, opts)
  end

  def init(args) do
    opts = [strategy: :one_for_one]
    DynamicSupervisor.init(opts)
  end

end

https://hexdocs.pm/elixir/DynamicSupervisor.html#c:init/1 says “Developers typically invoke DynamicSupervisor.init/1 at the end of their init callback to return the proper supervision flags.”, which is what I’m doing, and the spec shown in the error message seems to be a valid spec.

What am I missing?

It should be …

DynamicSupervisor.start_link(@name, args, opts)
2 Likes

Staring me right in the face, can’t believe I missed that…thank you!