cli icon indicating copy to clipboard operation
cli copied to clipboard

heroku login does not work with cygwin or git bash

Open jdx opened this issue 11 years ago • 60 comments

This is now fixed. Just update your CLI.

Just run the following

$ heroku update
$ heroku login
OR
$ winpty heroku login -i

Or use cmd.exe instead

jdx avatar Sep 28 '15 21:09 jdx

This is inconsistent. I installed Heroku into Cygwin using the standalone installer (https://toolbelt.heroku.com/install.sh) which worked fine (once I removed all the sudo commands in the install script). Some commands such as heroku apps and heroku logs work fine in the Cygwin shell (and ask for login) whereas directly calling heroku login or commands like heroku stack:set come up with the message that

Login is currently incompatible with git bash/Cygwin

pointing to this issue.

Because I installed the toolbelt using Cygwin, to run it using cmd I have to run

C:\Users\username\AppData\Local\heroku\heroku-cli

npalmius avatar Oct 11 '15 15:10 npalmius

I get this error since I enabled 2fa on my account

shuckc avatar Oct 13 '15 19:10 shuckc

I have installed newest Git... It may be certificates?

neosb avatar Oct 24 '15 14:10 neosb

Any update here?

cherchyk avatar Dec 04 '15 18:12 cherchyk

Sorry, I dont get it, what the solution here?

chroda avatar Dec 14 '15 23:12 chroda

whats the solution?

shahwaiz90 avatar Dec 15 '15 07:12 shahwaiz90

It works with ZSH. cygstart zsh.

CMCDragonkai avatar Dec 16 '15 06:12 CMCDragonkai

> $ heroku login 
> Installing Heroku Toolbelt v4... done. 
> For more information on Toolbelt v4: https://github.com/heroku/heroku-cli 
> heroku-cli: Adding dependencies... ! mkdir $USERPROFILE\AppData\Local\heroku\tmp\node358338010\npm-3.3.10\node_modules\fstream-npm\node_modules\fstream-ignore\node_modules\minimatch\node_modules\brace-expansion\node_modules: The filename or extension is too long. 
> done 
> heroku-cli: Adding dependencies... ! mkdir $USERPROFILE\AppData\Local\heroku\tmp\node489516235\npm-3.3.10\node_modules\fstream-npm\node_modules\fstream-ignore\node_modules\minimatch\node_modules\brace-expansion\node_modules: The filename or extension is too long. 
> done 
> heroku-cli: Installing core plugins...Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... Error reading plugin heroku-cli-addons. Reinstalling... ! Command cancelled.

jkutner avatar Dec 26 '15 14:12 jkutner

Need this fixed. Cannot run pg:ps command. I have psql in Cygwin.

C:\Users\Chloe\workspace\ShopWiz>heroku pg:ps
 !    The local psql command could not be located
 !    For help installing psql, see https://devcenter.heroku.com/articles/heroku-postgresql#local-setup

Tried cmd in Cygwin but it didn't work.

Chloe@xps ~/workspace/ShopWiz
$ cmd
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Users\Chloe\workspace\ShopWiz>heroku pg:ps
heroku pg:ps
Enter your Heroku credentials.
Email: [email protected]
Password (typing will be hidden):
Login is currently incompatible with git bash/cygwin
In the meantime, login via cmd.exe
https://github.com/heroku/heroku-cli/issues/84

C:\Users\Chloe\workspace\ShopWiz>

starrychloe avatar Dec 29 '15 06:12 starrychloe

This message was a little unclear for me, so in case anyone is in a similar situation (after I activate 2FA, I received this error), here is what worked for me. I closed out Git Bash then opened the command prompt. From there, I was able to successfully login to heroku through "heroku login". I then closed the command prompt and re-launched Git Bash and everything worked fine.

In regards to @starrychloe issue, running cmd within Bash/Cygwin probably won't work either. You may need to close Cygwin and open a fresh command prompt and then login from there.

eappleby avatar Jan 11 '16 20:01 eappleby

@eappleby suggestion is the preferred solution right now, run heroku login using the windows command prompt. This will drop your API key into your netrc, at which point you can open up cygwin or git bash and do whatever you need to. The root cause of this problem is that stdin is not a real terminal, so we cannot turn off the echo during the password request. One solution we have considered is popping up a dialog to get the username password as this is what git does within git bash, but I am not sure how soon I will be able to get to this.

ransombriggs avatar Jan 11 '16 21:01 ransombriggs

@CMCDragonkai, nice one :)

Even better, just run cygstart zsh from the bash shell, then run heroku login, then close the zsh shell and bash works just fine.

What I really don't understand about this issue though is that other programs like ssh work fine hiding the password.

npalmius avatar Feb 11 '16 22:02 npalmius

Login is currently incompatible with git bash/cygwin Log in with Windows cmd.exe, it will work:

rbashish_heroku

rbashish_heroku_cmd

rbashish avatar Feb 23 '16 12:02 rbashish

@rbashish It appears that you did not enter your email or password correctly. I have been able to login successfully via cmd.exe. Could you please try again?

ransombriggs avatar Feb 23 '16 15:02 ransombriggs

@ransombriggs Thank you for replying. Apparently I have stated the reason that login will not work in Git Bash and it will work on cmd.exe. Please read the second line.

And Intentionally, I have input the wrong email id and password to show that it does not give error as it used to give in Git bash.

rbashish avatar Feb 24 '16 06:02 rbashish

I got this when I tried to login... image

velo avatar Mar 27 '16 20:03 velo

@velo Try using "cmd prompt". If you get the same error then there might be some problems with the dependent software - try reinstalling it.

rbashish avatar Mar 28 '16 07:03 rbashish

@velo Could you open a separate issue? Could you include how you configured /cygdrive? The heroku command when run from cygwin basically re-executes itself with the ruby that is installed as part of the toolbelt. This is the line that is failing for you https://github.com/heroku/heroku/blob/master/resources/exe/heroku#L4 because $0 has /cygdrive prefixed in front of it.

ransombriggs avatar Mar 28 '16 15:03 ransombriggs

It would be nice if this would get fixed, but in the mean time, the best way to launch a cmd prompt from a different (cygwin/git bash/etc.) shell is to run

$ start cmd

destenson avatar Apr 12 '16 08:04 destenson

Got this error when using Mobaxterm:- image

When can I expect the fix?

friendyogi avatar May 04 '16 11:05 friendyogi