Search code examples
websocketerlangcowboy

Exception while generate a release in erlang cowboy using rebar?


I am creating Erlang Cowboy gen server chat Application, For that I have followed https://github.com/hcs42/cowboy_tutorial_webchat link. I am using Erlang/otp 17, But when I run "./rebar generate" it display following error.

ERROR: generate failed while processing /Users/govind/src/cowboy_chat/rel: {'EXIT',{{badmatch,{error,"appmon: Missing application directory."}},
         [{rebar_reltool,generate,2,[]},
          {rebar_core,run_modules,4,[]},
          {rebar_core,execute,5,[]},
          {rebar_core,process_dir0,6,[]},
          {rebar_core,process_dir,4,[]},
          {rebar_core,process_each,5,[]},
          {rebar_core,process_dir0,6,[]},
          {rebar_core,process_dir,4,[]}]}}

reltool.config file

{sys, [
       {lib_dirs, ["../apps", "../deps"]},
       {erts, [{mod_cond, derived}, {app_file, strip}]},
       {app_file, strip},
       {rel, "chat", "1",
        [
         kernel,
         stdlib,
         sasl,
         runtime_tools,
         crypto,
         mimetypes,
         ranch,
         cowboy,
         chat
        ]},
       {rel, "start_clean", "",
        [
         kernel,
         stdlib
        ]},
       {boot_rel, "chat"},
       {profile, embedded},
       {incl_cond, exclude},
       {excl_archive_filters, [".*"]}, %% Do not archive built libs
       {excl_sys_filters, ["^bin/.*", "^erts.*/bin/(dialyzer|typer)",
                           "^erts.*/(doc|info|include|lib|man|src)"]},
       {excl_app_filters, ["\.gitignore"]},
       {app, sasl,   [{incl_cond, include}]},
       {app, stdlib, [{incl_cond, include}]},
       {app, kernel, [{incl_cond, include}]},
       {app, gs, [{incl_cond, include}]},
       {app, runtime_tools, [{incl_cond, include}]},
       {app, appmon, [{incl_cond, include}]},
       {app, crypto, [{incl_cond, include}]},
       {app, mimetypes, [{incl_cond, include}]},
       {app, ranch, [{incl_cond, include}]},
       {app, cowboy, [{incl_cond, include}]},
       {app, chat, [{incl_cond, include}]}
      ]}.

{target_dir, "chat"}.

{overlay, [
           {mkdir, "log/sasl"},
           {copy, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},
           {copy, "files/nodetool", "\{\{erts_vsn\}\}/bin/nodetool"},
           {copy, "files/chat", "bin/chat"},
           {copy, "files/chat.cmd", "bin/chat.cmd"},
           {copy, "files/start_erl.cmd", "bin/start_erl.cmd"},
           {copy, "files/install_upgrade.escript", "bin/install_upgrade.escript"},
           {copy, "files/sys.config", "releases/\{\{rel_vsn\}\}/sys.config"},
           {copy, "files/vm.args", "releases/\{\{rel_vsn\}\}/vm.args"}
          ]}.

How to solve this error? If You know better link to create Erlang cowboy gen_server chat application than do suggest.


Solution

  • As noted in this question, the appmon application was removed in Erlang/OTP 17.0. Just remove all references to it in your reltool.config file.