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
{{ message }}
Repository navigation
getCreds fails when CredentialManagers don't return optional fields #614
git-lfs fails with the cryptic error "'git credential fill' error: exit status 128" when not all fields are written out. Should we match git's behavior?
So LFS should try git-credential as a last resort. If the credential helper isn't returning enough info, I'm not sure how else we can handle it. Do you think it'd be better to just ignore the error and let the command fail with an auth error?
git successfully authenticates without extra fields (it only requires protocol and host I think). We should do the same thing git does.
I think an auth error is better. Ideally we have an error that is "Your Credential Helper Gave Us Something We Didn't Expect". The credential helper is completing successfully and returning all the info it thinks should be needed--so the issue is in the auth chain. The 128 error is a generic "git didn't exit cleanly" which could mean any number of things.
Given that CredHelpers can basically do whatever they want, we should expect them to fail and handle it gracefully when they don't match with what we expect.
Do you think it'd be better to just ignore the error and let the command fail with an auth error?
This is what Git does, this is what users will expect. So, yes.
I helped @WillHipschman debug the issue, it seems that if git-credential fill fails to write username=\npassword=\n git-lfs chokes. However, empty values are legal value and assuming empty == null is dangerous. Instead, the absence of the values printed should be treated as null while empty values should treated as empty values.
How do you authenticate without a username or password?
Avoiding the "why would you do this" aspect to this answer, certainly you can have a blank password in general.
The more compelling use, here, is that git indicates that you should use the default credentials for Kerberos or NTLM authentication by specifying an empty username and password when prompted. This empty username and password can be round tripped by a credential helper, in which case you will never be prompted for this again and you'll just always do Kerberos.
The more compelling use, here, is that git indicates that you should use the default credentials for Kerberos or NTLM authentication by specifying an empty username and password when prompted.
Ah, that makes sense. 👍 So if I'm understanding correctly, the flow should look like this:
# FIRST TIME
$ git push origin master
# 'git-credential fill' is called
# prompts for your username/password
# you enter blank to trigger ntlm auth
# 'git-credential accept' is called
# SECOND TIME
$ git push origin master
# 'git-credential fill' returns blank username/password
The 128 error is a generic "git didn't exit cleanly" which could mean any number of things.
This 128 error is coming from git-credential. Discarding any error, or even just 128 exit codes is easy. It would suck to swallow up a legit error though.
Looking around a bit at the Git code it seems that git-credential emits an error message (aka a call to die) if the username or password values are not returned.
Activity
technoweenie commentedon Aug 27, 2015
So LFS should try
git-credentialas a last resort. If the credential helper isn't returning enough info, I'm not sure how else we can handle it. Do you think it'd be better to just ignore the error and let the command fail with an auth error?WillHipschman commentedon Aug 27, 2015
I have a few thoughts:
whoisj commentedon Aug 27, 2015
This is what Git does, this is what users will expect. So, yes.
I helped @WillHipschman debug the issue, it seems that if
git-credential fillfails to writeusername=\npassword=\ngit-lfs chokes. However, empty values are legal value and assuming empty == null is dangerous. Instead, the absence of the values printed should be treated as null while empty values should treated as empty values.technoweenie commentedon Aug 28, 2015
How do you authenticate without a username or password?
ethomson commentedon Aug 28, 2015
Avoiding the "why would you do this" aspect to this answer, certainly you can have a blank password in general.
The more compelling use, here, is that git indicates that you should use the default credentials for Kerberos or NTLM authentication by specifying an empty username and password when prompted. This empty username and password can be round tripped by a credential helper, in which case you will never be prompted for this again and you'll just always do Kerberos.
ethomson commentedon Aug 28, 2015
I apologize for coming late to this conversation and with very little background, so if I'm misunderstanding your quote, I apologize.
This should be allowed per the spec, and you should just chain to the next one until you have enough data to perform the authentication:
technoweenie commentedon Aug 28, 2015
Ah, that makes sense. 👍 So if I'm understanding correctly, the flow should look like this:
This 128 error is coming from
git-credential. Discarding any error, or even just 128 exit codes is easy. It would suck to swallow up a legit error though.whoisj commentedon Aug 28, 2015
Looking around a bit at the Git code it seems that git-credential emits an error message (aka a call to
die) if the username or password values are not returned.https://github.com/git/git/blob/77bd3ea9f54f1584147b594abc04c26ca516d987/credential.c#L286
Because it is a built-in, it always returns 128 on any non-ideal exit (even allowed and/or expected ones).
https://github.com/git-for-windows/git/blob/master/usage.c#L34-L38
I recommend that you wholly ignore the return code, and rely on parsing the data coming back from the helper.
technoweenie commentedon Aug 28, 2015
This should be fixed in #611 (comment)
technoweenie commentedon Sep 3, 2015
#611 has been merged. Let me know if you still have issues.