erlef / rebar3_hex

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

badarg in `r3_hex_http_httpc` #198

Closed jadeallenx closed 3 years ago

jadeallenx commented 3 years ago

WTAF


===> Evaluating config script "rebar.config.script"
===> Load global config file /home/mallen/.config/rebar3/rebar.config
===> 22.3.4.4 satisfies the requirement for minimum OTP version 18
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Expanded command sequence to be run: []
===> Running provider: do
===> Expanded command sequence to be run: [{hex,user}]
===> Running provider: {hex,user}
Username: ([])> mrallen1
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 DIAGNOSTIC=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: badarg
===> Stack trace to the error location:
[{erlang,apply,
         [{r3_hex_http_httpc,#{profile => rebar}},
          request,
          [post,<<"https://hex.pm/api/keys">>,
           #{<<"accept">> => <<"application/vnd.hex+erlang">>,
             <<"authorization">> =>
                 <<"Basic SomeCorrectValue">>,
             <<"user-agent">> =>
                 <<"hex_core/0.5.0 (rebar3/3.14.3) (httpc) (OTP/22) (erts/10.7.2.2)">>},
           {"application/vnd.hex+erlang",
            <<A Binary Payload>>},
           #{}]],
         []},
 {hex_http,request,5,
           [{file,"/home/mallen/.cache/rebar3/plugins/hex_core/src/hex_http.erl"},
            {line,25}]},
 {hex_api,request,4,
          [{file,"/home/mallen/.cache/rebar3/plugins/hex_core/src/hex_api.erl"},
           {line,72}]},
 {rebar3_hex_user,generate_key,3,
                  [{file,"/home/mallen/.cache/rebar3/plugins/rebar3_hex/src/rebar3_hex_user.erl"},
                   {line,261}]},
 {rebar3_hex_user,generate_all_keys,5,
                  [{file,"/home/mallen/.cache/rebar3/plugins/rebar3_hex/src/rebar3_hex_user.erl"},
                   {line,214}]},
 {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}]}]
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
mallen@fang:~/github/mrallen1/lager$ rebar3 report hex user auth
Rebar3 report
 version 3.14.3
 generated at 2021-02-04T21:21:43+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: x86_64-unknown-linux-gnu
ERTS: Erlang/OTP 22 [erts-10.7.2.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
Root Directory: /home/mallen/erlangs/22.3.4.4
Library directory: /home/mallen/erlangs/22.3.4.4/lib
-----------------
Loaded Applications:
bbmustache: 1.10.0
certifi: 2.5.2
cf: 0.3.1
common_test: 1.18.2
compiler: 7.5.4.1
crypto: 4.6.5.1
cth_readable: 1.4.9
dialyzer: 4.1.1
edoc: 0.11
erlware_commons: 1.3.1
eunit: 2.4.1
eunit_formatters: 0.5.0
getopt: 1.0.1
hipe: 3.19.3
inets: 7.1.3.1
kernel: 6.5.2.1
providers: 1.8.1
public_key: 1.7.2
relx: 4.2.0
sasl: 3.4.2
snmp: 5.5.0.1
ssl_verify_fun: 1.1.6
stdlib: 3.12.1
syntax_tools: 2.2.1
tools: 3.3.1

-----------------
Escript path: /home/mallen/bin/rebar3
Providers:
  app_discovery as clean compile compile cover ct cut deps dialyzer do docs edoc escriptize eunit fmt 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```
starbelly commented 3 years ago

Hey @mrallen1. It looks like you're on an old version of rebar3_hex. This issue came up before https://github.com/tsloughter/rebar3_hex/issues/192

Have you tried upgrading to the latest?

ferd commented 3 years ago

rebar3 as global plugins upgrade rebar3_hex -- and if you're not running a version from master, do call rebar3 update first.

jadeallenx commented 3 years ago

Thanks that fixed me up, @ferd - sorry I didn't see the other issue :frowning_person: