-
Notifications
You must be signed in to change notification settings - Fork 67
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
Cannot get conform to apply settings from app.conf at app start #58
Comments
Could you describe your deployment workflow for me, just so we're on the same page? Conform itself isn't responsible for copying the config, that's actually up to the boot script in Once I know more about your workflow, I'll try and reproduce locally. |
After reading some more code I realized that I was constraining # ...
result="$("$BINDIR/escript" "$__conform" --conf "$__conform_file" --schema "$__schema_file" --config "$SYS_CONFIG" --output-dir "$GENERATED_CONFIG_DIR")"
# ... Which, expanded out is: $ /app/gretel/current/erts-7.2/bin/escript /app/gretel/current/releases/0.0.1/conform --conf /app/gretel/current/running-config/gretel.conf --schema /app/gretel/current/releases/0.0.1/gretel.schema.exs --config /app/gretel/current/running-config/sys.config --output-dir /app/gretel/current/running-config When I run that command I get the following error that I was getting before: $ /app/gretel/current/erts-7.2/bin/escript /app/gretel/current/releases/0.0.1/conform --conf /app/gretel/current/running-config/gretel.conf --schema /app/gretel/current/releases/0.0.1/gretel.schema.exs --config /app/gretel/current/running-config/sys.config --output-dir /app/gretel/current/running-config
escript: exception error: undefined function conform_escript:main/1
in function escript:run/2 (escript.erl, line 757)
in call from escript:start/1 (escript.erl, line 277)
in call from init:start_it/1
in call from init:start_em/1 Hoping that provides more insight. |
That's a new one, does the |
Sure, my current deploy process is to build and run on the same machine (for now). The
|
The |
That's expected, let me review your process and see if I can reproduce, should just be a few minutes. |
Ok thx! |
My app deps, if it matters: defp deps do
[
{ :conform, "~> 1.0.0-rc8", override: true },
{ :conform_exrm, "~> 0.2.0" },
{ :dialyxir, "~> 0.2", only: ~w(dev test)a },
{ :dogma, "~> 0.0", only: ~w(dev test)a },
{ :exrm, "~> 1.0.0-rc7", override: true },
{ :insert_ordered_set, "~> 0.0.1" },
{ :kafka_ex, "0.3.0" },
{ :mongodb, "0.1.1" },
{ :poison, "~> 1.5" },
{ :poolboy, "~> 1.5.1" },
{ :timex, "~> 1.0.0-rc4" },
]
end |
Very strange, your process works for me locally (I have a little test app which I dumped your config in): ⟩ /tmp/test/current/bin/test console
Using /tmp/test/current/releases/0.0.3/test.sh
copying /tmp/test/current/releases/0.0.3/test.conf to /tmp/test/current/running-config/test.conf ...
using /tmp/test/current/running-config/test.conf to populate "/tmp/test/current/running-config".
Exec: /tmp/test/current/erts-7.2.1/bin/erlexec -boot /tmp/test/current/releases/0.0.3/test -boot_var ERTS_LIB_DIR /tmp/test/current/erts-7.2.1/../lib -env ERL_LIBS /tmp/test/current/lib -config /tmp/test/current/running-config/sys.config -args_file /tmp/test/current/running-config/vm.args -conform_schema /tmp/test/current/releases/0.0.3/test.schema.exs -conform_config /tmp/test/current/releases/0.0.3/test.conf -running_conf /tmp/test/current/running-config/test.conf -user Elixir.IEx.CLI -extra --no-halt +iex -- console
Root: /tmp/test/current
/tmp/test/current
Erlang/OTP 18 [erts-7.2.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Interactive Elixir (1.2.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(test@127.0.0.1)1> Application.get_all_env(:test)
[env: :prod, another_val: "none",
brokers: [{"192.168.99.101", "9092"}, {"192.168.99.104", "9092"},
{"192.168.99.107", "9092"}], debug_level: :info, included_applications: []]
iex(test@127.0.0.1)2>
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
(v)ersion (k)ill (D)b-tables (d)istribution
a Only difference being that I changed $ /app/gretel/current/erts-7.2/bin/escript /app/gretel/current/releases/0.0.1/conform You should see the output below if it's working properly:
What OS, Erlang and Elixir versions are you running on this machine? |
Same result, undefined function: $ /app/gretel/current/erts-7.2/bin/escript /app/gretel/current/releases/0.0.1/conform
escript: exception error: undefined function conform_escript:main/1
in function escript:run/2 (escript.erl, line 757)
in call from escript:start/1 (escript.erl, line 277)
in call from init:start_it/1
in call from init:start_em/1 $ erl
Erlang/OTP 18 [erts-7.2] [source] [64-bit] [smp:2:2] [async-threads:10] [kernel-poll:false] $ elixir -v
Erlang/OTP 18 [erts-7.2] [source] [64-bit] [smp:2:2] [async-threads:10] [kernel-poll:false]
Elixir 1.2.0 $ uname -a
Linux gretel-stage-nuvis01 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux |
I'm just going to say ahead of time this is my first Elixir/Erlang deploy (with or without exrm/conform) so be kind. I'm also assuming this is my own error and not a bug. I'm just not sure of a better way to get help/feedback. I appreciate your time.
I am using exrm
1.0.0-rc7
and conform1.0.0-rc8
.When I build on the same machine I want to deploy on, the conf file that has the correct values for our production env are not being applied correctly. Specifically, I have a list of kafka brokers defined as a
[list: :ip]
data type in the schema. The conf file has this list of broker ips defined, but app start fails.From the crash dump:
$ head erl_crash.dump =erl_crash_dump:0.3 Wed Jan 13 22:41:57 2016 Slogan: Kernel pid terminated (application_controller) ({application_start_failure,kafka_ex,{{function_clause,[{prim_inet,setopts,[nil,[binary,{packet,4},{active,false}]],[]},{'Elixir.KafkaEx.NetworkClient' System version: Erlang/OTP 18 [erts-7.2] [source] [64-bit] [smp:2:2] [async-threads:10] [kernel-poll:false]
When I enter the console I get a KafkaNetwork exception as it's trying to connect to a local Kafka instance (the default value in the schema).
# gretel.conf kafka_ex.brokers = some.ip.range:9092, some.ip.range:9092, some.ip.range:9092
I have placed my
gretel.conf
in the release version directory/app/gretel/current/releases/0.0.1/gretel.conf
. With previous versions of the hex package, the gretel.conf was copied to/app/gretel/current/running-config/gretel.conf
, but this current version of conform doesn't do that.At this point I'm unsure where to go. As indicated I've tried rolling back to the last stable releases of both exrm and conform, but that ran me into a separate set of issues. Specifically, running escript with the built conform file was failing with a message saying that
conform_escript
function was undefined or something.I'm sorry if that's too much info, but trying to do my homework here and not submit a bogus issue. It appears that I'm missing a simple step, but I'll be damned if I can find it. Any help would be greatly appreciated. Thanks!
The text was updated successfully, but these errors were encountered: