Reputation: 1843
I've created a build in TeamCity for a project which uses GitVersion to manage versioning. When I attempt to have TeamCity run the build it fails showing the following error in the build log:
An unexpected error occured:
LibGit2Sharp.LibGit2SharpException: authentication required but no callback set
I have tried searching google for the LibGit2Sharp error, but find only a couple of closed bug reports with no details how they were able to work around the error.
Upvotes: 0
Views: 550
Reputation: 1843
After setting up the build's artifacts to capture the log output GitVersion was generating, the following message was found:
TeamCity doesn't make the current branch available through environmental variables.
Depending on your authentication and transport setup of your git VCS root things
may work. In that case, ignore this warning.
In your TeamCity build configuration, add a parameter called `env.Git_Branch` with
value %teamcity.build.vcs.branch.<vcsid>%
See http://gitversion.readthedocs.org/en/latest/build-server-support/build-server/teamcity
for more info
By setting the env.Git_Branch parameter to the %teamcity.build.vcs.branch.% value, GitVersion started working. This should have been a straightforward solution, but because the logs were not being captured and search results for the error message were unsuccessful, I've decided to post this answer to help others who may encounter this problem.
Upvotes: 1