Exception in PerformPreProcessingSteps for 'TeamCity'
Hi, i am testing GitVersion on TeamCity. My repo is connected via ssh ([email protected]:repo.name) I have enabled Agent-Checkout (working) and added the powershell-build-step with git pull master etc. from your readme.md (works, but only when agent is running under my account, not under SYSTEM-service).
So far so good... i get the following Exception with Version 0.20.0 (and previous versions). The Exception occurs in GitHelper.NormalizeGitDirectory(gitDirectory);
When commented out and and compiled to my own version everything works, the Build-Numbers are as expected...
Is this part really necessary or could you remove it in case the pull master-branch operation is already processed?
Thanks, Henning
[UpdateAssemblyInfo] WriteVersionInfoToBuildLog
[09:27:11][WriteVersionInfoToBuildLog] Applicable build agent found: 'TeamCity'.
[09:27:11][WriteVersionInfoToBuildLog] Executing PerformPreProcessingSteps for 'TeamCity'.
[09:27:11][WriteVersionInfoToBuildLog] One remote found (origin -> '[email protected]:test.repo').
[09:27:11][WriteVersionInfoToBuildLog] Fetching from remote 'origin' using the following refspecs: +refs/heads/*:refs/remotes/origin/*.
[09:27:11][WriteVersionInfoToBuildLog] Error occurred: LibGit2Sharp.LibGit2SharpException: An error was raised by libgit2. Category = Net (Error). This transport isn't implemented. Sorry
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
at LibGit2Sharp.Core.Proxy.git_remote_connect(RemoteSafeHandle remote, GitDirection direction)
at LibGit2Sharp.Network.DoFetch(RemoteSafeHandle remoteHandle, FetchOptions options) at LibGit2Sharp.Network.Fetch(Remote remote, FetchOptions options)
at GitVersion.GitHelper.NormalizeGitDirectory(String gitDirectory) in c:\BuildAgent\work\5e0d79a4e3943b17\GitVersion\BuildServers\GitHelper.cs:line 19
at GitVersion.TeamCity.PerformPreProcessingSteps(String gitDirectory) in c:\BuildAgent\work\5e0d79a4e3943b17\GitVersion\BuildServers\TeamCity.cs:line 19
at GitVersionTask.VersionAndBranchFinder.TryGetVersion(String directory, VersionAndBranchAndDate& versionAndBranch) in c:\BuildAgent\work\5e0d79a4e3943b17\GitVersionTask\VersionAndBranchFinder.cs:line 27
at GitVersionTask.WriteVersionInfoToBuildLog.InnerExecute() in c:\BuildAgent\work\5e0d79a4e3943b17\GitVersionTask\WriteVersionInfoToBuildLog.cs:line 51
at GitVersionTask.WriteVersionInfoToBuildLog.Execute() in c:\BuildAgent\work\5e0d79a4e3943b17\GitVersionTask\WriteVersionInfoToBuildLog.cs:line 29
@henning-me LibGit2Sharp doesn't currently support ssh. See https://github.com/Particular/GitVersion/issues/38#issuecomment-28974459 and https://github.com/libgit2/libgit2sharp/issues/255 for more information about this lack of feature
Thanks for the fast reply.
I work around that (no support for ssh) issue by adding the build-step with pull master etc. and wonder if i can disable the (in this case no longer needed?) NormalizeGitDirectory step in GitVersion other then by forking and creating "my own package with this line commented out"?
i used to have exactly the same problem - we use ssh to connect to GH.
what worked perfectly for me (and i now don't need a build step for "get master branch") was to change to using git protocol rather than ssh.
eg git://my.selfhosted.github.url/Organisation/Repo.git
To be honest, don't quite know how that works - but it does. And it makes it a lot cleaner not having that "get master" build step.
git:// read-only protocol is indeed supported, such as http(s)
Closing, this is now in https://github.com/Particular/GitVersion/wiki/FAQ