You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cloning a repository with LFS files via HTTPS and Git credential helper fails on Windows with the latest version:
$ git clone https://server/org/lfs.git test
Cloning into 'test'...
remote: Counting objects: 31, done.
remote: Total 31 (delta 0), reused 0 (delta 0), pack-reused 31
Unpacking objects: 100% (31/31), done.
Downloading test.bin (6 B)
Error downloading object: test.bin (54d03b8): Smudge error: Error downloading test.bin (54d03b8c1bea08ef8896747edc304ff22fbe71a9d764ef9a3ee7b1a4ea60a622): batch response: Git credentials for https://server/org/lfs.git/info/lfs not found:
exec: "C:/Program Files/Git/mingw64/libexec/git-core/git-gui--askpass": file does not exist
Errors logged to C:\code\test\.git\lfs\objects\logs\20170928T122143.4412378.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: test.bin: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'
git-gui--askpass is part of Windows but no "exe" file. Therefore, I don't think it can be used. Maybe @dscho or @sschuberth can give us a quick hint here as I am no Windows expert.
I think the relevant change was introduce in #2609 .
Setup
$ git --version
git version 2.14.1.windows.1
$ git lfs version
git-lfs/2.3.1 (GitHub; windows amd64; go 1.8.3; git 01fef48f)
$ git config credential.helper
wincred
I was about to suggest this could be worked around by ensuring to check "Associate .sh files to be run with Bash" in the Git for Windows installer, but obviously that does not work because that shell script does not have an .sh extension.
git-gui--askpass is part of Windows but no "exe" file.
We could make it an .exe file like cmd\git-gui.exe and cmd\gitk.exe. But that still would require you to change your SSH_ASKPASS, I guess, otherwise it may try to pick up the script again...
I stuck export SSH_ASKPASS= in my .bash_profile to work around this :(
@technoweenie According to the documentation you linked, Git should only go the "askpass" route if no credential helper is defined. In this case, a credential helper is defined.
Before, it was probably only working for me because of the "askpass" options I only had SSH_ASKPASS defined (I have no idea who defined it, not me anyway).
Should LFS skip trying these at all if it finds a credential helper in the config?
@dscho Do you know off the top of your head what the analogous Git behavior actually is? Is it probable that the windows credential helper only works for https, and so GFW sets/needs/knows to use SSH_ASKPASS instead for ssh?
@dakotahawkins I think the problem is that Go does not understand scripts (apart from .bat/.cmd; git-gui--askpass is a Tcl/Tk script, though), the same way as regular Windows executables do not understand scripts. git.exe has special code to identify and execute scripts that have a #! line, as git-gui--askpass does.
@dscho Sure, that makes sense to me, but I was wondering more about Git's workflow when you have a credential helper defined. It's not clear to me from the documentation what exactly is supposed to happen. Does it try all your helpers and fall back on askpass?
This part of the documentation that confuses me:
Without any credential helpers defined, Git will try the following strategies to ask the user for usernames and passwords
If the GIT_ASKPASS environment variable is set, the program specified by the variable is invoked. A suitable prompt is provided to the program on the command line, and the user’s input is read from its standard output.
Otherwise, if the core.askPass configuration variable is set, its value is used as above.
Otherwise, if the SSH_ASKPASS environment variable is set, its value is used as above.
Otherwise, the user is prompted on the terminal.
It sounds like it might be implying that it will use either credential helpers or askpass, not both, but that can't be the case, can it?
Hi all,
sorry for bothering, but the issue was resolved by reordering credentials acquiring, wasn't it? I'm not familiar with the technology.
That'd fix the issue when credentials helper is defined.
However, in some of our shared repositories (shared locally) we don't have credential helper enabled.
And the results are more or less like:
$ git -c credential.helper= clone https://repo/repo.git
Cloning into .......
Username for '.....': <username>
remote: Counting objects: ..., done.
remote: Compressing objects: 100% (...), done.
remote: Total ... (delta ...), reused ... (delta ...)
Receiving objects: 100% (...), ..., done.
Resolving deltas: 100% (...), done.
Downloading <some binary> (1.6 MB)
Error downloading object: <the binary> (fc7e7dc): Smudge error: Error downloading <the binary> (fc7e7dc5458201c34fa64bf4b146ee1fcf0f3da72cc67d97a2c8e3d02212239a): batch response: Git credentials for https://repo.git/info/lfs not found:
exec: "C:/Program Files/Git/mingw64/libexec/git-core/git-gui--askpass": file does not exist
Errors logged to C:\repos\git\.....\.git\lfs\objects\logs\20180420T215624.9198164.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: <the binary>: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'
Thank you for the feedback.
I'm afraid it's still an issue, although I'm not 100% sure, because (according to some other git lifs issue, installing git lfs separately doesn't update existing embedded git version). Still, I'm 95% sure:
MINGW64 /c/repos/git
$ git-lfs version
git-lfs/2.3.2 (GitHub; windows amd64; go 1.8.3; git 81153cc0)
MINGW64 /c/repos/git
$ git-lfs -c credential.helper= clone https://....git dir1
Cloning into ...
Username for ...
remote: Counting objects: ..., done.
remote: Compressing objects: 100% (.../...), done.
remote: Total ... (delta ...), reused ... (delta ...)
Receiving objects: 100% (.../...), ... done.
Resolving deltas: 100% (.../...), done.
Checking out files: 100% (.../...), done.
Git LFS: (0 of ... files) 0 B / ... MB
batch response: Git credentials for https://....git not found:
exec: "C:/Program Files/Git/mingw64/libexec/git-core/git-gui--askpass": file does not exist
batch response: Git credentials for https://....git not found:
exec: "C:/Program Files/Git/mingw64/libexec/git-core/git-gui--askpass": file does not exist
error: failed to fetch some objects from 'https://....git/info/lfs'
MINGW64 /c/repos/git
$ /c/Program\ Files/Git\ LFS/git-lfs version
git-lfs/2.4.0 (GitHub; windows amd64; go 1.8.3; git 1a98fa5c)
MINGW64 /c/repos/git
$ /c/Program\ Files/Git\ LFS/git-lfs -c credential.helper= clone https://....git dir2
Cloning into '...'...
Username for ...
remote: Counting objects: ..., done.
remote: Compressing objects: 100% (.../...), done.
remote: Total ... (delta ...), reused ... (delta ...)
Receiving objects: 100% (.../...), ..., done.
Resolving deltas: 100% (.../...), done.
Checking out files: 100% (../...), done.
batch response: Git credentials for https://....git not found:
credential fill errors:
exec: "C:/Program Files/Git/mingw64/libexec/git-core/git-gui--askpass": file does not exist
batch response: Git credentials for https://....git not found:
credential fill errors:
exec: "C:/Program Files/Git/mingw64/libexec/git-core/git-gui--askpass": file does not exist
error: failed to fetch some objects from 'https://....git/info/lfs'
$ set | grep PASS
SSH_ASKPASS=/mingw64/libexec/git-core/git-gui--askpass
👋 @robgom ! I would like to step back for a moment and look at the problem from a different angle. What do you want to achieve here? What is your goal?
... works on Linux and macOS. However, it would ask you for credentials for every Git LFS file. On Windows, unfortunately, the command would not ask for credentials for every Git LFS file. It would fail in the way you showed above. That can be consider a bug. However, nobody runs into this bug as nobody wants to enter the credentials for every Git LFS file 😄. Hence my question above: What is your goal here?
Thank you for the heads up.
I'm sorry if my example resulted in some confusion.
My original requirement is that in some controlled environments git repository is shared among several developers. For that they have credential manager disabled. And so far it worked quite ok. I think we've given them custom credential helper to cache credentials for process and subprocesses only or similar.
I'm here because for some reason the process stopped working for them. I think it'd be relevant to the changes mentioned here. I don't know what it was, still debugging the root cause.
I'd be ok if the credentials are to be repeated for start, as then I'd be able to re-use our credential helper again. And then possibly ask for caching them between git and git-lfs for single command execution.
Hold on ...
I want to be asked for username and password, so putting that in my command doesn't help (it's available in history and other places).
Unless I miss something ...
Honestly, I don't fully understand the question.
I've implemented the thing according to https://git-scm.com/docs/gitcredentials :
"If the GIT_ASKPASS environment variable is set, the program specified by the variable is invoked. A suitable prompt is provided to the program on the command line, and the user’s input is read from its standard output."
It should get username and password prompts, then based on its own state either provide data from some store or query user for them.
Hence I don't understand this "what protocol" part. Could you elaborate?
Why did I do it that way, instead of writing credential helper? I've assumed that would fit my needs. Do you think implementing credentials helper would solve my needs (cache credentials for single process tree only, then forget them)?
Activity
sschuberth commentedon Sep 28, 2017
I was about to suggest this could be worked around by ensuring to check "Associate .sh files to be run with Bash" in the Git for Windows installer, but obviously that does not work because that shell script does not have an
.shextension.technoweenie commentedon Sep 28, 2017
If #2609 is the relevant change, do you have
SSH_ASKPASSset? I added it because Git also uses it.Also, have you looked at #2607? That's another change to the ASKPASS support in 2.3.1.
I wonder if we should stat the askpass command before attempting to run it? Or just handle that error better and try the next authentication mode.
dscho commentedon Sep 28, 2017
We could make it an
.exefile likecmd\git-gui.exeandcmd\gitk.exe. But that still would require you to change yourSSH_ASKPASS, I guess, otherwise it may try to pick up the script again...dakotahawkins commentedon Oct 1, 2017
I stuck
export SSH_ASKPASS=in my.bash_profileto work around this :(@technoweenie According to the documentation you linked, Git should only go the "askpass" route if no credential helper is defined. In this case, a credential helper is defined.
Before, it was probably only working for me because of the "askpass" options I only had
SSH_ASKPASSdefined (I have no idea who defined it, not me anyway).Should LFS skip trying these at all if it finds a credential helper in the config?
@dscho Do you know off the top of your head what the analogous Git behavior actually is? Is it probable that the windows credential helper only works for https, and so GFW sets/needs/knows to use
SSH_ASKPASSinstead for ssh?dscho commentedon Oct 2, 2017
@dakotahawkins I think the problem is that Go does not understand scripts (apart from
.bat/.cmd;git-gui--askpassis a Tcl/Tk script, though), the same way as regular Windows executables do not understand scripts.git.exehas special code to identify and execute scripts that have a#!line, asgit-gui--askpassdoes.dakotahawkins commentedon Oct 2, 2017
@dscho Sure, that makes sense to me, but I was wondering more about Git's workflow when you have a credential helper defined. It's not clear to me from the documentation what exactly is supposed to happen. Does it try all your helpers and fall back on askpass?
This part of the documentation that confuses me:
It sounds like it might be implying that it will use either credential helpers or askpass, not both, but that can't be the case, can it?
technoweenie commentedon Oct 2, 2017
#2634 is discussing the order of credentials. I'd love more feedback on it. I should be able to roll 2.3.2 out this week based on the consensus there.
dscho commentedon Oct 2, 2017
@dakotahawkins unfortunately, I am not an expert in that area. Maybe a good question for the git mailing list?
technoweenie commentedon Oct 2, 2017
@dakotahawkins found it in #2634 (comment). I have a fix in #2637, which is just waiting for confirmation that it works.
technoweenie commentedon Oct 3, 2017
This should be fixed in LFS 2.3.2.
robgom commentedon Apr 20, 2018
Hi all,
sorry for bothering, but the issue was resolved by reordering credentials acquiring, wasn't it? I'm not familiar with the technology.
That'd fix the issue when credentials helper is defined.
However, in some of our shared repositories (shared locally) we don't have credential helper enabled.
And the results are more or less like:
Is that the same issue (git lfs 2.3.2)?
What can I do about that?
Regards,
Robert
ttaylorr commentedon Apr 20, 2018
Hi @robgom, is this still an issue with the latest release of Git LFS? (v2.4.0).
robgom commentedon Apr 22, 2018
Thank you for the feedback.
I'm afraid it's still an issue, although I'm not 100% sure, because (according to some other git lifs issue, installing git lfs separately doesn't update existing embedded git version). Still, I'm 95% sure:
Is the procedure ok? Whar can I do about that?
Regards,
Robert
robgom commentedon Apr 23, 2018
(I think this might be related:
https://www.bountysource.com/issues/45767930-unsetting-git-credential-helper-causes-git-lfs-clone-to-fail)
ttaylorr commentedon Apr 24, 2018
@robgom do you have any of the following set?
$GIT_ASKPASSor$SSH_ASKPASSin your environment?core.askpassin your gitconfig?robgom commentedon Apr 24, 2018
Hi @ttaylorr ,
HTH,
Robert
robgom commentedon Apr 24, 2018
BTW.
I've tried to play with SSH_ASKPASS/GIT_ASKPASS to some extent, but to no avail.
For example unsetting SSH_ASKPASS did not help:
Please let me know if I can provide any more info.
Regards,
Robert
larsxschneider commentedon Apr 24, 2018
👋 @robgom ! I would like to step back for a moment and look at the problem from a different angle. What do you want to achieve here? What is your goal?
Your command...
... works on Linux and macOS. However, it would ask you for credentials for every Git LFS file. On Windows, unfortunately, the command would not ask for credentials for every Git LFS file. It would fail in the way you showed above. That can be consider a bug. However, nobody runs into this bug as nobody wants to enter the credentials for every Git LFS file 😄. Hence my question above: What is your goal here?
robgom commentedon Apr 24, 2018
Thank you for the heads up.
I'm sorry if my example resulted in some confusion.
My original requirement is that in some controlled environments git repository is shared among several developers. For that they have credential manager disabled. And so far it worked quite ok. I think we've given them custom credential helper to cache credentials for process and subprocesses only or similar.
I'm here because for some reason the process stopped working for them. I think it'd be relevant to the changes mentioned here. I don't know what it was, still debugging the root cause.
I'd be ok if the credentials are to be repeated for start, as then I'd be able to re-use our credential helper again. And then possibly ask for caching them between git and git-lfs for single command execution.
Please let me know if it addresses your concern.
Regards,
Robert
larsxschneider commentedon Apr 24, 2018
OK. Try this method to pass the username and password:
That should work on all platforms and with Git LFS. The
'"'"'around the password is only necessary if you have special characters in your password.robgom commentedon Apr 24, 2018
Hold on ...
I want to be asked for username and password, so putting that in my command doesn't help (it's available in history and other places).
Unless I miss something ...
Robert
robgom commentedon Apr 24, 2018
Ok, let me show how it behaves with our own credential helper:
First, git 2.14.2 with git lfs 2.3.2:
And the same repeated with git lfs 2.4.0:
(where I wanted to use my own credential helper, defined with GIT_ASKPASS, to perform arbitrary credentials caching)
HTH,
Robert
larsxschneider commentedon Apr 24, 2018
What protocol did you implement with
/path/git_ask_pass.sh? Why don't you define that script as credential helper?robgom commentedon Apr 24, 2018
Honestly, I don't fully understand the question.
I've implemented the thing according to https://git-scm.com/docs/gitcredentials :
"If the GIT_ASKPASS environment variable is set, the program specified by the variable is invoked. A suitable prompt is provided to the program on the command line, and the user’s input is read from its standard output."
It should get username and password prompts, then based on its own state either provide data from some store or query user for them.
Hence I don't understand this "what protocol" part. Could you elaborate?
Why did I do it that way, instead of writing credential helper? I've assumed that would fit my needs. Do you think implementing credentials helper would solve my needs (cache credentials for single process tree only, then forget them)?
Regards,
Robert