erlef / rebar3_hex

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

"rebar3 hex user auth" failure #87

Closed lukebakken closed 5 years ago

lukebakken commented 5 years ago

Software versions:

$ cat ~/.cache/rebar3/plugins/rebar3_hex/ebin/rebar3_hex.app 
{application,rebar3_hex,
             [{registered,[]},
              {description,"Hex.pm plugin for rebar3"},
              {vsn,"6.2.0"},
              {applications,[kernel,stdlib]},
              {maintainers,["Tristan Sloughter"]},
              {licenses,["MIT"]},
              {links,[{"Github","https://github.com/tsloughter/rebar3_hex"}]},
              {modules,[rebar3_hex,rebar3_hex_cut,rebar3_hex_docs,
                        rebar3_hex_key,rebar3_hex_owner,rebar3_hex_publish,
                        rebar3_hex_repo,rebar3_hex_retire,rebar3_hex_revert,
                        rebar3_hex_search,rebar3_hex_user,rebar3_hex_utils]}]}.

Reproduction steps

Using mix to authenticate appears to work successfully:

$ mix hex.user auth
Username: lukebakken                                                                                                                   
Account password: 
Generating keys...
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): 

However, the following happens with rebar3. Note that the prompt is always for "Account Password:" and it doesn't matter if I enter my account vs local password, the error is the same. I have attached the output of DEBUG=1 rebar3 report "hex user auth" to this issue. Please let me know if there's anything else I can do to help out.

rebar3_hex_issue_report.txt

$ DEBUG=1 rebar3 hex user auth
===> Load global config file /home/lbakken/.config/rebar3/rebar.config
===> Expanded command sequence to be run: []                                                                                           
===> Provider: {default,do}                                                                                                            
===> Expanded command sequence to be run: [{hex,user}]                                                                                 
===> Provider: {hex,user}                                                                                                              
Username: ([])> lukebakken                                                                                                             
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.
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: function_clause                                                                                                   
===> Stack trace to the error location:                                                                                                
[{rebar3_hex_user,get_password,                                                                                                        
                  [<<"Local Password: ">>],                                                                                            
                  [{file,"/home/lbakken/.cache/rebar3/plugins/rebar3_hex/src/rebar3_hex_user.erl"},                                    
                   {line,152}]},                                                                                                       
 {rebar3_hex_user,auth,2,                                                                                                              
                  [{file,"/home/lbakken/.cache/rebar3/plugins/rebar3_hex/src/rebar3_hex_user.erl"},                                    
                   {line,119}]},                                                                                                       
 {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}]},                                                                
 {init,start_em,1,[]}]                                                                                                                 
===> When submitting a bug report, please include the output of `rebar3 report "your command"` 
tsloughter commented 5 years ago

I see the issue. Will try to get a fix out soon and let you know.

tsloughter commented 5 years ago

@lukebakken just published 6.3.0, does that work for you?

lukebakken commented 5 years ago

Everything appears to be working fine now, thank you for the amazingly fast fix :smiley:

$ DEBUG=1 rebar3 hex user auth
===> Load global config file /home/lbakken/.config/rebar3/rebar.config
===> Expanded command sequence to be run: []                                                                                                                                                                                                                                    
===> Provider: {default,do}                                                                                                                                                                                                                                                     
===> Expanded command sequence to be run: [{hex,user}]                                                                                                                                                                                                                          
===> Provider: {hex,user}                                                                                                                                                                                                                                                       
Username: ([])> lukebakken                                                                                                                                                                                                                                                      
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...
(19.3)lbakken@shostakovich ~/development/rabbitmq/sysmon-handler (master *=)
$ DEBUG=1 rebar3 hex user whoami
===> Load global config file /home/lbakken/.config/rebar3/rebar.config
===> Expanded command sequence to be run: []                                                                                                                                                                                                                                    
===> Provider: {default,do}                                                                                                                                                                                                                                                     
===> Expanded command sequence to be run: [{hex,user}]                                                                                                                                                                                                                          
===> Provider: {hex,user}                                                                                                                                                                                                                                                       
lukebakken (luke@bakken.io)