1

I'm having a strange issue that I can't, for the life of me, figure out. I have a rebar3 app that I have generated a release from. If I run the app using rebar3 shell it runs fine, but if I run the release script with _build/prod/rel/app_name/bin/app_name it starts but fails when the code goes to start lager. When it attempts to run lager:start it returns an undef which results in the app terminating. I've scoured through every aspect of the app configuration and can't find anything that points to why this is not working. Any one have any insights?

rebar.conf

{erl_opts, [debug_info]}.
{deps, [
    {ranch, {git, "https://github.com/ninenines/ranch.git", {tag, "1.4.0"}}},
    {lager, {git, "https://github.com/erlang-lager/lager.git", {tag, "3.5.1"}}},
    {mongodb, {git, "https://github.com/comtihon/mongodb-erlang.git", {tag, "v3.0.2"}}},
    {eredis, {git, "https://github.com/wooga/eredis.git", {tag, "v1.1.0"}}}
       ]}.

{relx, [
    {release, { tyranny_authservice, "0.1.0" }, [tyranny_authservice, sasl] },
        {sys_config, "./config/sys.config"},
        {vm_args, "./config/vm.args"},
        {dev_mode, false},
        {include_erts, true},
        {extended_start_script, true}
       ]
}.

{profiles, [
        {prod, [{relx, [{dev_mode, false},
                          {include_erts, true},
                                {include_src, false}]}]
            }]
}.

{plugins, [rebar3_hex]}.

{erl_opts, [
        {parse_transform, lager_transform}
  ]}.
  • It is hard to figure out the issue without rebar.config file. Can you represent it? – Alexei K Mar 14 '19 at 18:48
  • The rebar.conf is rather standard. I added it to the question. – Chris Waymire Mar 15 '19 at 01:52
  • 1
    I am not sure becuase I have no access to whole code, but I guess you do not include lager as depended application to tyranny_authservice.app.src like this: {applications, [kernel, stdlib, lager]} – Alexei K Mar 20 '19 at 03:06
  • another option is to add the {included_applications, [lager]} in application resource file .app.src – Alexei K Mar 20 '19 at 14:33

1 Answers1

1
  1. Try to include lager as depended application to tyranny_authservice.app.src like this:

    {applications, [kernel, stdlib, lager]}.

  2. Another option is to add the

    {included_applications, [lager]}

in application resource file tyranny_authservice.app.src

Alexei K
  • 142
  • 1
  • 5