Skip to content
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

Credential Helper pops up all the time #2776

Closed
1 task
tonypdmtr opened this issue Jul 31, 2020 · 17 comments · Fixed by git-for-windows/build-extra#301
Closed
1 task

Credential Helper pops up all the time #2776

tonypdmtr opened this issue Jul 31, 2020 · 17 comments · Fixed by git-for-windows/build-extra#301
Milestone

Comments

@tonypdmtr
Copy link

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?

32-bit

$ git --version --build-options

git version 2.28.0.windows.1
cpu: i686
built from commit: 77982caf269b7ee713a76da2bcf260c34d3bf7a7
sizeof-long: 4
sizeof-size_t: 4
shell-path: /bin/sh
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?

Win7, 32-bit and Win7 64-bit

$ cmd.exe /c ver

Microsoft Windows [Version 6.1.7601]


 - What options did you set as part of the installation? Or did you choose the
   defaults?

One of the following:

type "C:\Program Files\Git\etc\install-options.txt"
type "C:\Program Files (x86)\Git\etc\install-options.txt"
type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

N/A


 - Any other interesting things about your environment that might be related
   to the issue you're seeing?

** insert your response here **

### Details

 - Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

** insert your response here **

 - What commands did you run to trigger this issue? If you can provide a
   [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve)
   this will help us understand the issue.

git push
git pull

 - What did you expect to occur after running these commands?

Normal behavior

 - What actually happened instead?

A credential helper window pops up and no matter which selection (and whether I save or not), I always get this popup in subsequent commands.

This only happens on a PRIVATE repository which I created recently, so I can't be sure if this behavior is related to the latest version, or was there already, or if I'm doing something wrong with respect to private repository access as compared to my own public ones.

 - If the problem was occurring with a specific repository, can you provide the
   URL to that repository to help us with testing?

Because it's a private one, I can't.
@derrickstolee
Copy link


 - What options did you set as part of the installation? Or did you choose the
   defaults?

So, you are using the defaults? Then you are not using Git Credential Manager Core? Perhaps give that a try?

@tonypdmtr
Copy link
Author

tonypdmtr commented Aug 3, 2020

There was no installation, it's the portable edition. I simply copied the files in a directory and run git.
This is something I've done tens of times already with each new update that comes out. It was the first time I had this problem. But also the first time I tried on a private repo.

If I select 'Credential Manager Core' from the popup window, and select 'Always use this from now on', it still pops up the same window next time. This never happened before.

@tonypdmtr
Copy link
Author

Actually, I just realized, it does so on any repo, not just private.

On private repo, it pops up on both push and pull.
On public repo, it pops up only on push

@tonypdmtr
Copy link
Author

I went back to previous version and everything works OK. So, it's definitely a problem with the latest version.

@dwettstein
Copy link

dwettstein commented Aug 4, 2020

I have the same problem when using the latest version. Additionally the following message appears in the console after closing the popup window:

error: key does not contain a section: -

Could it be that GitForWindows is not able to write the selected option to the filesystem or something similar?


Edit:
BTW, what is the option to set GCM Core in .gitconfig?

[credential "helperselector"]
        selected = ???

respectively
git config --system credential.helper ???


Edit 2:
Just found it out:

$ git config --system credential.helper
manager-core

On the other machine the following value is set:

$ git config --system credential.helper
helper-selector

In my case, this was exactly the problem, it always asks which helper to select. Set it as follows:
git config --system credential.helper manager-core (or just manager)

@tonypdmtr
Copy link
Author

tonypdmtr commented Aug 4, 2020

@dwettstein Your suggestion (git config --system credential.helper manager-core) worked for me, too! Thanks.

However, I still think there is a bug in the last version in that the selection in the popup window, and with the checkbox for remembering this chosen option checked, does not 'stick', and one has to keep selecting all the time, unless the above command line option is used making the misbehaving popup window redundant,

dscho added a commit to dscho/build-extra that referenced this issue Aug 11, 2020
There are several instances where we want to format a string with
Unicode parameters (i.e. encoded in UTF-16). For those, we actually need
to use `%S` (with an upper-case `S`).

For some reason, this seemed to work with a lower-case `%s` before, but
it probably shouldn't have worked.

As a consequence, the choices were not persisted correctly.

This fixes git-for-windows/git#2776.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member

dscho commented Aug 11, 2020

Thank you for reporting this issue. My best guess is that this is a bug that was with us for a long time, hidden by a mingw-w64-gcc bug in versions before v10.x, where string format parameters for Unicode strings really need to use the upper-case version %S.

I have a tentative fix in git-for-windows/build-extra#301.

@dscho dscho added this to the Next release milestone Aug 11, 2020
@dscho
Copy link
Member

dscho commented Aug 11, 2020

Additionally the following message appears in the console after closing the popup window:

error: key does not contain a section: -

BTW this was the clue I needed to figure out the solution. Thank you so much for that!

dscho added a commit to git-for-windows/build-extra that referenced this issue Aug 14, 2020
The credential helper selector (used as default credential helper
in the Portable Git) [now persists the users choice correctly
again](git-for-windows/git#2776).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@M0ns1gn0r
Copy link

I had this issue today on

λ git --version --build-options

git version 2.28.0.windows.1
cpu: x86_64
built from commit: 77982caf269b7ee713a76da2bcf260c34d3bf7a7
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh

I executed git fetch in Powershell 7.0.3 both as a normal user and as an admin. The "remember" checkbox didn't work. Also in my case there were no additional messages in the console.

@dscho
Copy link
Member

dscho commented Oct 7, 2020

I had this issue today on

λ git --version --build-options

git version 2.28.0.windows.1
cpu: x86_64
built from commit: 77982caf269b7ee713a76da2bcf260c34d3bf7a7
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh

I executed git fetch in Powershell 7.0.3 both as a normal user and as an admin. The "remember" checkbox didn't work. Also in my case there were no additional messages in the console.

Could you try the latest snapshot at https://wingit.blob.core.windows.net/files/index.html ?

@M0ns1gn0r
Copy link

I tried, but now I can't bring back the selector window 😱 Even though git config credential.helper gives me helper-selector, there is no window, the console directly asks for the password to the remote DevOps.

@dscho
Copy link
Member

dscho commented Oct 7, 2020

Can you run git credential-helper-selector manually?

@dscho
Copy link
Member

dscho commented Oct 7, 2020

Oh, and what does git config --show-origin --get-all credential.helper say?

@M0ns1gn0r
Copy link

credential-helper-selector produces no result.

λ & "D:\PortableGitTest\bin\git.exe" config --show-origin --get-all credential.helper
file:D:/PortableGitTest/etc/gitconfig   helper-selector
λ & "D:\PortableGitTest\bin\git.exe" fetch
Password for 'https://<redacted>@dev.azure.com':

@dscho
Copy link
Member

dscho commented Oct 8, 2020

Can you set GIT_TRACE=1 and then run git credential-helper-selector again?

@M0ns1gn0r
Copy link

λ & "D:\PortableGitTest\bin\git.exe" credential-helper-selector
07:57:10.823095 exec-cmd.c:237          trace: resolved executable dir: D:/PortableGitTest/mingw64/bin
07:57:10.824095 git.c:710               trace: exec: git-credential-helper-selector
07:57:10.824095 run-command.c:663       trace: run_command: git-credential-helper-selector

And just to make sure I'm running the latest snapshot:

λ & "D:\PortableGitTest\bin\git.exe" --version --build-options
07:58:17.614888 exec-cmd.c:237          trace: resolved executable dir: D:/PortableGitTest/mingw64/bin
07:58:17.615889 git.c:444               trace: built-in: git version --build-options
git version 2.29.0.rc0.windows.1
cpu: x86_64
built from commit: 58a43b46e3811645a1fe75703627576b0a97f7eb
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh

@dscho
Copy link
Member

dscho commented Oct 8, 2020

Same for me:

PS C:\Users\me> .\repros\PortableGit\cmd\git.exe credential-helper-selector
11:19:47.735703 exec-cmd.c:237          trace: resolved executable dir: C:/Users/me/repros/PortableGit/mingw64/bin
11:19:47.735703 git.c:710               trace: exec: git-credential-helper-selector
11:19:47.735703 run-command.c:663       trace: run_command: git-credential-helper-selector

At that point, this dialog pops up:

image

FWIW, I tested with the latest snapshot:

git version 2.29.0.rc0.windows.2
cpu: x86_64
built from commit: 190f8d918d77b8c9dc2406f0a60adc925ef6e7a6
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants