dockerelixirphoenix-frameworkdistillery

Que failing with Distillery release and Docker


I have setup a Docker environment with Distillery to generate a release of my application.

My Application uses Que to add a worker like so

case Que.add(SyncWorker, %{}) do
      {:ok, _job} -> {:ok, "Syncing..."}
      err -> {:error, "Error syncing: #{err}"}
end

However when this line is called I get:

** (exit) exited in: GenServer.call({:global, {Que.Server, SolarisCards.ShopifyIntegration.Workers.SyncWorker}}, {:add_job, SolarisCards.ShopifyIntegration.Workers.SyncWorker, %{}}, 5000)
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function ExUtils.Module.name/1 is undefined (module ExUtils.Module is not available)
            ExUtils.Module.name(SolarisCards.ShopifyIntegration.Workers.SyncWorker)
            (que) lib/que/server.ex:81: Que.Server.handle_call/3
            (stdlib) gen_server.erl:661: :gen_server.try_handle_call/4
            (stdlib) gen_server.erl:690: :gen_server.handle_msg/6
            (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
    (elixir) lib/gen_server.ex:989: GenServer.call/3
    (solaris_cards) lib/solaris_cards/setup.ex:12: SolarisCards.Setup.do_setup_data/0

It works fine locally without docker and distillery, but not sure why its fails above.

I have also tried to run the command for precompiled application as described in the docs with no luck.

iex(my_app@127.0.0.1)1> Que.Persistence.Mnesia.setup!


Solution

  • Adding {:ex_utils, "~> 0.1.7"} to the mix.exs dependencies does the trick.