Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't access config file with eval #707

Open
michelangelomo opened this issue Sep 13, 2019 · 0 comments
Open

can't access config file with eval #707

michelangelomo opened this issue Sep 13, 2019 · 0 comments

Comments

@michelangelomo
Copy link

Steps to reproduce

  1. Try to access Application.get_env from release task called with $RELEASE_ROOT_DIR/bin/application_name eval --mfa "Elixir.ApplicationName.Deploy.ReleaseTasks.$task/$#" $@

Verbose Logs

running task: Elixir.ApplicationName.Deploy.ReleaseTasks.method *arguments*
Loading app...
Starting dependencies...
Starting repos...
[info] starting UserProvider 
** (EXIT from #PID<0.93.0>) an exception was raised:
    ** (Protocol.UndefinedError) protocol Enumerable not implemented for nil. This protocol is implemented for: Ecto.Adapters.SQL.Stream, Postgrex.Stream, DBConnection.PrepareStream, DBConnection.Stream, Timex.Interval, HashDict, MapSet, List, HashSet, Stream, Function, Map, GenEvent.Stream, IO.Stream, Date.Range, File.Stream, Range
        (elixir) /usr/local/src/elixir/lib/elixir/lib/enum.ex:1: Enumerable.impl_for!/1
        (elixir) /usr/local/src/elixir/lib/elixir/lib/enum.ex:141: Enumerable.reduce/3
        (elixir) lib/enum.ex:3015: Enum.reduce/3
        lib/producer.ex:50: Amqpx.Producer.init/1
        (stdlib) gen_server.erl:374: :gen_server.init_it/2
        (stdlib) gen_server.erl:342: :gen_server.init_it/6
        (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

Description of issue

  • What are the expected results?
    Amqpx.Producer.start_link(Application.get_env(:amqpx, :producer)) should load the config, also described in rel/config.exs
    If I replace eval --mfa with command it works fine
  • What version of Distillery?
    2.0.14
  • What OS, Erlang/Elixir versions are you seeing this issue on?
    Elixir 1.8.2 (compiled with Erlang/OTP 21)
  • If possible, also provide your rel/config.exs, as it is often
    my first troubleshooting question, and you'll save us both time :)
set(
    config_providers: [
      {Mix.Releases.Config.Providers.Elixir, ["${RELEASE_ROOT_DIR}/config/runtime.exs"]}
    ]
  )

  set(
    overlays: [
      {:mkdir, "config"},
      {:copy, "config/secrets.yml", "config/secrets.yml"},
      {:copy, "rel/config/#{Mix.env()}.exs", "config/runtime.exs"}
    ]
  )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant