hexpm / hex

Package manager for the Erlang ecosystem.
https://hex.pm
974 stars 187 forks source link

Generating organization keys fails with MatchError #536

Closed Schultzer closed 6 years ago

Schultzer commented 6 years ago

So I'm trying to publish a new release of my package ex_cldr_territories

mix hex.publish
...
No authenticated user found. Do you want to authenticate now? [Yn] y
Username: Schultzer
Account password: 
Generating API key...
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 organization keys...
** (MatchError) no match of right hand side value: :error
    (hex) lib/hex/crypto/encryption.ex:30: Hex.Crypto.Encryption.decrypt/2
    (hex) lib/mix/tasks/hex.ex:161: Mix.Tasks.Hex.auth_info/0
    (hex) lib/mix/tasks/hex.publish.ex:149: Mix.Tasks.Hex.Publish.create/3
    (mix) lib/mix/task.ex:314: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:80: Mix.CLI.run_task/2

I'm generating a strong password in keychain

let just say the "length of the password" is between somewhere "0-50"

kipcole9 commented 6 years ago

Reported earlier :-) https://github.com/hexpm/hex/issues/516 and a fix has been merged.

If you try to publish again I'd expect it will work.

Schultzer commented 6 years ago

Well when I publish I just get prompt for the local password and it just tells me it's the wrong password.

supersimple commented 6 years ago

@Schultzer what happens when you try to authorize outside of the publish workflow? do you have the same issue? try mix hex.user whoami or mix hex.user auth

Schultzer commented 6 years ago

I get prompt for the local password, and when I type in the one I created with I get wrong password.

supersimple commented 6 years ago

ok, what happens when you try mix hex.user auth ? that will require your account (remote) password first. Does that password work? if so, can you try resetting your local password (it will prompt for it straight-away)? Also, maybe try a simple password just for testing it out (it is only stored on your local machien and you can use this same process after to make a more secure password.

supersimple commented 6 years ago

Also, I am available on elixir slack (toddresudek) if you want to trouble shoot with me.

Schultzer commented 6 years ago

Okay after running mix hex.user auth process 5 times it finally fixed the problem.

it was properly some cosmic rays.

supersimple commented 6 years ago

@Schultzer were you able to get it to work? if not, hit me up on slack.

Schultzer commented 6 years ago

@supersimple yeah it's working now just had to run mix hex.user auth five times.

supersimple commented 6 years ago

well, good to hear. My guess was something got corrupted in your hex.config file. mix hex.user key --revoke-all will clean that if it ever happens again.