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
Credentials not found using Username / Password in remote #906
Cool, thanks for the report. This is a pretty low priority bug though. Putting authentication info in your git config is a pretty terrible idea, security-wise.
@technoweenie I'm with you regarding using auth in the config and security. But my use case is that I need to fetch lfs objects on a build server (VSTS). I only have the OAuth token available and therefore temporarily change the remote url to contain the OAuth token to access the repo on the server.
The other option would be to use a dedicated service account only for this and have its credentials stored permanently on the build agent which I think is worse security-wise.
This breaks for me as well. I'm just entering my credentials at the command line. Also, my repo isn't exact super duper secret territory considering it's all open source anyways... I honestly can't imagine why anyone would try to hack it.
Cool, thanks for the report. This is a pretty low priority bug though. Putting authentication info in your git config is a pretty terrible idea, security-wise.
Is there a recommended solution to the problem presented?
Is there something the GCM could be providing here?
This breaks for me too... My scenario is less security sketchy though... I have to have a username and password on the lfs server, but I have a "read only" permission account that I actually WANT to be public. That's the username and password in plain text that I want to have in the .lfsconfig file.
Also, I noticed the lfs.url will parse the username only if its supplied but neither if both are supplied. e.g.
changed the title [-]Credentials not found using Username / Password in remot[/-][+]Credentials not found using Username / Password in remote[/+]on Feb 9, 2016
@WestonThayer It should work on VSTS too. (I created an account real quick and tested it in a docker. It DOES work) If you are still having problems, it might be on how your VSTS account is setup (send me a private message on gitter if you want to discuss the VSTS part further).
If you are using a service like VSTS, there is no need to set a custom lfs url, The credential storage will work for the normal git url AND the git lfs url, which will be based off of the same https url from VSTS
In another scenario where you need to use an external lfs server, keep in mind what the FULL lfs url normally have something AFTER the *.git directory. This of course could vary from server to server, that's all beyond my scope.
For example, a github.com url would be https://github.com/username/projectname.git, and you can NOT set the lfs.url to the exact same, because that's not the lfs url. The lfs url is https://github.com/username/projectname.git/info/lfs.
@pascalberger Why can you not use the store credential in your situation? If you have a script on your build server, leave the url untouched in whatever script you are using, and just set the store credential (temporarily even, if that's all you want) and use a plain text file?
@andyneff I don't have user / pwd credentials but only an OAuth token to access the repo during the build. Of course I could create some service user, store his credentials on the build server and this way access the repository. But speaking about security this would make completely no sense, contrary to temporarily put an OAuth token in the remote.
Notice: there is NO path in that line, just the server
Edit: I was using a "Personal access token" for this. If a build token doesn't work this way, sounds like a VSTS issue, and even if THIS issue was fixed, it wouldn't help.
Also, I'm only testing all of this on my local machine, I was assuming once you get it working locally, the solution can be transferred to your build system
@pascalberger I chatted with Andy offline, we were on different pages. This is a VSTS build server issue (where they execute Git in a special context) as far as I can tell. Things that work on my local machine don't work on the VSTS build server.
Hey all, thanks again for the feedback. I've added this to the list for Git LFS v1.2. Though I really want to get a new release out next week, so it may have to wait for Git LFS v1.3 (unless someone steps up to do it). Here's a comment where I'm discussing next week's release: #844 (comment)
I've been trying to replicate this on master (with help from @technoweenie and @LizzHale) and haven't been able to yet. Here are the tests we wrote showing that it uses the user:pass pair from the url whether it is in the git config for lfs.url or remote.origin.url.
Wondering if you can provide more details to help me replicate this? Or wondering if it got inadvertently fixed in the changes to master since the version the error was reported on?
@andyneff was able to provide me an example that I could check out. Running with GIT_TRACE=1 showed me this:
trace git-lfs: HTTP: POST https://USER:[email protected]/repo.git/info/lfs/objects/batch
trace git-lfs: HTTP: 200
trace git-lfs: HTTP: {"objects":[{"oid":"0000000000000000000000000000000000000000000000000000000000000000","size":1,"_links":{"download":{"href":"https://git-lfs-server.com/repo/info/lfs/objects/0000000000000000000000000000000000000000000000000000000000000000","header":{"Accept":"application/vnd.git-lfs"}}}}]}
trace git-lfs: HTTP:
Username for 'https://git-lfs-server.com':
The LFS client is authenticating https://USER:[email protected]/repo.git/info/lfs/objects/batch properly. However, the LFS server is not returning authenticated urls to the requested objects, like https://git-lfs-server.com/repo/info/lfs/objects/0000000000000000000000000000000000000000000000000000000000000000. This is undesirable, but should be easy enough to fix.
Cool thanks. Sorry for handling this poorly. I thought I knew exactly where the bug was. But if I'd have assumed ignorance and asked up front for debug data (like GIT_TRACE), I'd have solved this really quickly in Dec. A fix will be coming in v1.2 next week.
With git lfs 1.2.0, I'm able to get my scenario working where I have my "oauth" key in .lfsconfig. Are you able to get it working in your scenario of git clone https://user:[email protected]?
What exactly is the work around if you're not on v1.2? I have to support a remote contractor using SourceTree on Windows and they (Atlassian) have not moved SourceTree to v1.2 yet on Windows. This user is not very technical so I'd like to keep it as simple as possible. Their current setup is using their normal GitHub credentials via https and keeps getting the authentication failure when they do a big push with a lot of LFS tracked files up to the remote at the end of the push command.
Where user is their username, pass is their password, blah.com:1234 would be the hostname and port of the external lfs repo, and /pw.txt would be the location for storing their password, in plain text, for all to see, that's why this isn't a great solution ;) But this solution/issue is geared towards more automated procedures (where prompting ONCE was a problem) than dealing with "being asked for a password multiple times", that sounds like the credential helper isn't set up.
If they are using windows, I think the windows credential helper is good at remembering the password after prompting only once.
No the credential helper is not setup as described in that link because like I mentioned the user is using SourceTree and the embedded version of Git/LFS that comes with it. I am trying to keep the user's setup as easy as possible. Also they are not getting prompted for their credentials just the push keeps failing with the credential error and a git lfs pull command will not work due to the same error.
Normal git commands are working and the push appears to be partially working because every time we re-initiate the push the output indicates LFS tracked files that are being skipped because they are presumably already pushed up to the LFS server.
Anyway I am not a Git super user, so how exactly do I find the "would be the hostname and port of the external lfs repo"? Our repository is hosted on GitHub.
@RagtagShawn I don't know anything about SourceTree, but it sounds like you are not using the feature that this issue is about (username AND password in the url). This issue was a "it didn't work at all" kind of thing. You might try the chat room or asking SourceTree for help.
@andyneff You're right it was not exactly the same issue, but it was the same symptoms. I got around it by configuring the user's SourceTree to use the latest versions of Git for Windows and LFS. Not a big deal, but I was hoping to avoid extra installation steps for supporting less technical and remote users. Regardless your replies got me on the right track. Thanks!
I recently ran into this issue, when a few files were added to the GitHub repo that require git-lfs. Previously I'd configured my URL in .git/config to be something like https://<username>@github.com/<organization>/<reponame>.git, which was necessary once I enabled 2FA in GitHub (and I didn't want to jump through the password helper hoops).
The git-lfs URL in the .git/config file looks similar:
But doing a pull returns Error downloading object: <path> (<hash>) for every file in GitHub that was added using LFS.
Running git lfs logs last says:
Git credentials for https://<author>@github.com/<organization>/<reponame>.git not found:
'git credential fill' error: exit status 1
If I put my access token in the URL (so now it's https://<author>:<access token>@github.com/<organization>/<reponame>.git) then I can clone, and it all works. But it's weird that regular git is fine with just my username, but LFS needs my access token.
Finally, after the error, I had to explicitly run git lfs pull to pull down the files that failed during the git pull. Seems like git pull only runs git lfs pull if it has non-LFS files to pull.
Git credentials for https://<author>@github.com/<organization>/<reponame>.git not found:
'git credential fill' error: exit status 1
You can also run GIT_TRACE=1 git pull to get some more details about why your git credential helper didn't work.
EDIT: If you're having credential helper problems, please post a new issue so we can help you out. I've locked this issue since the original request has been fulfilled, and individual requests for help don't need to email everyone else on this thread.
Activity
technoweenie commentedon Dec 20, 2015
Cool, thanks for the report. This is a pretty low priority bug though. Putting authentication info in your git config is a pretty terrible idea, security-wise.
pascalberger commentedon Dec 21, 2015
@technoweenie I'm with you regarding using auth in the config and security. But my use case is that I need to fetch lfs objects on a build server (VSTS). I only have the OAuth token available and therefore temporarily change the remote url to contain the OAuth token to access the repo on the server.
The other option would be to use a dedicated service account only for this and have its credentials stored permanently on the build agent which I think is worse security-wise.
blazespinnaker commentedon Dec 24, 2015
This breaks for me as well. I'm just entering my credentials at the command line. Also, my repo isn't exact super duper secret territory considering it's all open source anyways... I honestly can't imagine why anyone would try to hack it.
whoisj commentedon Dec 25, 2015
Is there a recommended solution to the problem presented?
Is there something the GCM could be providing here?
andyneff commentedon Feb 3, 2016
This breaks for me too... My scenario is less security sketchy though... I have to have a username and password on the lfs server, but I have a "read only" permission account that I actually WANT to be public. That's the username and password in plain text that I want to have in the .lfsconfig file.
Also, I noticed the lfs.url will parse the username only if its supplied but neither if both are supplied. e.g.
Works
For what its worth, my workaround is to set the store credential helper before hand...
[-]Credentials not found using Username / Password in remot[/-][+]Credentials not found using Username / Password in remote[/+]WestonThayer commentedon Feb 11, 2016
@pascalberger were you ever able to get this working?
@andyneff I tried that trick in VSTS to no avail. Are you on VSTS too?
pascalberger commentedon Feb 11, 2016
@WestonThayer No, using a service account for just this is no option for us. Therefor unfortunately no git-lfs for us until this get fixed.
@technoweenie Any chance to have the priority of this increased, since it seems like I'm not the only one with a use case requiring this?
andyneff commentedon Feb 11, 2016
@WestonThayer It should work on VSTS too. (I created an account real quick and tested it in a docker. It DOES work) If you are still having problems, it might be on how your VSTS account is setup (send me a private message on gitter if you want to discuss the VSTS part further).
If you are using a service like VSTS, there is no need to set a custom lfs url, The credential storage will work for the normal git url AND the git lfs url, which will be based off of the same
httpsurl from VSTSIn another scenario where you need to use an external lfs server, keep in mind what the FULL lfs url normally have something AFTER the
*.gitdirectory. This of course could vary from server to server, that's all beyond my scope.For example, a github.com url would be
https://github.com/username/projectname.git, and you can NOT set the lfs.url to the exact same, because that's not the lfs url. The lfs url ishttps://github.com/username/projectname.git/info/lfs.@pascalberger Why can you not use the store credential in your situation? If you have a script on your build server, leave the url untouched in whatever script you are using, and just set the store credential (temporarily even, if that's all you want) and use a plain text file?
pascalberger commentedon Feb 11, 2016
@andyneff I don't have user / pwd credentials but only an OAuth token to access the repo during the build. Of course I could create some service user, store his credentials on the build server and this way access the repository. But speaking about security this would make completely no sense, contrary to temporarily put an OAuth token in the remote.
andyneff commentedon Feb 11, 2016
@pascalberger Used
OAuthis the username, and the<OAuth token>is the password. (Tested, and works)Notice: there is NO path in that line, just the server
Edit: I was using a "Personal access token" for this. If a build token doesn't work this way, sounds like a VSTS issue, and even if THIS issue was fixed, it wouldn't help.
Also, I'm only testing all of this on my local machine, I was assuming once you get it working locally, the solution can be transferred to your build system
WestonThayer commentedon Feb 11, 2016
@pascalberger I chatted with Andy offline, we were on different pages. This is a VSTS build server issue (where they execute Git in a special context) as far as I can tell. Things that work on my local machine don't work on the VSTS build server.
technoweenie commentedon Mar 31, 2016
Hey all, thanks again for the feedback. I've added this to the list for Git LFS v1.2. Though I really want to get a new release out next week, so it may have to wait for Git LFS v1.3 (unless someone steps up to do it). Here's a comment where I'm discussing next week's release: #844 (comment)
jonmagic commentedon Apr 8, 2016
I've been trying to replicate this on master (with help from @technoweenie and @LizzHale) and haven't been able to yet. Here are the tests we wrote showing that it uses the user:pass pair from the url whether it is in the git config for lfs.url or remote.origin.url.
Wondering if you can provide more details to help me replicate this? Or wondering if it got inadvertently fixed in the changes to master since the version the error was reported on?
8 remaining items
technoweenie commentedon Apr 8, 2016
@andyneff was able to provide me an example that I could check out. Running with
GIT_TRACE=1showed me this:The LFS client is authenticating
https://USER:[email protected]/repo.git/info/lfs/objects/batchproperly. However, the LFS server is not returning authenticated urls to the requested objects, likehttps://git-lfs-server.com/repo/info/lfs/objects/0000000000000000000000000000000000000000000000000000000000000000. This is undesirable, but should be easy enough to fix.pascalberger commentedon Apr 8, 2016
And here my
git lfs fetchwith GIT_TRACE=1: https://gist.github.com/pascalberger/093fce9eea909db09968305b486d1083The output is until the first credential dialog appears (if I cancel the credential dialog two others appera until the command exits)
technoweenie commentedon Apr 8, 2016
Cool thanks. Sorry for handling this poorly. I thought I knew exactly where the bug was. But if I'd have assumed ignorance and asked up front for debug data (like
GIT_TRACE), I'd have solved this really quickly in Dec. A fix will be coming in v1.2 next week.andyneff commentedon Apr 20, 2016
@pascalberger @WestonThayer
With git lfs 1.2.0, I'm able to get my scenario working where I have my "oauth" key in .lfsconfig. Are you able to get it working in your scenario of
git clone https://user:[email protected]?foresterre commentedon May 10, 2016
I have the same issue on git lfs 1.2.0 on windows 8.1.
git lfs envandgit config --list:https://gist.github.com/foresterre/1c44f08cff4b31c77e0c8097fb506f04
I enter my credentials on the command line.
andyneff commentedon May 10, 2016
@foresterre If you are supposed to enter your password on the command line is more about not having the password helper working. See here
RagtagShawn commentedon Jun 11, 2016
What exactly is the work around if you're not on v1.2? I have to support a remote contractor using SourceTree on Windows and they (Atlassian) have not moved SourceTree to v1.2 yet on Windows. This user is not very technical so I'd like to keep it as simple as possible. Their current setup is using their normal GitHub credentials via https and keeps getting the authentication failure when they do a big push with a lot of LFS tracked files up to the remote at the end of the push command.
andyneff commentedon Jun 11, 2016
@RagtagShawn The same workaround should still work
Where user is their username, pass is their password,
blah.com:1234would be the hostname and port of the external lfs repo, and/pw.txtwould be the location for storing their password, in plain text, for all to see, that's why this isn't a great solution ;) But this solution/issue is geared towards more automated procedures (where prompting ONCE was a problem) than dealing with "being asked for a password multiple times", that sounds like the credential helper isn't set up.If they are using windows, I think the windows credential helper is good at remembering the password after prompting only once.
RagtagShawn commentedon Jun 11, 2016
@andyneff Thanks for the quick reply.
No the credential helper is not setup as described in that link because like I mentioned the user is using SourceTree and the embedded version of Git/LFS that comes with it. I am trying to keep the user's setup as easy as possible. Also they are not getting prompted for their credentials just the push keeps failing with the credential error and a git lfs pull command will not work due to the same error.
Normal git commands are working and the push appears to be partially working because every time we re-initiate the push the output indicates LFS tracked files that are being skipped because they are presumably already pushed up to the LFS server.
Anyway I am not a Git super user, so how exactly do I find the "would be the hostname and port of the external lfs repo"? Our repository is hosted on GitHub.
andyneff commentedon Jun 11, 2016
@RagtagShawn I don't know anything about SourceTree, but it sounds like you are not using the feature that this issue is about (username AND password in the url). This issue was a "it didn't work at all" kind of thing. You might try the chat room or asking SourceTree for help.
RagtagShawn commentedon Jun 12, 2016
@andyneff You're right it was not exactly the same issue, but it was the same symptoms. I got around it by configuring the user's SourceTree to use the latest versions of Git for Windows and LFS. Not a big deal, but I was hoping to avoid extra installation steps for supporting less technical and remote users. Regardless your replies got me on the right track. Thanks!
kkrugler commentedon Jul 13, 2017
I recently ran into this issue, when a few files were added to the GitHub repo that require git-lfs. Previously I'd configured my URL in
.git/configto be something likehttps://<username>@github.com/<organization>/<reponame>.git, which was necessary once I enabled 2FA in GitHub (and I didn't want to jump through the password helper hoops).The git-lfs URL in the
.git/configfile looks similar:But doing a pull returns
Error downloading object: <path> (<hash>)for every file in GitHub that was added using LFS.Running
git lfs logs lastsays:If I put my access token in the URL (so now it's
https://<author>:<access token>@github.com/<organization>/<reponame>.git) then I can clone, and it all works. But it's weird that regular git is fine with just my username, but LFS needs my access token.Finally, after the error, I had to explicitly run
git lfs pullto pull down the files that failed during thegit pull. Seems likegit pullonly runsgit lfs pullif it has non-LFS files to pull.technoweenie commentedon Jul 14, 2017
That's an error with Git. Maybe you don't have your git credential helper set up properly? Check out https://help.github.com/articles/caching-your-github-password-in-git/ for some help there.
You can also run
GIT_TRACE=1 git pullto get some more details about why your git credential helper didn't work.EDIT: If you're having credential helper problems, please post a new issue so we can help you out. I've locked this issue since the original request has been fulfilled, and individual requests for help don't need to email everyone else on this thread.