rebar3 icon indicating copy to clipboard operation
rebar3 copied to clipboard

`rebar3 release` fails with message: "Failed creating providers."

Open eshikafe opened this issue 1 year ago • 3 comments

Hello, rebar3 relase fails with message: "Failed creating providers. Run with DIAGNOSTIC=1 for stacktrace or consult rebar3.crashdump". Please what could be wrong?

Crash dump rebar3_crashdump.zip

Environment

austin@NG-00000077:~$ rebar3 version
rebar 3.18.0 on Erlang/OTP 25 Erts 13.0.2

austin@NG-00000077:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:        20.04
Codename:       focal

I had the same issue with rebar 3.19.0

Result of rebar3 report

austin@NG-00000077:~$ rebar3 report "rebar3 release"
Rebar3 report
 version 3.18.0
 generated at 2022-07-06T08:49:02+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task: rebar3
Entered as:
  rebar3 release
-----------------
Operating System: x86_64-pc-linux-gnu
ERTS: Erlang/OTP 25 [erts-13.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
Root Directory: /usr/lib/erlang
Library directory: /usr/lib/erlang/lib
-----------------
Loaded Applications:
bbmustache: 1.12.2
certifi: 2.8.0
cf: 0.3.1
common_test: 1.23
compiler: 8.2
crypto: 5.1.1
cth_readable: 1.5.1
dialyzer: 5.0.1
edoc: 1.2
erlware_commons: 1.5.0
eunit: 2.7.1
eunit_formatters: 0.5.0
getopt: 1.0.1
inets: 8.0
kernel: 8.4.1
providers: 1.9.0
public_key: 1.13
relx: 4.6.0
sasl: 4.2
snmp: 5.13
ssl_verify_fun: 1.1.6
stdlib: 4.0.1
syntax_tools: 3.0
tools: 3.5.3

-----------------
Escript path: /mnt/c/Users/eausaig/bin/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 repos shell state tar tree unlock update upgrade upgrade upgrade version xref

Current behaviour

rebar3 release fails after running rebar3 new rebar3_riak_core name=amf

austin@NG-00000077:~$ rebar3 new rebar3_riak_core name=amf
===> Writing amf/apps/amf/src/amf.app.src
===> Writing amf/apps/amf/src/amf.erl
===> Writing amf/apps/amf/src/amf_app.erl
===> Writing amf/apps/amf/src/amf_sup.erl
===> Writing amf/apps/amf/src/amf_console.erl
===> Writing amf/apps/amf/src/amf_vnode.erl
===> Writing amf/rebar.config
===> Writing amf/.editorconfig
===> Writing amf/.gitignore
===> Writing amf/README.rst
===> Writing amf/Makefile
===> Writing amf/config/admin_bin
===> Writing amf/priv/01-amf.schema
===> Writing amf/config/advanced.config
===> Writing amf/config/lager.schema
===> Writing amf/config/riak_core.schema
===> Writing amf/config/erlang_vm.schema
===> Writing amf/config/vars.config
===> Writing amf/config/vars_dev1.config
===> Writing amf/config/vars_dev2.config
===> Writing amf/config/vars_dev3.config
austin@NG-00000077:~$ cd amf
austin@NG-00000077:~/amf$ rebar3 release
===> Fetching rebar3_cuttlefish v0.16.0
===> Fetching cuttlefish v2.7.0
===> Fetching rebar3_hex v7.0.2
===> Fetching hex_core v0.8.4
===> Fetching verl v1.1.1
===> Analyzing applications...
===> Compiling hex_core
===> Compiling verl
===> Compiling rebar3_hex
===> Fetching getopt v1.0.2
===> Fetching lager v3.9.2
===> Fetching goldrush v0.1.9
===> Analyzing applications...
===> Compiling goldrush
===> Compiling lager
===> Compiling getopt
===> Compiling cuttlefish
===> Compiling rebar3_cuttlefish
===> Building escript for cuttlefish...
===> Failed creating providers. Run with DIAGNOSTIC=1 for stacktrace or consult rebar3.crashdump.
austin@NG-00000077:~/amf$ DEDUG=1 rebar3 release
===> Failed creating providers. Run with DIAGNOSTIC=1 for stacktrace or consult rebar3.crashdump.
austin@NG-00000077:~/amf$ DIAGNOSTIC=1 rebar3 release
===> Evaluating config script "/home/austin/amf/_build/default/plugins/cuttlefish/rebar.config.script"
===> 25.0.2 satisfies the requirement for minimum OTP version 21.3
===> 25.0.2 satisfies the requirement for minimum OTP version 18
===> Evaluating config script "/home/austin/amf/_build/default/plugins/hex_core/rebar.config.script"
===> 25.0.2 satisfies the requirement for minimum OTP version 19.3
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Evaluating config script "/home/austin/amf/_build/default/plugins/lager/rebar.config.script"
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> error: undef [{relx,opt_spec_list,[],[]},
                          {rebar3_cuttlefish_release,init,1,
                              [{file,
                                   "/home/austin/amf/_build/default/plugins/rebar3_cuttlefish/src/rebar3_cuttlefish_release.erl"},
                               {line,24}]},
                          {rebar3_cuttlefish,init,1,
                              [{file,
                                   "/home/austin/amf/_build/default/plugins/rebar3_cuttlefish/src/rebar3_cuttlefish.erl"},
                               {line,6}]},
                          {rebar_state,'-create_logic_providers/2-fun-0-',2,
                              [{file,
                                   "/home/runner/work/rebar3/rebar3/src/rebar_state.erl"},
                               {line,507}]},
                          {lists,foldl,3,[{file,"lists.erl"},{line,1350}]},
                          {rebar_state,create_logic_providers,2,
                              [{file,
                                   "/home/runner/work/rebar3/rebar3/src/rebar_state.erl"},
                               {line,506}]},
                          {rebar_plugins,'-handle_plugins/4-fun-0-',4,
                              [{file,
                                   "/home/runner/work/rebar3/rebar3/src/rebar_plugins.erl"},
                               {line,101}]},
                          {lists,foldl,3,[{file,"lists.erl"},{line,1350}]}]
===> Failed creating providers. Run with DIAGNOSTIC=1 for stacktrace or consult rebar3.crashdump.
austin@NG-00000077:~/amf$

Expected behaviour

It should compile my code without errors based on this tutorial: https://marianoguerra.github.io/little-riak-core-book/starting.html

Thanks.

eshikafe avatar Jul 06 '22 08:07 eshikafe

You are using a cuttlefish plugin, I think. The template uses a hex package which hasn't been updated since 2017. You may want to replace it with the source plugin (https://github.com/vernemq/rebar3_cuttlefish).

So take the {project_plugins, [rebar3_cuttlefish]} and make it {project_plugins, [{git, "https://github.com/vernemq/rebar3_cuttlefish", {branch, "master"}}}, then remove the artifacts from _build (or blow away the repo) to see if it helps.

ferd avatar Jul 06 '22 12:07 ferd

Thanks @ferd for the feedback. I tried your suggestion

image

I deleted the rebar3_cuttlefish/ from the plugins folder

austin@NG-00000077:~/amf/_build/default/plugins$ ls
cuttlefish  getopt  goldrush  hex_core  lager  rebar3_hex  verl

Here is the outcome.

austin@NG-00000077:~/amf/_build/default/plugins$ cd ~/amf
austin@NG-00000077:~/amf$ DEBUG=1 rebar3 release
===> Fetching git (from {branch,"master"})
===> throw {error,{rebar_fetch,{fetch_fail,{branch,"master"}}}} [{rebar_fetch,
                                                                         download_source,
                                                                         2,
                                                                         [{file,
                                                                           "/home/runner/work/rebar3/rebar3/src/rebar_fetch.erl"},
                                                                          {line,
                                                                           49}]},
                                                                        {rebar_prv_install_deps,
                                                                         maybe_fetch,
                                                                         5,
                                                                         [{file,
                                                                           "/home/runner/work/rebar3/rebar3/src/rebar_prv_install_deps.erl"},
                                                                          {line,
                                                                           339}]},
                                                                        {rebar_prv_install_deps,
                                                                         update_unseen_dep,
                                                                         9,
                                                                         [{file,
                                                                           "/home/runner/work/rebar3/rebar3/src/rebar_prv_install_deps.erl"},
                                                                          {line,
                                                                           295}]},
                                                                        {lists,
                                                                         foldl,
                                                                         3,
                                                                         [{file,
                                                                           "lists.erl"},
                                                                          {line,
                                                                           1350}]},
                                                                        {rebar_prv_install_deps,
                                                                         handle_profile_level,
                                                                         7,
                                                                         [{file,
                                                                           "/home/runner/work/rebar3/rebar3/src/rebar_prv_install_deps.erl"},
                                                                          {line,
                                                                           183}]},
                                                                        {rebar_plugins,
                                                                         handle_plugin,
                                                                         4,
                                                                         [{file,
                                                                           "/home/runner/work/rebar3/rebar3/src/rebar_plugins.erl"},
                                                                          {line,
                                                                           111}]},
                                                                        {rebar_plugins,
                                                                         '-handle_plugins/4-fun-0-',
                                                                         4,
                                                                         [{file,
                                                                           "/home/runner/work/rebar3/rebar3/src/rebar_plugins.erl"},
                                                                          {line,
                                                                           100}]},
                                                                        {lists,
                                                                         foldl,
                                                                         3,
                                                                         [{file,
                                                                           "lists.erl"},
                                                                          {line,
                                                                           1350}]}]
===> Errors loading plugin {git,
                                      "https://github.com/vernemq/rebar3_cuttlefish",
                                      {branch,"master"}}. Run rebar3 with DEBUG=1 set to see errors.
===> Getting definition for package rebar3_run from repo hexpm (#{api_url => <<"https://hex.pm/api">>,name => <<"hexpm">>,
         repo_name => <<"hexpm">>,repo_organization => undefined,
         repo_url => <<"https://repo.hex.pm">>,repo_verify => true,
         repo_verify_origin => true})
===> Hex get_package request failed: {error,
                                             {failed_connect,
                                              [{to_address,
                                                {"repo.hex.pm",443}},
                                               {inet,[inet],nxdomain}]}}
===> Failed to update package rebar3_run from repo hexpm
===> throw {error,
                      {rebar_app_utils,
                          {missing_package,<<"rebar3_run">>,undefined}}} [{rebar_app_utils,
                                                                           update_source,
                                                                           3,
                                                                           [{file,
                                                                             "/home/runner/work/rebar3/rebar3/src/rebar_app_utils.erl"},
                                                                            {line,
                                                                             335}]},
                                                                          {rebar_prv_install_deps,
                                                                           '-handle_profile_level/7-lc$^0/1-0-',
                                                                           3,
                                                                           [{file,
                                                                             "/home/runner/work/rebar3/rebar3/src/rebar_prv_install_deps.erl"},
                                                                            {line,
                                                                             178}]},
                                                                          {rebar_prv_install_deps,
                                                                           handle_profile_level,
                                                                           7,
                                                                           [{file,
                                                                             "/home/runner/work/rebar3/rebar3/src/rebar_prv_install_deps.erl"},
                                                                            {line,
                                                                             179}]},
                                                                          {rebar_plugins,
                                                                           handle_plugin,
                                                                           4,
                                                                           [{file,
                                                                             "/home/runner/work/rebar3/rebar3/src/rebar_plugins.erl"},
                                                                            {line,
                                                                             111}]},
                                                                          {rebar_plugins,
                                                                           '-handle_plugins/4-fun-0-',
                                                                           4,
                                                                           [{file,
                                                                             "/home/runner/work/rebar3/rebar3/src/rebar_plugins.erl"},
                                                                            {line,
                                                                             100}]},
                                                                          {lists,
                                                                           foldl,
                                                                           3,
                                                                           [{file,
                                                                             "lists.erl"},
                                                                            {line,
                                                                             1350}]},
                                                                          {rebar_plugins,
                                                                           handle_plugins,
                                                                           4,
                                                                           [{file,
                                                                             "/home/runner/work/rebar3/rebar3/src/rebar_plugins.erl"},
                                                                            {line,
                                                                             99}]},
                                                                          {lists,
                                                                           foldl,
                                                                           3,
                                                                           [{file,
                                                                             "lists.erl"},
                                                                            {line,
                                                                             1350}]}]
===> Errors loading plugin rebar3_run. Run rebar3 with DEBUG=1 set to see errors.
===> Expanded command sequence to be run: [app_discovery,install_deps,lock,compile,release]
===> Running provider: app_discovery
===> Found top-level apps: [amf]
        using config: [{src_dirs,["src"]},{lib_dirs,["apps/*","lib/*","."]}]
===> Running provider: install_deps
===> Verifying dependencies...
===> Getting definition for package recon from repo hexpm
===> Hex get_package request failed: {error,
                                             {failed_connect,
                                              [{to_address,
                                                {"repo.hex.pm",443}},
                                               {inet,[inet],nxdomain}]}}
===> Failed to update package recon from repo hexpm
===> Package not found in any repo: recon
austin@NG-00000077:~/amf$

eshikafe avatar Jul 06 '22 16:07 eshikafe

That looks like a failure to connect to the package manager.

ferd avatar Jul 06 '22 16:07 ferd

It works fine with rebar3_riak_core_lite. Thanks.

eshikafe avatar Nov 27 '22 09:11 eshikafe