erlef / rebar3_hex

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

Crash in publish #71

Closed knutin closed 7 years ago

knutin commented 7 years ago

Hello,

This could very well be a user-related issue, so bear with me.. When I run rebar3 hex publish in my local eredis checkout I get the following stack trace:

escript: exception error: no function clause matching
                 rebar3_hex_pkg:errors_to_string(#{<<"meta">> =>
                                                       #{<<"licenses">> =>
                                                             <<"can't be blank">>}}) (/home/knutin/.cache/rebar3/plugins/rebar3_hex/src/rebar3_hex_pkg.erl, line 201)
  in function  rebar3_hex_pkg:format_error/1 (/home/knutin/.cache/rebar3/plugins/rebar3_hex/src/rebar3_hex_pkg.erl, line 57)
  in call from rebar3:handle_error/1 (/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar3.erl, line 314)
  in call from escript:run/2 (escript.erl, line 760)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1
  in call from init:do_boot/3

I think I should be authenticated okay.

$ rebar3 hex user whoami
knutin@gmail.com

Any ideas what I'm doing wrong?

tsloughter commented 7 years ago

Looks like there are 2 issues. One is that your licenses field is blank in the .app.src file? Filling that in may fix the issue you are having. Though there is also the issue that the error isn't being formatted. Not sure if that is due to an old version of the plugin or if something changed from the hex server.

knutin commented 7 years ago

Ah, that field was indeed blank. With that fixed, I get a new error: #{<<"requirements">> => <<"expected type list(map)">>}). There's no deps in this project, but I tried adding {deps, []}. to rebar.config and still get the same error.

tsloughter commented 7 years ago

Hm, crap, I hope that isn't a change. Are you running the latest rebar3_hex? If you installed globally do rebar3 as global plugins upgrade rebar3_hex

knutin commented 7 years ago

Oh, after updating it works!

Thanks for your help! :)