Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to use heroku gem cli after password changes

I changed my password via the web interface. And now I can't run any command that requires authentication. Password is using plain ASCII, nothing fancy, no Unicode, weird non-printable characters, etc.

Anyone had similar experience and how you manage to resolve.

How do I even begin to go about debug this? Any verbose cli option, log I can review?

% sw_vers 
ProductName:    Mac OS X 
ProductVersion: 10.6.8 
BuildVersion:   10K549
% rvm --version
rvm 1.10.3 by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.beginrescueend.com/
% ruby --version 
ruby 1.9.3p125 (2012-02-16) [x86_64-darwin10.8.0] 
% gem --version 
1.8.17 
% heroku version 
2.25.0 
% cat ~/.netrc # is empty 
% heroku auth:login

Enter your Heroku credentials. 
Email: [email protected]
Password (typing will be hidden): 
Authentication failed.
like image 614
Khoa Nguyen Avatar asked May 16 '12 23:05

Khoa Nguyen


People also ask

Why heroku login is not working?

Double check that there are no typos in your password as well. Reset your password and try logging in with the new password. Try using a different email address. Try using an email alias with a plus sign if you might have signed up using an alias such as [email protected] instead of just [email protected].

Where does heroku CLI store credentials?

The Heroku command-line tool stores API tokens in the standard Unix file ~/. netrc ( $HOME\_netrc on Windows).

How do I change my heroku password?

Enter your email address below and we'll send you a link to reset your password. if you need additional assistance.

How do I access heroku terminal?

After you install the CLI, run the heroku login command. Enter any key to go to your web browser to complete login. The CLI then logs you in automatically. If you'd prefer to stay in the CLI to enter your credentials, run heroku login -i .


4 Answers

I had this same problem after changing the password, and I found it was because I was managing multiple accounts with the heroku-accounts gem.

I removed the account setup in heroku-accounts and then re-added it, using the new credentials to authenticate. Things then started working as before.

It seems that the authentication details stored in the heroku-accounts gem somehow override those you apply via the command line. Anyway, this worked for me.

like image 143
vaughanos Avatar answered Oct 13 '22 23:10

vaughanos


You can also try this:

$ heroku accounts:remove your_app

followed immediately by

$ heroku accounts:add your_app

Enter your email and your new password, and you should be good to go.

like image 21
Dan Laffan Avatar answered Oct 14 '22 00:10

Dan Laffan


The problem is due to heroku accounts as detailed by @vaughanos in his answer. A quick way to fix this is.

Check the accounts you have

heroku accounts

account1

*account2

The * indicates the heroku account being used for the current project. This is the account you have done the password change for using the web interface.

Change the default account you have setup for this project

Either change it in .git/config or do a heroku accounts:set account1

Now do heroku accounts:remove account2

Now add it back with heroku accounts:add account2. Enter your email and new password. Everything will be setup up for you.

If it prompts you to update your ~/.ssh/config, do it, but most likely that wouldn't require a change.

like image 25
Pratik Mandrekar Avatar answered Oct 14 '22 00:10

Pratik Mandrekar


For all the future error-Googlers out there:

The issue from 2013 has been fixed, however, after you change your password on the website, use the command:

heroku login

You will be prompted for your Heroku login and your new password. Goodbye weird "Authentication success. Authentication failure." errors.

via the Heroku docs: https://devcenter.heroku.com/articles/authentication, about half-way down the page.

like image 41
Jaime Avatar answered Oct 13 '22 22:10

Jaime