erlef / rebar3_hex

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

Incorrect hex username/password causes a crash instead of displaying an error. #91

Closed jkrukoff closed 5 years ago

jkrukoff commented 5 years ago

If you enter an invalid username/password (and a valid local password), rebar3 crashes instead of displaying an error. From the traceback, it looks like the error was created, but is not reported.

Session:

Username: ([])> asdflkj
Account Password:
You have authenticated on Hex using your account password. However, Hex requires you to have a local password that applies only to this machine for security purposes. Please enter it.
Local Password:
Local Password (confirm):
Generating all keys...
===> 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"`

Crashdump:

Error: {badmatch,
           {error,
               {rebar3_hex_user,
                   {generate_key,
                       <<"invalid username and password combination">>}}}}
[{rebar3_hex_user,generate_all_keys,5,
                  [{file,"c:/Users/John/Documents/partial/_build/default/plugins/rebar3_hex/src/rebar3_hex_user.erl"},
                   {line,192}]},
 {rebar_core,do,2,[{file,"/opt/rebar3-3.8.0/src/rebar_core.erl"},{line,154}]},
 {rebar_prv_do,do_task,5,
               [{file,"/opt/rebar3-3.8.0/src/rebar_prv_do.erl"},{line,87}]},
 {rebar_core,do,2,[{file,"/opt/rebar3-3.8.0/src/rebar_core.erl"},{line,154}]},
 {rebar3,run_aux,2,[{file,"/opt/rebar3-3.8.0/src/rebar3.erl"},{line,178}]},
 {rebar3,main,1,[{file,"/opt/rebar3-3.8.0/src/rebar3.erl"},{line,66}]},
 {escript,run,2,[{file,"escript.erl"},{line,758}]},
 {escript,start,1,[{file,"escript.erl"},{line,277}]}]

Report:

Rebar3 report
 version 3.8.0
 generated at 2019-01-19T00:07:07+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: hexuserauth
Entered as:
  hexuserauth
-----------------
Operating System: win32
ERTS: Erlang/OTP 21 [erts-10.2] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
Root Directory: c:/Program Files/erl10.2
Library directory: c:/Program Files/erl10.2/lib
-----------------
Loaded Applications:
bbmustache: 1.6.0
certifi: 2.3.1
cf: 0.2.2
common_test: 1.16.1
compiler: 7.3
crypto: 4.4
cth_readable: 1.4.2
dialyzer: 3.3.1
edoc: 0.9.4
erlware_commons: 1.3.1
eunit: 2.3.7
eunit_formatters: 0.5.0
getopt: 1.0.1
hex_core: 0.4.0
hipe: 3.18.2
inets: 7.0.3
kernel: 6.2
providers: 1.7.0
public_key: 1.6.4
relx: 3.28.0
sasl: 3.3
snmp: 5.2.12
ssl_verify_fun: 1.1.3
stdlib: 3.7
syntax_tools: 2.1.6
tools: 3.0.2

-----------------
Escript path: c:/Program Files/erl10.2/bin/rebar3
Providers:
  app_discovery as clean compile compile cover ct cut deps dialyzer do docs edoc escriptize eunit get-deps help install install_deps key list lock new owner path pkgs publish release relup repo report repos retire revert search shell state tar tree unlock update upgrade upgrade upgrade user version xref

This is with rebar3_hex 6.4.0.