LFS: Git credentials for..XXXX..not found. Your user name must be of the form DOMAIN\user - atlassian-sourcetree

So we are trying to setup GIT LFS with on premises TFS and we are having a couple of errors. The errors and setup are described below:
Setup:
1) On-premises TFS 2017 w/Update 1
2) Visual Studio 2015 w/Update 3
3) Atlassian SourceTree (Git Client)
4) GIT LFS is installed on the developer's system
5) The Git Credential Manager for Windows (GCM)
Errors:
Going to Tools->Options->[Git Tab] in SourceTree and selecting [Use System Git] and trying to checkout a version of the file from history results in the following error:
git-lfs/2.0.1 (GitHub; windows amd64; go 1.8; git 678cdbd4) git
version 2.12.1.windows.1
$ git-lfs.exe filter-process Error downloading object: Framework4.dll
(ef57f778c9fd50b27144784cd1df55b1b014d564ad6d8d726b156748219b8e5f)
Smudge error: Error downloading Framework4.dll
(ef57f778c9fd50b27144784cd1df55b1b014d564ad6d8d726b156748219b8e5f):
batch response: Your user name must be of the form DOMAIN\user. It is
currently USR123
Going to Tools->Options->[Git Tab] in SourceTree and selecting [Use Embedded Git] and trying to checkout a version of the file from history results in the following error:
git-lfs/1.5.2 (GitHub; windows 386; go 1.7.3; git 547a06aa) git
version 2.10.2.windows.1
$ git-lfs.exe smudge -- Framework4.dll Error downloading object:
Framework4.dll
(ef57f778c9fd50b27144784cd1df55b1b014d564ad6d8d726b156748219b8e5f)
Smudge error: Error downloading
ef57f778c9fd50b27144784cd1df55b1b014d564ad6d8d726b156748219b8e5f: LFS:
Git credentials for
http://localhost:8080/tfs/DefaultCollection/Common/_git/Common%20References
not found.: LFS: Git credentials for
http://localhost:8080/tfs/DefaultCollection/Common/_git/Common%20References
not found.
What I have researched and tried:
Folks recommended using "The Git Credential Manager for Windows (GCM)" to store and manage credentials. This was installed with the latest git version. But the errors still persists.
Tried it without having installed "The Git Credential Manager for Windows (GCM)" still the error happens.
Updated Git versions to the latest. Tried git-lfs/1.5.2 and git-lfs/2.0.1. But no go.
Additional error info on the Environment:
ENV:
LocalWorkingDir=C:\Users\USR123\Documents\GitCloneTest\Common\References2
LocalGitDir=C:\Users\USR123\Documents\GitCloneTest\Common\References2.git
LocalGitStorageDir=C:\Users\USR123\Documents\GitCloneTest\Common\References2.git
LocalMediaDir=C:\Users\USR123\Documents\GitCloneTest\Common\References2.git\lfs\objects
LocalReferenceDir=
TempDir=C:\Users\USR123\Documents\GitCloneTest\Common\References2.git\lfs\tmp
ConcurrentTransfers=1 TusTransfers=false BasicTransfersOnly=false
BatchTransfer=true SkipDownloadErrors=false FetchRecentAlways=false
FetchRecentRefsDays=7 FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true PruneOffsetDays=3
PruneVerifyRemoteAlways=false PruneRemoteName=origin
AccessDownload=ntlm AccessUpload=ntlm DownloadTransfers=basic
UploadTransfers=basic GIT_CONFIG_PARAMETERS='color.branch=false'
'color.diff=false' 'color.status=false' 'diff.mnemonicprefix=false'
'core.quotepath=false' GIT_DIR=.git GIT_LFS_PATH=C:\Program Files\Git
LFS GIT_PAGER=cat GIT_PREFIX=
Any ideas on how to fix the credential / authentication errors above?
Thank you.

This error comes from LFS extension if you have logged in to TFS without specifying domain name, and you are trying to push a large file.
Go to Control Panel\User Accounts\Credential Manager, Windows Credentials tab and remove credentials stored for TFS server.
When you git push again from command line, you will be prompted for your credentials. Specify your user name with the domain: DOMAIN\USER

Since version 2.4.0 Git-Lfs comes with NTLM support. With this you no longer need to use the basic authentication fallback by setting the credentials in the Windows Credential Manager and Git-Lfs should work out of the box with TFS on-prem.

Related

Team Foundation Server - Eclipse and Cross Platform: Unable to clone Git repository using TEE in Eclipse. Error cloning - Not Authorized

I have TFS 2018.2 and Eclipse IDE for Enterprise Java Developers Version 2019-06 (4.12.0). In eclipse I have installed Team Explorer Everywhere plugin and I am able to see all my Git repository however when I try to clone a git repository using the administrator account in TFS I get below error:
Error cloning the <GitName> repository.
http://../..//<GitName>: not authorized.
Clone Error:
Eclipse Version:
Reference Document
In case if the question is placed in the wrong forum path feel free to correct it.
I have tried the resolution provided in https://github.com/microsoft/team-explorer-everywhere#frequently-asked-questions-faq
Also, tried installing latest versions of Egit in Eclipse - https://download.eclipse.org/egit/updates/
I am not sure how to use the older version of Egit to try the import of repository. I seem to have latest version of Egit.
UPDATE:
Apparently I am able to resolve the issue by following below steps:
And creating a Git repository from File menu and then utilizing the 'Copy clone URL' from the first image. Select the newly created repository and perform right click on it to select 'Paste repository path or url' which would ask for authentication and repo would be copied.
However the action items have carried TFS to run into issues:
and
According to your description, I'm afraid you are in the wrong direction to fix this issue.
Your error actually is "not authorized" which is not Authentication not supported. There are totally different issues. Instead of digging into that QA, you should try to figure out why it's not authorized for MyGit repository.
First give a try to use Eclipse with version 4.2 to 4.6 instead of latest according to official link of team-explorer-everywhere.
Supported on Linux, Mac OS X, and Windows. Compatible with IDEs that
are based on Eclipse 4.2 to 4.6.
Besides follow below steps to narrow down the issue:
You should also use git command line by using the administrator
account in TFS and check if you are able to use it to connect/clone
MyGit repository which hosted by TFS server.
Check if your Eclipse can connect to and clone library from any
GitHub repo correctly.
Update or delete cached credentials from Control Panel ->
Credential Manager -> Generic Credentials the password for
git:http://ServerName:xx/

Git bash win32exception: Failed to write credentials

I've recently started using GitHub but for some reason every time I attempt to pull or push it asks for my credentials. I'm 100% sure I have my credentials correct but git bash keeps giving this error:
fatal: Win32Exception encountered.
Failed to write credentials
I don't know why but it does work every time I reinstall git bash up until my next reboot.
Please ask for any information you might need because I'm still quite unfamiliar with git.
Check if you have set a credential helper with git config -l|grep credential
On Windows, you should make sure you have:
git config --global credential.helper manager
With recent Git for Windows, that does use the Microsoft Git Credential Manager, linked to the Credential Manager in Windows.

Internal error while accessing GIT repository from RSA 9.1 using TFS plug-in

I am able to connect to GIT server from RSA 9.1 using the TFS plugin.However, while accessing the Git repositories, I am getting the following internal error:
An internal error occurred during: "Loading section 'All
Repositories'". org/eclipse/egit/core/Activator "
Any idea what am I missing?
You can get a local clone of the remote repository and then import the repository
Or you can host your remote repository in TFS, then manually configured in EGit. Once this connection is established, you can use the EGit tools to perform basically any Git function, like committing, pushing, and creating new branches.
Details refer the 'Integration with Eclipse EGit tools' in this blog.
And you can download egit from here.

Unable to integrate Github with Pycharm

I have created a repository on Github. I am using Windows 7 64 bit and Pycharm Community edition. I want to integrate the Github repository with pycharm but I am getting the error
Couldn't get the list of GitHub repositories
Connect to api.github.com:443 [api.github.com/192.30.252.127] failed: connect timed out
Although I am able to clone he same repository from command prompt using git clone command.
I had the same issue.
Configure your proxy if using one:
File->Settings->System Settings->HTTP Proxy
Another thing to try is to clone the project locally then add as new project in Pycharm. Afterwards I was able to do all git operations under VCS->git including add/commit/push for my project.
try to check whether you have given the path to Git executable correctly by testing it using test button next to it...(file>settings>version control>Git>path to Git Executable)
make sure you have given the git client path correctly..
C:\Program Files\Git\cmd\git.exe

Github Integration with Hudson CI

What I have done so far:
Deployed a tomcat6.0 server to c:\www
Downloaded and deployed the Hudson.war in the c:\www\webapps folder
Installed the Github plugin
Created a private repository on Github
On the server, with hudson installed, generated ssh keys.
Environment variable %HOME% is set to c:\Documents and settings[username] (there is a .ssh directory in there with the keys)
Environment variable %HUDSON_HOME% set to c:\www\webapps\hudson
In hudson I have the following configurations:
Github Project: https://github.com/[my organization]/[project name]
Source Code Management: Git
URL of Repository: git#github.com:[my organization]/[project name].git
Branch specifier: **
Repository Browser: (Auto)
When I run a build, and click the console output link I see this --
Started by user anonymous
Checkout:workspace / C:\www\webapps\hudson\jobs\[project name] (git)\workspace - hudson.remoting.LocalChannel#2e8f6d20
Using strategy: Default
Checkout:workspace / C:\www\webapps\hudson\jobs\[project name] (git)\workspace - hudson.remoting.LocalChannel#2e8f6d20
Fetching changes from the remote Git repository
Fetching upstream changes from git#github.com:[organization name]/[project name].git
... at which point it hangs. When I cancel the build, the following are added --
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
ERROR: (Underlying report) : Error performing command: git.exe fetch -t git#github.com:[organization name]/[project name].git +refs/heads/*:refs/remotes/origin/*
null
ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository
hudson.plugins.git.GitException: Could not fetch from any repository
at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:796)
at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:754)
at hudson.FilePath.act(FilePath.java:756)
at hudson.FilePath.act(FilePath.java:738)
at hudson.plugins.git.GitSCM.gerRevisionToBuild(GitSCM.java:754)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:540)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1180)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:506)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:422)
at hudson.model.Run.run(Run.java:1362)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:145)
First off, since you are starting off with a new CI instance, I would highly recommend that you install the Jenkins fork instead (since it is actively maintained by most of the original developers of Hudson).
Secondly, install the DumpInfo Wrapper plugin and re-run the build again. This plugin prints the system properties and environmental variables in effect during the build and allows you to verify them.
Update:
That plugin should log the system properties and environmental variables, I am surprised you do not see them. As for the passphrase, I suggest you generate a separate private key (from your existing pair) that is not passphrase-protected instead, otherwise you may need to consider the solution offered for: Why git can't remember my passphrase under Windows. I have verified that it works (when I set up my own CI on windows) but I don't feel it is worth the trouble (there are other nuances including installing and running the tomcat instance as the currently logged in user, and NOT as local service, so that pageant will work with it properly), hence I would recommend the first option.
In my case it turned out to be the problem with Git client: I was using v1.6.0 which was triggering
fatal: https://github.com/dmak/jaxb-xew-plugin.git/info/refs download error - The requested URL returned error: 403
error message in Hudson. First it looked like this issue, but strace analysis of git run shown that is was Nginx WebServer (which GitHub is running on) returning 403, not the proxy.
When I've updated to v1.7.3 the problem was gone. So general advise: don't use old clients with GitHub.
P.S. I have tested the cloning both with "Branch Specifier (blank for default): origin/master" in Hudson job configuration and also with blank (default): in both cases Git was able to discover the master branch (origin/master) correctly and used it for cloning.