-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git repository with authentication: could not read Username - bash: /dev/tty: No such device or address #327
Comments
Which options did you choose when installing? Does it work from Git Bash? Does it work from Git Bash if you choose ConHost? What if you run it with Also: could you maybe come up with a minimal example that reproduces the issue? I.e. some Javascript one-liner that calls |
We have a similar problem. In our case git commands are run from a perl script and we need to capture stdout and stderr. With msysgit 1.9.5 we had no problems. But with the new version 2.5.0 we are getting the same error: |
PS: in the one-liner above backticks seem to have disappeared: Thank you for any help. |
@vital055 I'll do my famous imitation of a broken record 😼 Which options did you choose when installing? Does it work from Git Bash? Does it work from Git Bash if you choose ConHost? What if you run it with winpty (as suggested in the Known Issues)? |
Thanks for looking at this...
I tried many possible option combinations, i.e. Windows Explorer intergration and w/o, use Git from Windows or Windows and Unix optional tools, Regards, vital055
|
@aorylamballe since @vital055 already addressed my questions, I would appreciate it more if you came up with that MCVE I have been asking for than if you re-tested with Git Bash and winpty. |
Hi @dscho, The on-line command @vital055 provided reproduces the issue for me as well:
This should prompt the username / password, but instead displays the same error message:
Further tests:
I don't know as well what is ConHost nor how to use it. Thanks. |
That might be a different issue, though... So I'd still be interested in that Javascript MCVE so I can be certain that I debug and fix the original bug.
It is one option in the installer as terminal emulator to use with Git Bash; the other one is mintty. |
Bower reproduces the problem, so I checked its source code and extracted the code to execute git. The following node script reproduces the error:
ConHost installation option does not change anything, it continues to behave the same as the Windows cmd, same error. This script is not enough to clone successfully with version 1.9.5, something might be missing I didn't find in the bower source (the program logs nothing and never exits), but it works with |
@aorylamballe thank you for the MCVE. I will check it out as soon as I am done with some other tickets, and hopefully will have a good idea how to fix the problem. |
Thanks for your help :) |
Sorry to let this slip for so long. In the meantime, it has unfortunately become even more difficult to fix because we now launch In the meantime, I got another idea, though: could you test whether this works? export DISPLAY=required
export SSH_ASKPASS=/mingw64/libexec/git-core/git-gui--askpass
export GIT_ASKPASS=$SSH_ASKPASS
node ... |
@aorylamballe could you? |
Unfortunately, the problem remains, in that I am still getting "bash: /dev/tty: No such device or address" error - with version 2.6.3 I also tried $GIT_ASKPASS and $SSH_ASKPASS variables - suggested above.. to no avail... |
@vital055 at this point, I cannot focus on this ticket anymore, so I will have to suggest that you try to debug this yourself. In particular, you need to find out where |
@dscho @vital055 Sorry for my very late response, I was busy recently. I retried with So we have a workaround, getting the latest version of git (not sure this is the reason) and installing the bower dependency in the project using git bash. It is not convenient since all other usecases I have met with git so far work in CMD (webstorm has an embedded CMD very convenient), but at least it means we can finally stop using git 1.9.5 (which has other issues with TFS git). @vital055, does this inspire you something? Thanks! |
I am closing this ticket because we now ship the Git Credential Manager and enable it by default (and then this issue does not occur, but instead the Credential Manager asks for credentials interactively, I just tested this). |
Works like a charm, I can install from cmd and enter credentials. Thanks a lot @dscho ! |
What I would suggest to anyone reading this; Generally this issue comes from package installers (like npm) not prompting the user for credentials. |
Referencing: |
@blowsie I think the issue here was related to git for Windows, because we could reproduce it with I am not sure it is exactly the same issue as the link you provided. This one seems to be an extra npm-specific issue (I was lucky and didn't face it - any relation with being using npm 3.x instead of 2.x?). +1 for SSH, it will also help to automate builds. |
this still happens with the latest install of Git For Windows... and I cannot use GUI credential input, as I'm using Git in a scripted manner, programmatically detecting the username and password prompts, and injecting them as they're requested. In fact, I'm specifically running this when I setup my Continuous Integration hosts (where my automation is running): |
here's another conversation complaining about this impacting automation: https://github.521000.bestmunity/t5/GitHub-Actions/Is-it-possible-to-disable-the-Windows-git-credential-helper/td-p/33962 |
Wait, this ticket is about interactive prompts, why are we talking about scripted use now? If you truly want to disable any credential helper, you'll have to call |
Yes, I wrote automation around my continuous integration which performs |
That sounds like it dearly wants to be simplified via a custom credential helper. |
I am also having this issue after installing git through conda (on windows) and attempting to clone a repo within an anaconda prompt. |
Just experienced this with git version 2.47.1.windows.1. My workaround:
Now it should only prompt you for username and personal access token on the cmd line. |
Hi,
I met a strange behavior. We have a git repository that requires a user/password (or a SSH key) to clone a project repository. Cloning directly works, but when I try through command line tools like Cordova, bower... that uses git to get a component, I get error messages with the latest git (2.5, 2.4.6, 2.4.5...), but I have no error with git 1.9.5 (previous official git for Windows).
I tested on multiple Windows 7 and multiple Windows 8, same behavior (KO with recent git, OK with 1.9.5).
With bower:
bower install https://my-repo-with-password.com/group/my-lib.git
With cordova:
bower install https://my-repo-with-password.com/group/my-lib.git
Any idea about what could be wrong?
Thanks!
PS: Reaching with SSH does not work (
bower install [email protected]:group/my-lib.git
orionic plugin add [email protected]:group/my-cordova-plugin.git
) does not work, but that may be another issue since it does not work with git 1.9.5 as well.The text was updated successfully, but these errors were encountered: