Skip to content

Gitversion fails on buildserver #1110

@bradphelan

Description

@bradphelan

I'm not sure what I've done that is wrong but I get the following error when executing gitversion on our JetBrains/TeamCity build server. Note that it has been successfully working for many many months and now I get the following error.

INFO [11/30/16 11:29:15:06] Working directory: C:\TeamCity\buildAgents\tick\work\d081d1700ec3051c
INFO [11/30/16 11:29:15:06] IsDynamicGitRepository: False
INFO [11/30/16 11:29:15:08] Returning Project Root from DotGitDirectory: C:\TeamCity\buildAgents\tick\work\d081d1700ec3051c\.git - C:\TeamCity\buildAgents\tick\work\d081d1700ec3051c
INFO [11/30/16 11:29:15:08] Running on Windows.
INFO [11/30/16 11:29:15:09] IsDynamicGitRepository: False
INFO [11/30/16 11:29:15:09] Returning Project Root from DotGitDirectory: C:\TeamCity\buildAgents\tick\work\d081d1700ec3051c\.git - C:\TeamCity\buildAgents\tick\work\d081d1700ec3051c
INFO [11/30/16 11:29:15:09] Project root is: C:\TeamCity\buildAgents\tick\work\d081d1700ec3051c
INFO [11/30/16 11:29:15:09] DotGit directory is: C:\TeamCity\buildAgents\tick\work\d081d1700ec3051c\.git
INFO [11/30/16 11:29:15:38] IsDynamicGitRepository: False
INFO [11/30/16 11:29:15:38] Returning Project Root from DotGitDirectory: C:\TeamCity\buildAgents\tick\work\d081d1700ec3051c\.git - C:\TeamCity\buildAgents\tick\work\d081d1700ec3051c
INFO [11/30/16 11:29:15:46] Begin: Loading version variables from disk cache
  INFO [11/30/16 11:29:15:46] Cache file C:\TeamCity\buildAgents\tick\work\d081d1700ec3051c\.git\gitversion_cache\5020CB3AA41BC19FFF2C74769B9422012AB50B43.yml not found.
INFO [11/30/16 11:29:15:46] End: Loading version variables from disk cache (Took: 1.00ms)
INFO [11/30/16 11:29:15:46] IsDynamicGitRepository: False
INFO [11/30/16 11:29:15:46] Returning Project Root from DotGitDirectory: C:\TeamCity\buildAgents\tick\work\d081d1700ec3051c\.git - C:\TeamCity\buildAgents\tick\work\d081d1700ec3051c
INFO [11/30/16 11:29:15:60] Using latest commit on specified branch
INFO [11/30/16 11:29:15:61] Begin: Attempting to inherit branch configuration from parent branch
  INFO [11/30/16 11:29:15:67] Begin: Finding branch source
  INFO [11/30/16 11:29:15:69] End: Finding branch source (Took: 20.00ms)
  INFO [11/30/16 11:29:15:69] Begin: Getting branches containing the commit 'd12819d6d76f520cccbef21421b80096d8d8fadb'.
    INFO [11/30/16 11:29:15:69] Trying to find direct branches.
    INFO [11/30/16 11:29:15:69] No direct branches found, searching through tracked branches.
  INFO [11/30/16 11:29:15:69] End: Getting branches containing the commit 'd12819d6d76f520cccbef21421b80096d8d8fadb'. (Took: 0.00ms)
  INFO [11/30/16 11:29:15:69] Found possible parent branches: 
INFO [11/30/16 11:29:15:71] End: Attempting to inherit branch configuration from parent branch (Took: 103.99ms)
ERROR [11/30/16 11:29:15:71] An unexpected error occurred:
System.InvalidOperationException: Could not find a 'develop' or 'master' branch, neither locally nor remotely.
   at GitVersion.BranchConfigurationCalculator.InheritBranchConfiguration(Boolean onlyEvaluateTrackedBranches, IRepository repository, Commit currentCommit, Branch currentBranch, KeyValuePair`2 keyValuePair, BranchConfig branchConfiguration, Config config, IList`1 excludedInheritBranches)
   at GitVersion.BranchConfigurationCalculator.GetBranchConfiguration(Commit currentCommit, IRepository repository, Boolean onlyEvaluateTrackedBranches, Config config, Branch currentBranch, IList`1 excludedInheritBranches)
   at GitVersion.GitVersionContext.CalculateEffectiveConfiguration()
   at GitVersion.GitVersionContext..ctor(IRepository repository, Branch currentBranch, Config configuration, Boolean onlyEvaluateTrackedBranches, String commitId)
   at GitVersion.ExecuteCore.<>c__DisplayClass6_0.<ExecuteInternal>b__0(IRepository repo)
   at GitVersion.GitPreparer.WithRepository[TResult](Func`2 action)
   at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig)
   at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem)
   at GitVersion.Program.VerifyArgumentsAndRun()
INFO [11/30/16 11:29:15:71] 
INFO [11/30/16 11:29:15:71] Attempting to show the current git graph (please include in issue): 
INFO [11/30/16 11:29:15:71] Showing max of 100 commits
INFO [11/30/16 11:29:15:87] * d12819d 86 minutes ago  (HEAD -> feature/upgrade-nuget-packages, origin/feature/upgrade-nuget-packages)
* 914a542 17 hours ago 
* ec00b24 18 hours ago 
* 543e2f0 18 hours ago 
* 5b1f805 19 hours ago 
* 4d55683 20 hours ago 
* b47f3ea 20 hours ago 
* f42d28e 20 hours ago 
* 909b92c 23 hours ago 
* b0d8223 23 hours ago 
*   9f9974c 24 hours ago  (tag: v1.2.0-unstable.2+5, tag: v1.2.0-unstable.2)
|\  
| * 0329f5a 24 hours ago 
| * c44588b 25 hours ago 
| * 53b14f9 25 hours ago 
|/  
* d8395c3 35 hours ago  (tag: v1.2.0-unstable.1+1)
* 697d12f 2 days ago  (tag: v1.1.0-unstable.2+4, tag: 1.1.0)
* 56cb853 2 days ago 
* b9905b6 2 days ago 
* 7650c71 5 days ago  (tag: v1.1.0-unstable.1+1)
* 6a63d4b 5 days ago  (tag: v1.0.0+2, tag: v0.11.0-unstable.12+37)
* 4a9038e 5 days ago 
*   e91b01d 6 days ago  (tag: v0.11.0-unstable.11+35)
|\  
| * c6c95de 6 days ago 
| * 006a25e 6 days ago 
| * ed6c8ce 6 days ago 
| * 163766d 6 days ago 
| * 2e5d621 6 days ago 
| * 44e639e 6 days ago 
| * 3cecfc5 6 days ago 
|/  
* d8fc111 6 days ago  (tag: v0.11.0-unstable.10+27)
* 748aa07 6 days ago 
* d91a189 6 days ago  (tag: v0.11.0-unstable.9+25)
* af0a1a2 6 days ago 
* cc20557 6 days ago 
* 98133ed 6 days ago  (tag: v0.11.0-unstable.8+22)
* d92783c 7 days ago 
* 22313ba 7 days ago 
* 21614ec 7 days ago  (tag: v0.11.0-unstable.7+19)
* c02dbc7 7 days ago  (tag: v0.11.0-unstable.6+18)
* 0dd94a5 8 days ago 
* 9aca473 8 days ago 
* a511945 8 days ago 
* 733d961 9 days ago  (tag: v0.11.0-unstable.5+14)
* d3b6f78 9 days ago 
* 1c30334 9 days ago 
* cdae6c8 9 days ago 
* 2a34f9f 9 days ago 
* 0cbd090 13 days ago  (tag: v0.11.0-unstable.4+9)
*   c0ef43d 13 days ago 
|\  
| * 811d40b 13 days ago 
| * 5b9e188 13 days ago 
|/  
* 76b4bde 13 days ago  (tag: v0.11.0-unstable.3+5)
* 0512138 13 days ago  (tag: v0.11.0-unstable.3+4)
* c0a14a9 13 days ago 
* f610b76 13 days ago  (tag: v0.11.0-unstable.2+2)
* 03d4039 13 days ago  (tag: v0.11.0-unstable.1+1)
* aa2044e 2 weeks ago  (tag: v0.10.0)
* 245f0cf 2 weeks ago  (tag: v0.9.0-unstable.67+3)
* 9de3eb8 2 weeks ago 
* 5b676f0 2 weeks ago  (tag: v0.9.0-unstable.66+5)
* 76dc637 2 weeks ago  (tag: v0.9.0-unstable.66+4)
* acc74b7 2 weeks ago 
* f911441 2 weeks ago 
* 390f9a1 2 weeks ago 
* 7b43f48 2 weeks ago  (tag: v0.9.0-unstable.65+2)
* bc7131d 2 weeks ago 
* bea49ca 2 weeks ago  (tag: v0.9.0-unstable.64+39)
* 743cd7b 2 weeks ago 
* 2cdeb75 3 weeks ago 
*   e22dcca 3 weeks ago 
|\  
| * 0585927 3 weeks ago 
| * bde3d3b 3 weeks ago 
| * 557ef6a 3 weeks ago 
| * b03d69e 3 weeks ago 
| * 1abaf07 3 weeks ago 
| * a8209ac 3 weeks ago 
| * cdf9108 3 weeks ago 
| * 719a9fc 3 weeks ago 
| * 2dcfa73 3 weeks ago 
| * 055b69b 3 weeks ago 
| * 73638bd 3 weeks ago 
| * 761fb51 3 weeks ago 
| * 0fbc414 3 weeks ago 
| * e14a530 3 weeks ago 
| * 00c6a4e 3 weeks ago 
| * fbc065c 3 weeks ago 
| * c6e7432 3 weeks ago 
|/  
* 261e66a 3 weeks ago 
* a106796 3 weeks ago 
* 6479716 3 weeks ago 
* b409856 3 weeks ago 
* b19b5b2 3 weeks ago 
* aefadcc 3 weeks ago 
* 48fcbeb 3 weeks ago 
* be0839f 3 weeks ago 
* a1c9d86 3 weeks ago 
* 3c3de07 3 weeks ago 
* e721a3c 3 weeks ago 
* 40dfbb1 3 weeks ago 
* 7a4d71d 3 weeks ago 

but on exactly the same checkout on my dev machine I get


C:\Users\phelan\workspace\WeinCAD.NET [feature/upgrade-nuget-packages ≡]> gitversion
{
  "Major":1,
  "Minor":2,
  "Patch":0,
  "PreReleaseTag":"upgrade-nuget-packages.1",
  "PreReleaseTagWithDash":"-upgrade-nuget-packages.1",
  "PreReleaseLabel":"upgrade-nuget-packages",
  "PreReleaseNumber":1,
  "BuildMetaData":15,
  "BuildMetaDataPadded":"0015",
  "FullBuildMetaData":"15.Branch.feature/upgrade-nuget-packages.Sha.d12819d6d76f520cccbef21421b80096d8d8fadb",
  "MajorMinorPatch":"1.2.0",
  "SemVer":"1.2.0-upgrade-nuget-packages.1",
  "LegacySemVer":"1.2.0-upgrade-nuget-packa1",
  "LegacySemVerPadded":"1.2.0-upgrade-nuget-pa0001",
  "AssemblySemVer":"1.2.0.0",
  "FullSemVer":"1.2.0-upgrade-nuget-packages.1+15",
  "InformationalVersion":"1.2.0-upgrade-nuget-packages.1+15.Branch.feature/upgrade-nuget-packages.Sha.d12819d6d76f520cccbef21421b80096d8d8fadb",
  "BranchName":"feature/upgrade-nuget-packages",
  "Sha":"d12819d6d76f520cccbef21421b80096d8d8fadb",
  "NuGetVersionV2":"1.2.0-upgrade-nuget-pa0001",
  "NuGetVersion":"1.2.0-upgrade-nuget-pa0001",
  "CommitsSinceVersionSource":15,
  "CommitsSinceVersionSourcePadded":"0015",
  "CommitDate":"2016-11-30"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions