Closed heiheshang closed 6 years ago
Some file is likely invalid syntax for a consult file in a thing you tried, but that's as much as I can figure out with the stack trace. There's gonna need to be more context than that.
Your version of rebar3 is about 10 months old and pre-dates OTP-21 while you're running on it. Updating it may resolve problems since there have been about 5 releases since then.
./rebar3 -v rebar 3.4.4 on Erlang/OTP 21 Erts 9.1.2
update did not solve the problem
Loaded Applications: bbmustache: 1.3.0 certifi: 2.0.0 cf: 0.2.2 common_test: 1.15.2 compiler: 7.1.3 crypto: 4.1 cth_readable: 1.3.0 dialyzer: 3.2.2 edoc: 0.9.1 erlware_commons: 1.0.0 eunit: 2.3.4 eunit_formatters: 0.3.1 getopt: 0.8.2 inets: 6.4.2 kernel: 5.4 providers: 1.6.0 public_key: 1.5 relx: 3.23.1 sasl: 3.1 snmp: 5.2.7 ssl_verify_fun: 1.1.2 stdlib: 3.4.2 syntax_tools: 2.1.3 tools: 2.11
Escript path: /home/pi/scanner_barcode/rebar3 Providers: app_discovery as clean compile compile cover ct deps dialyzer do edoc escriptize eunit get-deps help install install_deps list lock new path pkgs release relup report shell state tar tree unlock update upgrade upgrade upgrade version xref `
@heiheshang check your .app.src file, there's most likely a syntax there somewhere,
find your generated .app
file (find . -name '*.app'
) and on an Erlang shell try file:consult("/path/to/.app file")
`{application, scanner_barcode, [{description, "An OTP application"}, {vsn, "0.1.0"}, {registered, []}, {mod, { scanner_barcode_app, []}}, {applications, [kernel, stdlib, inpevt ]}, {env,[]}, {modules, [ scanner_barcode_app, scanner_barcode_sup ]},
{maintainers, []}, {licenses, []}, {links, []} ]}. `
that one looks ok, can you post the output of DEBUG=1 rebar3 release
?
`pi@raspberrypi:~/scanner_barcode $ DEBUG=1 ./rebar3 release ===> Expanded command sequence to be run: [{default,app_discovery}, {default,install_deps}, {default,lock}, {default,compile}, {default,release}] ===> Evaluating config script "/home/pi/scanner_barcode/_build/default/lib/inpevt/rebar.config.script" ===> Evaluating config script "/home/pi/scanner_barcode/_build/default/lib/inpevt/rebar.config.script" ===> Verifying dependencies... ===> sh info: cwd: "/home/pi/scanner_barcode" cmd: git rev-parse --short=7 -q HEAD
===> opts: [{cd,"/home/pi/scanner_barcode/_build/default/lib/inpevt"}]
===> Port Cmd: git rev-parse --short=7 -q HEAD Port Opts: [{cd,"/home/pi/scanner_barcode/_build/default/lib/inpevt"}, exit_status, {line,16384}, use_stdio,stderr_to_stdout,hide,eof]
===> Comparing git ref 02b1e26 with 02b1e26 ===> Evaluating config script "/home/pi/scanner_barcode/_build/default/lib/inpevt/rebar.config.script" ===> sh info: cwd: "/home/pi/scanner_barcode" cmd: git --git-dir="/home/pi/scanner_barcode/_build/default/lib/inpevt/.git" rev-parse --verify HEAD
===> opts: [{use_stdout,false}, {debug_abort_on_error, "Locking of git dependency failed in /home/pi/scanner_barcode/_build/default/lib/inpevt"}]
===> Port Cmd: git --git-dir="/home/pi/scanner_barcode/_build/default/lib/inpevt/.git" rev-parse --verify HEAD Port Opts: [exit_status,{line,16384},use_stdio,stderr_to_stdout,hide,eof]
===> run_hooks("/home/pi/scanner_barcode", pre_hooks, compile) -> no hooks defined
===> Compiling scanner_barcode ===> run_hooks("/home/pi/scanner_barcode/apps/scanner_barcode", pre_hooks, compile) -> no hooks defined
===> run_hooks("/home/pi/scanner_barcode/apps/scanner_barcode", pre_hooks, erlc_compile) -> no hooks defined
===> erlopts [debug_info,debug_info] ===> files to compile ["/home/pi/scanner_barcode/_build/default/lib/scanner_barcode/src/scanner_barcode_app.erl", "/home/pi/scanner_barcode/_build/default/lib/scanner_barcode/src/scanner_barcode_sup.erl"] ===> run_hooks("/home/pi/scanner_barcode/apps/scanner_barcode", post_hooks, erlc_compile) -> no hooks defined
===> run_hooks("/home/pi/scanner_barcode/apps/scanner_barcode", pre_hooks, app_compile) -> no hooks defined
===> run_hooks("/home/pi/scanner_barcode/apps/scanner_barcode", post_hooks, app_compile) -> no hooks defined
===> run_hooks("/home/pi/scanner_barcode/apps/scanner_barcode", post_hooks, compile) -> no hooks defined
===> run_hooks("/home/pi/scanner_barcode", post_hooks, compile) -> no hooks defined
===> run_hooks("/home/pi/scanner_barcode", pre_hooks, release) -> no hooks defined
===> run_hooks("/home/pi/scanner_barcode", pre_hooks, release) -> no hooks defined
===> Starting relx build process ... ===> state(api): log: (3:debug), config file: goals: output_dir: /home/pi/scanner_barcode/_rel lib_dirs: providers: tar, relup, release, resolve_release, overlay, rel_discover, app_discover, provider config values: {overlay_vars,[]}, {system_libs,true}, {default_libs,true},
===> Running provider app_discover ===> Resolving OTP Applications from directories: /home/pi/scanner_barcode/_build/default/lib /home/pi/scanner_barcode/apps /usr/local/lib/erlang/lib
=ERROR REPORT==== 16-Oct-2017::02:52:19 === Error in process <0.3894.0> with exit value: {{case_clause,{error,tokens}}, [{file,consult_stream,3,[{file,"file.erl"},{line,1380}]}, {file,consult,1,[{file,"file.erl"},{line,989}]}, {rlx_app_discovery,gather_application_info,2, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_app_discovery.erl"}, {line,223}]}, {rlx_dscv_util,discover_dir,3, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_dscv_util.erl"}, {line,97}]}, {lists,map,2,[{file,"lists.erl"},{line,1239}]}, {ec_plists,'-local_runmany/3-fun-0-',3, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/erlware_commons/src/ec_plists.erl"}, {line,753}]}]}
=ERROR REPORT==== 16-Oct-2017::02:52:19 === Error in process <0.4929.0> with exit value: {{case_clause,{error,tokens}}, [{file,consult_stream,3,[{file,"file.erl"},{line,1380}]}, {file,consult,1,[{file,"file.erl"},{line,989}]}, {rlx_app_discovery,gather_application_info,2, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_app_discovery.erl"}, {line,223}]}, {rlx_dscv_util,discover_dir,3, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_dscv_util.erl"}, {line,97}]}, {lists,map,2,[{file,"lists.erl"},{line,1239}]}, {ec_plists,'-local_runmany/3-fun-0-',3, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/erlware_commons/src/ec_plists.erl"}, {line,753}]}]} ===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump ===> Uncaught error: {{case_clause,{error,tokens}}, [{file,consult_stream,3, [{file,"file.erl"},{line,1380}]}, {file,consult,1,[{file,"file.erl"},{line,989}]}, {rlx_app_discovery,gather_application_info,2, [{file, "/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_app_discovery.erl"}, {line,223}]}, {rlx_dscv_util,discover_dir,3, [{file, "/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_dscv_util.erl"}, {line,97}]}, {lists,map,2,[{file,"lists.erl"},{line,1239}]}, {ec_plists,'-local_runmany/3-fun-0-',3, [{file, "/home/tristan/Devel/rebar3/_build/default/lib/erlware_commons/src/ec_plists.erl"}, {line,753}]}]} ===> Stack trace to the error location: [{ec_plists,handle_error,3, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/erlware_commons/src/ec_plists.erl"}, {line,900}]}, {ec_plists,local_runmany,3, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/erlware_commons/src/ec_plists.erl"}, {line,764}]}, {rlx_dscv_util,do,2, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_dscv_util.erl"}, {line,52}]}, {rlx_app_discovery,resolve_app_metadata,2, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_app_discovery.erl"}, {line,103}]}, {rlx_prv_app_discover,do,1, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_prv_app_discover.erl"}, {line,54}]}, {relx,run_provider,2, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/relx.erl"}, {line,308}]}, {lists,foldl,3,[{file,"lists.erl"},{line,1263}]}, {relx,run_providers_for_actions,2, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/relx.erl"}, {line,291}]}] ===> When submitting a bug report, please include the output of `rebar3 report "your command"``
looks like the inpevt
dependency has something to do with this
I took this project here https://github.com/Feuerlabs/inpevt
%% -*- erlang -*- {erl_opts, [debug_info, fail_on_warning]}. {port_specs, [ {"priv/inpevt_driver.so", ["c_src/*.c"]} ] }.
`===> Evaluating config script "rebar.config.script"
===> Expanded command sequence to be run: [{default,report}]
Rebar3 report
version 3.4.4
generated at 2017-10-20T16:00:05+00:00Loaded Applications: bbmustache: 1.3.0 certifi: 2.0.0 cf: 0.2.2 common_test: 1.15.2 compiler: 7.1.3 crypto: 4.1 cth_readable: 1.3.0 dialyzer: 3.2.2 edoc: 0.9.1 erlware_commons: 1.0.0 eunit: 2.3.4 eunit_formatters: 0.3.1 getopt: 0.8.2 inets: 6.4.2 kernel: 5.4 providers: 1.6.0 public_key: 1.5 relx: 3.23.1 sasl: 3.1 snmp: 5.2.7 ssl_verify_fun: 1.1.2 stdlib: 3.4.2 syntax_tools: 2.1.3 tools: 2.11
Escript path: /home/pi/inpevt/rebar3
Providers:
app_discovery as clean compile compile cover ct deps dialyzer do edoc escriptize eunit get-deps help install install_deps list lock new path pkgs release relup report shell state tar tree unlock update upgrade upgrade upgrade version xref
DEBUG=1 ./rebar3 release
===> Evaluating config script "rebar.config.script"
===> Expanded command sequence to be run: [{default,app_discovery},
{default,install_deps},
{default,lock},
{default,compile},
{default,release}]
===> Evaluating config script "/home/pi/inpevt/rebar.config.script"
===> Evaluating config script "/home/pi/inpevt/rebar.config.script"
===> Verifying dependencies...
===> run_hooks("/home/pi/inpevt", pre_hooks, compile) -> no hooks defined
===> Compiling inpevt ===> run_hooks("/home/pi/inpevt", pre_hooks, compile) -> no hooks defined
===> run_hooks("/home/pi/inpevt", pre_hooks, erlc_compile) -> no hooks defined
===> erlopts [debug_info,debug_info,fail_on_warning] ===> files to compile ["/home/pi/inpevt/_build/default/lib/inpevt/src/inpevt.erl", "/home/pi/inpevt/_build/default/lib/inpevt/src/inpevt_sup.erl", "/home/pi/inpevt/_build/default/lib/inpevt/src/inpevt_app.erl", "/home/pi/inpevt/_build/default/lib/inpevt/src/inpevt_server.erl"] ===> run_hooks("/home/pi/inpevt", post_hooks, erlc_compile) -> no hooks defined
===> run_hooks("/home/pi/inpevt", pre_hooks, app_compile) -> no hooks defined
===> run_hooks("/home/pi/inpevt", post_hooks, app_compile) -> no hooks defined
===> run_hooks("/home/pi/inpevt", post_hooks, compile) -> no hooks defined
===> run_hooks("/home/pi/inpevt", post_hooks, compile) -> no hooks defined
===> run_hooks("/home/pi/inpevt", pre_hooks, release) -> no hooks defined
===> run_hooks("/home/pi/inpevt", pre_hooks, release) -> no hooks defined
===> Starting relx build process ... ===> state(api): log: (3:debug), config file: goals: output_dir: /home/pi/inpevt/_rel lib_dirs: providers: tar, relup, release, resolve_release, overlay, rel_discover, app_discover, provider config values: {overlay_vars,[]}, {system_libs,true}, {default_libs,true},
===> Running provider app_discover ===> Resolving OTP Applications from directories: /usr/local/lib/erlang/lib
=ERROR REPORT==== 20-Oct-2017::15:59:47 === Error in process <0.5554.0> with exit value: {{case_clause,{error,tokens}}, [{file,consult_stream,3,[{file,"file.erl"},{line,1380}]}, {file,consult,1,[{file,"file.erl"},{line,989}]}, {rlx_app_discovery,gather_application_info,2, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_app_discovery.erl"}, {line,223}]}, {rlx_dscv_util,discover_dir,3, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_dscv_util.erl"}, {line,97}]}, {lists,map,2,[{file,"lists.erl"},{line,1239}]}, {ec_plists,'-local_runmany/3-fun-0-',3, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/erlware_commons/src/ec_plists.erl"}, {line,753}]}]}
=ERROR REPORT==== 20-Oct-2017::15:59:48 === Error in process <0.4308.0> with exit value: {{case_clause,{error,tokens}}, [{file,consult_stream,3,[{file,"file.erl"},{line,1380}]}, {file,consult,1,[{file,"file.erl"},{line,989}]}, {rlx_app_discovery,gather_application_info,2, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_app_discovery.erl"}, {line,223}]}, {rlx_dscv_util,discover_dir,3, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_dscv_util.erl"}, {line,97}]}, {lists,map,2,[{file,"lists.erl"},{line,1239}]}, {ec_plists,'-local_runmany/3-fun-0-',3, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/erlware_commons/src/ec_plists.erl"}, {line,753}]}]} ===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump ===> Uncaught error: {{case_clause,{error,tokens}}, [{file,consult_stream,3, [{file,"file.erl"},{line,1380}]}, {file,consult,1,[{file,"file.erl"},{line,989}]}, {rlx_app_discovery,gather_application_info,2, [{file, "/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_app_discovery.erl"}, {line,223}]}, {rlx_dscv_util,discover_dir,3, [{file, "/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_dscv_util.erl"}, {line,97}]}, {lists,map,2,[{file,"lists.erl"},{line,1239}]}, {ec_plists,'-local_runmany/3-fun-0-',3, [{file, "/home/tristan/Devel/rebar3/_build/default/lib/erlware_commons/src/ec_plists.erl"}, {line,753}]}]} ===> Stack trace to the error location: [{ec_plists,handle_error,3, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/erlware_commons/src/ec_plists.erl"}, {line,900}]}, {ec_plists,local_runmany,3, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/erlware_commons/src/ec_plists.erl"}, {line,764}]}, {rlx_dscv_util,do,2, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_dscv_util.erl"}, {line,52}]}, {rlx_app_discovery,resolve_app_metadata,2, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_app_discovery.erl"}, {line,103}]}, {rlx_prv_app_discover,do,1, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/rlx_prv_app_discover.erl"}, {line,54}]}, {relx,run_provider,2, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/relx.erl"}, {line,308}]}, {lists,foldl,3,[{file,"lists.erl"},{line,1263}]}, {relx,run_providers_for_actions,2, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/relx/src/relx.erl"}, {line,291}]}] ===> When submitting a bug report, please include the output of `rebar3 report "your command"``
just noticed you're using OTP21, do you get the same error with 20 or 19?
I did not check, I immediately put otp21
@heiheshang Out of curiosity, how are you using OTP 21 when the latest release is 20.1?
probably just built it out of the master
branch of Erlang/OTP
There's been a series of updates to rebar3 and relx and other dependencies to support OTP-21. Please try with a newer version from master and see if it improves things.
Have not heard back, issue was very vague. Reopen if required.
I still have the same
/Users/Moria/vernemq/rebar3 release --overlay_vars vars.config ===> Plugin {rebar3_cuttlefish, {git,"git://github.com/larshesel/rebar3_cuttlefish", {branch,"use-otp20-compatibly-cuttlefish"}}} not available. It will not be used.
=ERROR REPORT==== 23-Aug-2018::16:15:35 === Loading of /Users/Moria/vernemq/_build/default/plugins/rebar3_cuttlefish/ebin/rebar3_cuttlefish.beam failed: badfile
=ERROR REPORT==== 23-Aug-2018::16:15:35 === beam/beam_load.c(1287): Error loading module rebar3_cuttlefish: mandatory chunk of type 'Atom' not found
=ERROR REPORT==== 23-Aug-2018::16:15:35 === Loading of /Users/Moria/vernemq/_build/default/plugins/getopt/ebin/getopt.beam failed: badfile
=ERROR REPORT==== 23-Aug-2018::16:15:35 === beam/beam_load.c(1287): Error loading module getopt: mandatory chunk of type 'Atom' not found
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> When submitting a bug report, please include the output of rebar3 report "your command"
make: *** [rel] Error 1
pls help how can i solve it ? thx you
Please in the future open your own issue for your problems.
In this case, the issue appears to be that the version of getopt
being compiled has invalid chunks in it, which is usually due to a conflict between the running code and the OTP version under which it was compiled.