erlef / rebar3_hex

Rebar3 Hex library
Apache License 2.0
101 stars 49 forks source link

Error on 'retire' command #253

Closed oubiwann closed 3 years ago

oubiwann commented 3 years ago

I get the following error when I attempt to run the command rebar3 hex retire:

Error: badarg
[{unicode,characters_to_binary,
          [{error,{required,pkg}}],
          [{file,"unicode.erl"},
           {line,898},
           {error_info,#{module => erl_stdlib_errors}}]},
 {rebar3_hex_retire,handle_command,2,
                    [{file,"/Users/oubiwann/.cache/rebar3/plugins/rebar3_hex/src/rebar3_hex_retire.erl"},
                     {line,51}]},
 {rebar_core,do,2,
             [{file,"/home/runner/work/rebar3/rebar3/src/rebar_core.erl"},
              {line,155}]},
 {rebar_prv_do,do_task,5,
               [{file,"/home/runner/work/rebar3/rebar3/src/rebar_prv_do.erl"},
                {line,87}]},
 {rebar_core,do,2,
             [{file,"/home/runner/work/rebar3/rebar3/src/rebar_core.erl"},
              {line,155}]},
 {rebar3,run_aux,2,
         [{file,"/home/runner/work/rebar3/rebar3/src/rebar3.erl"},{line,182}]},
 {rebar3,main,1,
         [{file,"/home/runner/work/rebar3/rebar3/src/rebar3.erl"},{line,66}]},
 {escript,run,2,[{file,"escript.erl"},{line,750}]}]

I have attempted this with two different combinations of versions, both of which fail:

I have only tried this on an old Mac laptop (10.13); I'll give it a try on a newer machine and provide an update.

tsloughter commented 3 years ago

No need to try on multiple erlangs or machines. Something is returned an error about "required pkg" (no idea) and trying to convert that to a name, probably somewhere it is looking up the package name, getting an error and not matching on it but just assuming it gets a String result.

oubiwann commented 3 years ago

Btw:

  1. other hex commands work
  2. this error occurs before getting to my own project:
===>      Compiled rebar3_hex_repo.erl
===>      Compiled rebar3_hex_cut.erl
===>      Compiled rebar3_hex_client.erl
===>      Compiled rebar3_hex_docs.erl
===>      Compiled rebar3_hex_retire.erl
===>      Compiled rebar3_hex_key.erl
===>      Compiled rebar3_hex_revert.erl
===>      Compiled rebar3_hex_config.erl
===>      Compiled rebar3_hex_results.erl
===>      Compiled rebar3_hex_error.erl
===>      Compiled rebar3_hex_publish.erl
===>      Compiled rebar3_hex_io.erl
===>      Compiled rebar3_hex_search.erl
===>      Compiled rebar3_hex_owner.erl
===>      Compiled rebar3_hex_user.erl
===> Running hooks for erlc_compile in app verl (/Users/oubiwann/.cache/rebar3/plugins/verl) with configuration:
===>    {post_hooks, []}.
===> run_hooks("/Users/oubiwann/.cache/rebar3/plugins/verl", post_hooks, erlc_compile) -> no hooks defined

===> Running hooks for erlc_compile in app hex_core (/Users/oubiwann/.cache/rebar3/plugins/hex_core) with configuration:
===>    {post_hooks, []}.
===> Running hooks for erlc_compile in app rebar3_hex (/Users/oubiwann/.cache/rebar3/plugins/rebar3_hex) with configuration:
===>    {post_hooks, []}.
===> run_hooks("/Users/oubiwann/.cache/rebar3/plugins/rebar3_hex", post_hooks, erlc_compile) -> no hooks defined

===> Running hooks for app_compile in app verl (/Users/oubiwann/.cache/rebar3/plugins/verl) with configuration:
===>    {pre_hooks, []}.
===> run_hooks("/Users/oubiwann/.cache/rebar3/plugins/verl", pre_hooks, app_compile) -> no hooks defined

===> Running hooks for app_compile in app hex_core (/Users/oubiwann/.cache/rebar3/plugins/hex_core) with configuration:
===>    {pre_hooks, []}.
===> run_hooks("/Users/oubiwann/.cache/rebar3/plugins/hex_core", pre_hooks, app_compile) -> no hooks defined

===> Running hooks for app_compile in app rebar3_hex (/Users/oubiwann/.cache/rebar3/plugins/rebar3_hex) with configuration:
===>    {pre_hooks, []}.
===> run_hooks("/Users/oubiwann/.cache/rebar3/plugins/rebar3_hex", pre_hooks, app_compile) -> no hooks defined

===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Running hooks for app_compile in app verl (/Users/oubiwann/.cache/rebar3/plugins/verl) with configuration:
===>    {post_hooks, []}.
===> run_hooks("/Users/oubiwann/.cache/rebar3/plugins/verl", post_hooks, app_compile) -> no hooks defined

===> Running hooks for app_compile in app hex_core (/Users/oubiwann/.cache/rebar3/plugins/hex_core) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app rebar3_hex (/Users/oubiwann/.cache/rebar3/plugins/rebar3_hex) with configuration:
===>    {post_hooks, []}.
===> run_hooks("/Users/oubiwann/.cache/rebar3/plugins/rebar3_hex", post_hooks, app_compile) -> no hooks defined

===> Running hooks for compile in app verl (/Users/oubiwann/.cache/rebar3/plugins/verl) with configuration:
===>    {post_hooks, []}.
===> run_hooks("/Users/oubiwann/.cache/rebar3/plugins/verl", post_hooks, compile) -> no hooks defined

===> Running hooks for compile in app hex_core (/Users/oubiwann/.cache/rebar3/plugins/hex_core) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app rebar3_hex (/Users/oubiwann/.cache/rebar3/plugins/rebar3_hex) with configuration:
===>    {post_hooks, []}.
===> run_hooks("/Users/oubiwann/.cache/rebar3/plugins/rebar3_hex", post_hooks, compile) -> no hooks defined

===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Expanded command sequence to be run: []
===> Running provider: do
===> Expanded command sequence to be run: [{hex,retire}]
===> Running provider: {hex,retire}
===> Uncaught error in rebar_core. Run with DIAGNOSTIC=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: badarg

What follows after that is the stracktrace I pasted in the description above.

starbelly commented 3 years ago

No need to try on multiple erlangs or machines. Something is returned an error about "required pkg" (no idea) and trying to convert that to a name, probably somewhere it is looking up the package name, getting an error and not matching on it but just assuming it gets a String result.

Indeed, the pkg argument isn't provided and we get an error back from get_required/2 and pass it on. Can provide a fixup later today.

Edit :

Note we will improve upon this in v7 further by not requiring the pkg argument if you're not in an umbrella.