ferd / recon

Collection of functions and scripts to debug Erlang in production.
http://ferd.github.io/recon/
BSD 3-Clause "New" or "Revised" License
1.37k stars 278 forks source link

difficulties installing recon #58

Closed mbike2000ru closed 7 years ago

mbike2000ru commented 7 years ago

I added recon to the DEPS (dependencies). I added it to app.src,

but when I try to use it on target server - it gives undefined function

ferd commented 7 years ago

What is your project configuration looking like?

mbike2000ru commented 7 years ago

This is my rebar.config: {sub_dirs, ["apps/acceptor", "rel"]}. {deps, [{lager, ".", {git, "https://github.com/basho/lager.git"}, "HEAD"}, {ranch, ".", {git, "https://github.com/ninenines/ranch.git", "master"}}, {epgsql, ".", {git, "https://github.com/epgsql/epgsql.git"}, "HEAD"}, {gproc, ".", {git, "https://github.com/uwiger/gproc.git"}, "master"}, {sync, ".", {git, "https://github.com/rustyio/sync.git", {branch, "master"}}}, {eredis, ".", {git, "https://github.com/wooga/eredis.git", "HEAD"}}, {cowboy, ".", {git, "https://github.com/ninenines/cowboy.git", "dbb636034f20736e16eb9d6c809217c9525b6cbd"}}, {cowlib, ".", {git, "https://github.com/ninenines/cowlib.git", "e4da2077723a26301de516c8da9b0b330545b5af"}}, {jsx, ".", {git, "https://github.com/talentdeficit/jsx.git", "HEAD"}}, {gen_smtp, ".", {git, "https://github.com/Vagabond/gen_smtp.git", "HEAD"}}, {recon, ".*", {git, "https://github.com/ferd/recon.git","HEAD"}} ]}. {validate_app_modules, false}.

ferd commented 7 years ago

And the release configuration, if you're using this on a target system?

mbike2000ru commented 7 years ago

I make the release with rebar generate. What do you mean by "release configuration"?

ferd commented 7 years ago

Any release has a configuration file, especially one with old rebar, which used reltool, known for having specificially long and complex configs.

mbike2000ru commented 7 years ago

root@ubuntu:/usr/src/alcohol/acceptor/src# cat acceptor.app.src {application, acceptor, [ {description, ""}, {vsn, "1"}, {registered, []}, {applications, [ kernel, stdlib, ranch, recon ]}, {mod, { acceptor_app, []}}, {env, []} ]}. root@ubuntu:/usr/src/alcohol/acceptor/src#

mbike2000ru commented 7 years ago

cat /opt/acceptor/releases/1/sys.config [ %% SASL config {sasl, [ {sasl_error_logger, {file, "log/sasl-error.log"}}, {errlog_type, error}, {error_logger_mf_dir, "log/sasl"}, % Log directory {error_logger_mf_maxbytes, 10485760}, % 10 MB max file size {error_logger_mf_maxfiles, 5} % 5 files max ]}, "/opt/config/acceptor/acceptor.config" ].

ferd commented 7 years ago

Those are not the release configuration files. There should be a reltool.config somewhere where you can specify what needs including.

I would otherwise recommend you take a look at relx or rebar3 to build your releases.

mbike2000ru commented 7 years ago

cat /usr/src/alcohol/acceptor/rel/reltool.config %% -- mode: erlang -- %% ex: ft=erlang {sys, [ {lib_dirs, ["../apps", "../deps"]}, {erts, [{mod_cond, derived}, {app_file, strip}]}, {app_file, strip}, {rel, "acceptor", "1", [ kernel, stdlib, sasl, ranch, acceptor ]}, {rel, "start_clean", "", [ kernel, stdlib ]}, {boot_rel, "acceptor"}, {profile, embedded}, {incl_cond, derived}, {excl_archive_filters, ["."]}, %% Do not archive built libs {excl_sys_filters, ["^bin/(?!start_clean.boot)", "^erts./bin/(dialyzer|typer)", "^erts.*/(doc|info|include|lib|man|src)"]}, {excl_app_filters, [".gitignore"]}, {app, acceptor, [{mod_cond, app}, {incl_cond, include}]} ]}.

{target_dir, "acceptor"}.

{overlay, [ {mkdir, "log/sasl"}, {copy, "files/erl", "{{erts_vsn}}/bin/erl"}, {copy, "files/nodetool", "releases/{{rel_vsn}}/nodetool"}, {copy, "acceptor/bin/start_clean.boot", "{{erts_vsn}}/bin/start_clean.boot"}, {copy, "files/acceptor", "bin/acceptor"}, {copy, "files/acceptor.cmd", "bin/acceptor.cmd"}, {copy, "files/start_erl.cmd", "bin/start_erl.cmd"}, %% Following line may be safely removed in new projects {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"} ]}.

ferd commented 7 years ago

Add recon to the list that contains kernel, stdlib, ranch, and acceptor.

mbike2000ru commented 7 years ago

I added recon to the list and it solved the issue