Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] LibGit2Sharp.LibGit2SharpException: this remote has never connected after updating to 5.10.0 #3082

Closed
IBlackI opened this issue Apr 14, 2022 · 18 comments · Fixed by #3085
Labels
Milestone

Comments

@IBlackI
Copy link

IBlackI commented Apr 14, 2022

Describe the bug
Gitversion execute throws a LibGit2Sharp.LibGit2SharpException after updating to version 5.10.0

Expected Behavior

GitVersion should be able to determine the correct version as when it was running 5.9.0
Logs have been stripped of sensitive information, and shortened.
Logs with 5.9.0:

2022-04-14T09:21:18.0677229Z ##[section]Starting: gitversionexecute
2022-04-14T09:21:18.0965352Z ==============================================================================
2022-04-14T09:21:18.0965732Z Task         : Execute GitVersion Task
2022-04-14T09:21:18.0966103Z Description  : Easy Semantic Versioning (http://semver.org) for projects using Git
2022-04-14T09:21:18.0966404Z Version      : 0.9.13
2022-04-14T09:21:18.0966648Z Author       : GitTools Contributors
2022-04-14T09:21:18.0966978Z Help         : See the [documentation](https://gitversion.net/docs/) for help
2022-04-14T09:21:18.0967577Z ==============================================================================
2022-04-14T09:21:18.5580529Z Command: dotnet-gitversion D:/a/1/s /output json /output buildserver /config D:\a\1\s\build\GitVersion.yml
2022-04-14T09:21:18.5623256Z [command]C:\hostedtoolcache\windows\GitVersion.Tool\5.9.0\x64\dotnet-gitversion.exe D:/a/1/s /output json /output buildserver /config D:\a\1\s\build\GitVersion.yml
2022-04-14T09:21:28.1605223Z INFO [04/14/22 9:21:19:05] Working directory: D:/a/1/s
2022-04-14T09:21:28.1606662Z INFO [04/14/22 9:21:19:16] Branch from build environment: refs/pull/12445/merge
2022-04-14T09:21:28.1607933Z INFO [04/14/22 9:21:19:17] Project root is: D:\a\1\s\
2022-04-14T09:21:28.1609543Z INFO [04/14/22 9:21:19:17] DotGit directory is: D:\a\1\s\.git
2022-04-14T09:21:28.1610670Z INFO [04/14/22 9:21:19:17] Begin: Normalizing git directory for branch 'refs/pull/12445/merge'
2022-04-14T09:21:28.1611984Z   INFO [04/14/22 9:21:19:24] One remote found (origin -> '[...]').
2022-04-14T09:21:28.1614509Z   INFO [04/14/22 9:21:19:24] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
2022-04-14T09:21:28.1615774Z   INFO [04/14/22 9:21:19:30] Creating local branch pull/12445/merge pointing at fab9373
[...]
2022-04-14T09:21:28.1990579Z   INFO [04/14/22 9:21:24:91] End: Normalizing git directory for branch 'refs/pull/12445/merge' (Took: 5,747.49ms)
2022-04-14T09:21:28.1991126Z   INFO [04/14/22 9:21:24:98] Begin: Loading version variables from disk cache
2022-04-14T09:21:28.1991687Z     INFO [04/14/22 9:21:24:98] Cache file D:\a\1\s\.git\gitversion_cache\9DC0FE0AB47F761F12F81760D7026923B4CCFFB9.yml not found.
2022-04-14T09:21:28.1992428Z   INFO [04/14/22 9:21:24:98] End: Loading version variables from disk cache (Took: 0.85ms)
2022-04-14T09:21:28.1992895Z   INFO [04/14/22 9:21:24:98] Using latest commit on specified branch
2022-04-14T09:21:28.1993398Z   INFO [04/14/22 9:21:25:19] Begin: Attempting to inherit branch configuration from parent branch
2022-04-14T09:21:28.1995754Z     INFO [04/14/22 9:21:25:25] HEAD is merge commit, this is likely a pull request using [...] as base
2022-04-14T09:21:28.1997439Z     INFO [04/14/22 9:21:25:39] Begin: Finding branch source of '[...]'
2022-04-14T09:21:28.1998094Z       INFO [04/14/22 9:21:25:45] Begin: Finding merge base between '[...]' and 'master'.
2022-04-14T09:21:28.1998716Z         INFO [04/14/22 9:21:25:47] Found merge base of d78db61 [...]
2022-04-14T09:21:28.1999447Z         INFO [04/14/22 9:21:25:48] Merge base of [...]' and 'master is d78db61 [...]
2022-04-14T09:21:28.2000414Z       INFO [04/14/22 9:21:25:48] End: Finding merge base between '[...]' and 'master'. (Took: 27.92ms)
2022-04-14T09:21:28.2001126Z       INFO [04/14/22 9:21:25:49] Begin: Finding merge base between '[...]' and 'origin/master'.
2022-04-14T09:21:28.2001815Z         INFO [04/14/22 9:21:25:49] Found merge base of d78db61 [...]
2022-04-14T09:21:28.2002702Z         INFO [04/14/22 9:21:25:49] Merge base of [...]' and 'origin/master is d78db61 [...]
2022-04-14T09:21:28.2003686Z       INFO [04/14/22 9:21:25:49] End: Finding merge base between '[...]' and 'origin/master'. (Took: 0.64ms)
2022-04-14T09:21:28.2004900Z       INFO [04/14/22 9:21:25:50] Multiple source branches have been found, picking the first one (master).
2022-04-14T09:21:28.2005398Z This may result in incorrect commit counting.
2022-04-14T09:21:28.2005727Z Options were:
2022-04-14T09:21:28.2005988Z master, origin/master
[...]
2022-04-14T09:21:28.2050707Z       INFO [04/14/22 9:21:26:75] Searching for commits reachable from 'master'.
2022-04-14T09:21:28.2051181Z       INFO [04/14/22 9:21:26:82] The branch 'master' has no matching commits.
2022-04-14T09:21:28.2051755Z       INFO [04/14/22 9:21:26:82] Searching for commits reachable from [...].
2022-04-14T09:21:28.2052408Z       INFO [04/14/22 9:21:26:88] The branch [...] has no matching commits.
2022-04-14T09:21:28.2053007Z     INFO [04/14/22 9:21:26:88] End: Getting branches containing the commit 'fab9373'. (Took: 704.73ms)
2022-04-14T09:21:28.2054115Z     INFO [04/14/22 9:21:26:88] Found possible parent branches: master, [...]
2022-04-14T09:21:28.2054980Z     WARN [04/14/22 9:21:26:92] Failed to inherit Increment branch configuration, ended up with: master, [...]
2022-04-14T09:21:28.2055579Z Falling back to Development branch config
2022-04-14T09:21:28.2056107Z   INFO [04/14/22 9:21:26:92] End: Attempting to inherit branch configuration from parent branch (Took: 1,729.32ms)
2022-04-14T09:21:28.2057336Z   INFO [04/14/22 9:21:27:01] Running against branch: pull/12445/merge (fab9373 Merge pull request 12445 from [....] into Development)
2022-04-14T09:21:28.2057955Z   INFO [04/14/22 9:21:27:02] Begin: Calculating base versions
2022-04-14T09:21:28.2058479Z     INFO [04/14/22 9:21:27:12] Fallback base version: 0.1.0 with commit count source 43158424297dcf0be336cfd91647d4e2af0afa85
2022-04-14T09:21:28.2059214Z     INFO [04/14/22 9:21:27:44] Git tag '0.1.142': 0.1.142 with commit count source 173a7c10e86a5bce424d21c56e20153df8c06941
2022-04-14T09:21:28.2059931Z     INFO [04/14/22 9:21:27:72] Found multiple base versions which will produce the same SemVer (0.2.0), taking oldest source for commit counting (Git tag '0.1.142')
2022-04-14T09:21:28.2060654Z     INFO [04/14/22 9:21:27:72] Base version used: Git tag '0.1.142': 0.1.142 with commit count source 173a7c10e86a5bce424d21c56e20153df8c06941
2022-04-14T09:21:28.2061259Z   INFO [04/14/22 9:21:27:72] End: Calculating base versions (Took: 708.63ms)
2022-04-14T09:21:28.2062055Z   INFO [04/14/22 9:21:27:72] 2 commits found between 173a7c1 Merge remote-tracking branch 'origin/Development' into [...] and fab9373 Merge pull request 12445 from [...] into Development
2022-04-14T09:21:28.2062901Z   INFO [04/14/22 9:21:27:73] Begin: Using mainline development mode to calculate current version
[...]
2022-04-14T09:21:28.2988718Z     INFO [04/14/22 9:21:27:82] '(^master$|^origin\/master$|^main$|^origin\/main$)' does not match '12445/merge'.
2022-04-14T09:21:28.2989215Z     INFO [04/14/22 9:21:27:82] '^support[/-]' does not match '12445/merge'.
2022-04-14T09:21:28.2989682Z     INFO [04/14/22 9:21:27:82] Found possible mainline branches: master, origin/master
2022-04-14T09:21:28.2990307Z     INFO [04/14/22 9:21:27:85] Multiple mainlines (master, origin/master) have the same merge base for the current branch, choosing master because we found that branch first...
2022-04-14T09:21:28.2991035Z     INFO [04/14/22 9:21:27:86] Current branch (pull/12445/merge) was branch from d78db61 Merged PR 12440: [...]
2022-04-14T09:21:28.2992538Z     INFO [04/14/22 9:21:27:86] 12 commits found between d78db61 Merged PR 12440: [...] and fab9373 [...] into Development
2022-04-14T09:21:28.2993535Z     INFO [04/14/22 9:21:27:86] Performing Patch increment for current branch 
2022-04-14T09:21:28.2996311Z   INFO [04/14/22 9:21:27:86] End: Using mainline development mode to calculate current version (Took: 131.57ms)
2022-04-14T09:21:28.2996897Z   INFO [04/14/22 9:21:27:86] Begin: Getting version tags from branch 'refs/heads/pull/12445/merge'.
2022-04-14T09:21:28.2997502Z   INFO [04/14/22 9:21:27:94] End: Getting version tags from branch 'refs/heads/pull/12445/merge'. (Took: 77.46ms)
2022-04-14T09:21:28.2999938Z   INFO [04/14/22 9:21:27:96] Begin: Creating dictionary
2022-04-14T09:21:28.3000440Z   INFO [04/14/22 9:21:27:97] End: Creating dictionary (Took: 6.65ms)
2022-04-14T09:21:28.3011575Z   INFO [04/14/22 9:21:27:97] Begin: Storing version variables to cache file D:\a\1\s\.git\gitversion_cache\9DC0FE0AB47F761F12F81760D7026923B4CCFFB9.yml
2022-04-14T09:21:28.3012743Z   INFO [04/14/22 9:21:28:03] End: Storing version variables to cache file D:\a\1\s\.git\gitversion_cache\9DC0FE0AB47F761F12F81760D7026923B4CCFFB9.yml (Took: 60.25ms)
2022-04-14T09:21:28.3013462Z Executing GenerateSetVersionMessage for 'AzurePipelines'.
2022-04-14T09:21:28.3760643Z Executing GenerateBuildLogOutput for 'AzurePipelines'.
2022-04-14T09:21:28.3854235Z {
2022-04-14T09:21:28.3854511Z   "Major": 0,
2022-04-14T09:21:28.3854770Z   "Minor": 1,
2022-04-14T09:21:28.3855019Z   "Patch": 143,
2022-04-14T09:21:28.3855308Z   "PreReleaseTag": "PullRequest12445.12",
2022-04-14T09:21:28.3855689Z   "PreReleaseTagWithDash": "-PullRequest12445.12",
2022-04-14T09:21:28.3856220Z   "PreReleaseLabel": "PullRequest12445",
2022-04-14T09:21:28.3856684Z   "PreReleaseLabelWithDash": "-PullRequest12445",
2022-04-14T09:21:28.3857091Z   "PreReleaseNumber": 12,
2022-04-14T09:21:28.3857380Z   "WeightedPreReleaseNumber": 30012,
2022-04-14T09:21:28.3857685Z   "BuildMetaData": null,
2022-04-14T09:21:28.3857953Z   "BuildMetaDataPadded": "",
2022-04-14T09:21:28.3858380Z   "FullBuildMetaData": "Branch.pull-12445-merge.Sha.fab937330526187ed313fa1153413181de738482",
2022-04-14T09:21:28.3858795Z   "MajorMinorPatch": "0.1.143",
2022-04-14T09:21:28.3859137Z   "SemVer": "0.1.143-PullRequest12445.12",
2022-04-14T09:21:28.3859673Z   "LegacySemVer": "0.1.143-PullRequest12445-12",
2022-04-14T09:21:28.3860044Z   "LegacySemVerPadded": "0.1.143-PullRequest1244-0012",
2022-04-14T09:21:28.3860394Z   "AssemblySemVer": "0.1.143.0",
2022-04-14T09:21:28.3860692Z   "AssemblySemFileVer": "0.1.143.0",
2022-04-14T09:21:28.3861037Z   "FullSemVer": "0.1.143-PullRequest12445.12",
2022-04-14T09:21:28.3861725Z   "InformationalVersion": "0.1.143-PullRequest12445.12+Branch.pull-12445-merge.Sha.fab937330526187ed313fa1153413181de738482",
2022-04-14T09:21:28.3862907Z   "BranchName": "pull/12445/merge",
2022-04-14T09:21:28.3863959Z   "EscapedBranchName": "pull-12445-merge",
2022-04-14T09:21:28.3864562Z   "Sha": "fab937330526187ed313fa1153413181de738482",
2022-04-14T09:21:28.3864922Z   "ShortSha": "fab9373",
2022-04-14T09:21:28.3865260Z   "NuGetVersionV2": "0.1.143-pullrequest1244-0012",
2022-04-14T09:21:28.3865669Z   "NuGetVersion": "0.1.143-pullrequest1244-0012",
2022-04-14T09:21:28.3866066Z   "NuGetPreReleaseTagV2": "pullrequest1244-0012",
2022-04-14T09:21:28.3866462Z   "NuGetPreReleaseTag": "pullrequest1244-0012",
2022-04-14T09:21:28.3867201Z   "VersionSourceSha": "d78db6128621b3fbe6fe834c8d62e07baceb0383",
2022-04-14T09:21:28.3867918Z   "CommitsSinceVersionSource": 12,
2022-04-14T09:21:28.3868392Z   "CommitsSinceVersionSourcePadded": "0012",
2022-04-14T09:21:28.3868707Z   "UncommittedChanges": 0,
2022-04-14T09:21:28.3868986Z   "CommitDate": "2022-04-14"
2022-04-14T09:21:28.3869654Z }
2022-04-14T09:21:28.3869945Z   INFO [04/14/22 9:21:28:12] Done writing 
2022-04-14T09:21:28.3967588Z ##[section]Async Command Start: Update Build Number
2022-04-14T09:21:28.6428702Z Update build number to 0.1.143-PullRequest12445.12 for build 32147
2022-04-14T09:21:28.6429120Z ##[section]Async Command End: Update Build Number
2022-04-14T09:21:28.6430479Z ##[section]Finishing: gitversionexecute

Actual Behavior

Logs have been stripped of sensitive information, and shortened.
Logs with 5.10.0

2022-04-14T09:17:02.0371958Z ##[section]Starting: gitversionexecute
2022-04-14T09:17:02.0601135Z ==============================================================================
2022-04-14T09:17:02.0601534Z Task         : Execute GitVersion Task
2022-04-14T09:17:02.0601877Z Description  : Easy Semantic Versioning (http://semver.org) for projects using Git
2022-04-14T09:17:02.0602195Z Version      : 0.9.13
2022-04-14T09:17:02.0602411Z Author       : GitTools Contributors
2022-04-14T09:17:02.0602757Z Help         : See the [documentation](https://gitversion.net/docs/) for help
2022-04-14T09:17:02.0603135Z ==============================================================================
2022-04-14T09:17:02.5204270Z Command: dotnet-gitversion D:/a/1/s /output json /output buildserver /config D:\a\1\s\build\GitVersion.yml
2022-04-14T09:17:02.5224531Z [command]C:\hostedtoolcache\windows\GitVersion.Tool\5.10.0\x64\dotnet-gitversion.exe D:/a/1/s /output json /output buildserver /config D:\a\1\s\build\GitVersion.yml
2022-04-14T09:17:09.5063297Z INFO [04/14/22 9:17:02:98] Working directory: D:/a/1/s
2022-04-14T09:17:09.5064397Z INFO [04/14/22 9:17:03:06] Project root is: D:\a\1\s\
2022-04-14T09:17:09.5065084Z INFO [04/14/22 9:17:03:06] DotGit directory is: D:\a\1\s\.git
2022-04-14T09:17:09.5065851Z INFO [04/14/22 9:17:03:06] Branch from build environment: 
2022-04-14T09:17:09.5066875Z INFO [04/14/22 9:17:03:06] Begin: Normalizing git directory for branch ''
2022-04-14T09:17:09.5068069Z   INFO [04/14/22 9:17:03:12] One remote found (origin -> '[...]').
2022-04-14T09:17:09.5069426Z   INFO [04/14/22 9:17:03:12] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
[...]
2022-04-14T09:17:09.5448141Z   INFO [04/14/22 9:17:07:91] Creating local branch from remote tracking 'refs/remotes/origin/[...]'. <- last branch it fetches is unrelated to changes in the git repo.
2022-04-14T09:17:09.5450010Z   ERROR [04/14/22 9:17:09:25] An unexpected error occurred:
2022-04-14T09:17:09.5452608Z LibGit2Sharp.LibGit2SharpException: this remote has never connected
2022-04-14T09:17:09.5454103Z    at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 154
2022-04-14T09:17:09.5455585Z    at LibGit2Sharp.Core.Proxy.git_remote_ls(Repository repository, RemoteHandle remote) in /_/LibGit2Sharp/Core/Proxy.cs:line 2324
2022-04-14T09:17:09.5463791Z    at LibGit2Sharp.Network.ListReferencesInternal(String url, CredentialsHandler credentialsProvider) in /_/LibGit2Sharp/Network.cs:line 130
2022-04-14T09:17:09.5465477Z    at LibGit2Sharp.Network.ListReferences(Remote remote) in /_/LibGit2Sharp/Network.cs:line 55
2022-04-14T09:17:09.5466346Z    at GitVersion.GitRepository.GetPullRequestReference(AuthenticationInfo auth, Remote remote, String headTipSha) in D:\a\GitVersion\GitVersion\src\GitVersion.LibGit2Sharp\Git\GitRepository.cs:line 151
2022-04-14T09:17:09.5467796Z    at GitVersion.GitRepository.<>c__DisplayClass28_0.<CreateBranchForPullRequestBranch>b__0() in D:\a\GitVersion\GitVersion\src\GitVersion.LibGit2Sharp\Git\GitRepository.cs:line 79
2022-04-14T09:17:09.5468778Z    at GitVersion.RepositoryExtensions.RunSafe(Action operation) in D:\a\GitVersion\GitVersion\src\GitVersion.LibGit2Sharp\RepositoryExtensions.cs:line 15
2022-04-14T09:17:09.5469741Z    at GitVersion.GitRepository.CreateBranchForPullRequestBranch(AuthenticationInfo auth) in D:\a\GitVersion\GitVersion\src\GitVersion.LibGit2Sharp\Git\GitRepository.cs:line 69
2022-04-14T09:17:09.5470704Z    at GitVersion.GitPreparer.<>c__DisplayClass18_0.<EnsureHeadIsAttachedToBranch>b__3() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitPreparer.cs:line 237
2022-04-14T09:17:09.5471635Z    at GitVersion.Helpers.RetryAction`1.<>c__DisplayClass1_0.<Execute>b__0() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Helpers\RetryAction.cs:line 16
2022-04-14T09:17:09.5472373Z    at Polly.Policy`1.<>c__DisplayClass11_0.<Execute>b__0(Context _, CancellationToken _)
2022-04-14T09:17:09.5473450Z    at Polly.Retry.RetryEngine.Implementation[TResult](Func`3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates`1 shouldRetryResultPredicates, Action`4 onRetry, Int32 permittedRetryCount, IEnumerable`1 sleepDurationsEnumerable, Func`4 sleepDurationProvider)
2022-04-14T09:17:09.5474603Z    at Polly.Retry.RetryPolicy`1.Implementation(Func`3 action, Context context, CancellationToken cancellationToken)
2022-04-14T09:17:09.5475243Z    at Polly.Policy`1.Execute(Func`3 action, Context context, CancellationToken cancellationToken)
2022-04-14T09:17:09.5475717Z    at Polly.Policy`1.Execute(Func`1 action)
2022-04-14T09:17:09.5476577Z    at GitVersion.Helpers.RetryAction`2.Execute(Func`1 operation) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Helpers\RetryAction.cs:line 35
2022-04-14T09:17:09.5477758Z    at GitVersion.Helpers.RetryAction`1.Execute(Action operation) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Helpers\RetryAction.cs:line 14
2022-04-14T09:17:09.5478721Z    at GitVersion.GitPreparer.EnsureHeadIsAttachedToBranch(String currentBranchName, AuthenticationInfo authentication) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitPreparer.cs:line 237
2022-04-14T09:17:09.5480612Z    at GitVersion.GitPreparer.NormalizeGitDirectory(Boolean noFetch, String currentBranchName, Boolean isDynamicRepository) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitPreparer.cs:line 183
2022-04-14T09:17:09.5481684Z    at GitVersion.GitPreparer.NormalizeGitDirectory(String targetBranch, Boolean isDynamicRepository) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitPreparer.cs:line 134
2022-04-14T09:17:09.5483110Z    at GitVersion.GitPreparer.PrepareInternal(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitPreparer.cs:line 69
2022-04-14T09:17:09.5484090Z    at GitVersion.GitPreparer.Prepare() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitPreparer.cs:line 48
2022-04-14T09:17:09.5485762Z    at GitVersion.GitVersionCalculateTool.CalculateVersionVariables() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitVersionCalculateTool.cs:line 43
2022-04-14T09:17:09.5487056Z    at GitVersion.GitVersionExecutor.RunGitVersionTool(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersion.App\GitVersionExecutor.cs:line 66
2022-04-14T09:17:09.5487916Z   INFO [04/14/22 9:17:07:95] Creating local branch from remote tracking 'refs/remotes/origin/[...]'. <- fetching continues after errror?
[...]
2022-04-14T09:17:09.5505771Z   INFO [04/14/22 9:17:08:74] Local Refs:
2022-04-14T09:17:09.5506538Z refs/heads/azure-pipelines (beba0ba00c68a6302db05ead874942dced2fd352)
2022-04-14T09:17:09.5507123Z refs/heads/[...]
2022-04-14T09:17:09.5953268Z refs/remotes/pull/12445/merge (d3a87ff43aa0ef87f233769ddb1d2abf50666bce)
2022-04-14T09:17:09.5954519Z refs/tags/0.1.142 (52cece2d811cc87c76e80e1173c9513a759d90b9)
2022-04-14T09:17:09.5955926Z   INFO [04/14/22 9:17:08:78] No local branch pointing at the commit 'd3a87ff43aa0ef87f233769ddb1d2abf50666bce'. Fake branch needs to be created.
2022-04-14T09:17:09.5956886Z   INFO [04/14/22 9:17:08:78] Fetching remote refs to see if there is a pull request ref
2022-04-14T09:17:09.5957438Z   INFO [04/14/22 9:17:08:93] End: Normalizing git directory for branch '' (Took: 5,864.56ms)
2022-04-14T09:17:09.5958498Z   INFO [04/14/22 9:17:09:25] Attempting to show the current git graph (please include in issue): 
2022-04-14T09:17:09.5959909Z   INFO [04/14/22 9:17:09:25] Showing max of 100 commits
2022-04-14T09:17:09.5960806Z   INFO [04/14/22 9:17:09:45] *   d3a87ff4 7 minutes ago  (HEAD, pull/12445/merge)
2022-04-14T09:17:09.5961631Z |\  
2022-04-14T09:17:09.5962574Z | *   173a7c10 7 minutes ago  (tag: 0.1.142, origin/hotfix/[...], hotfix/[...])
2022-04-14T09:17:09.5963082Z | |\  
2022-04-14T09:17:09.5963287Z | |/  
2022-04-14T09:17:09.5963509Z |/|   
2022-04-14T09:17:09.5964253Z * |   74ce1021 17 hours ago  (origin/Development, Development)
2022-04-14T09:17:09.5965067Z |\ \  
2022-04-14T09:17:09.5965349Z | * | 01cfdd6c 25 hours ago 
2022-04-14T09:17:09.5965645Z | * | 1efb2508 26 hours ago 
2022-04-14T09:17:09.5965956Z * | |   3b46bac9 2 days ago 
2022-04-14T09:17:09.5966805Z |\ \ \  
2022-04-14T09:17:09.5967058Z | |/ /  
2022-04-14T09:17:09.5967266Z |/| |   
2022-04-14T09:17:09.5967987Z | * | e4d93ecc 2 days ago 
2022-04-14T09:17:09.5968735Z | * | 50adce61 2 days ago 
2022-04-14T09:17:09.5969053Z | * | c5dfbc40 3 days ago 
2022-04-14T09:17:09.5969341Z | * | beee064a 3 days ago 
2022-04-14T09:17:09.5971191Z |/ /  
2022-04-14T09:17:09.5971532Z | * ae12013e 21 hours ago 
2022-04-14T09:17:09.5973458Z | *   d78db612 2 days ago  (origin/master, master)
2022-04-14T09:17:09.5973789Z | |\  
2022-04-14T09:17:09.5974062Z | | * 08d59a55 2 days ago 
2022-04-14T09:17:09.5974305Z | |/  
2022-04-14T09:17:09.5974572Z | *   e19e606c 3 days ago 
2022-04-14T09:17:09.5974835Z | |\  
2022-04-14T09:17:09.5975037Z | |/  
2022-04-14T09:17:09.5975270Z |/|   
[...]
2022-04-14T09:17:09.6026318Z | | | | * a71fbaac 4 weeks ago 
2022-04-14T09:17:09.6026587Z 
2022-04-14T09:17:09.6026980Z INFO [04/14/22 9:17:02:87] Applicable build agent found: 'AzurePipelines'.
2022-04-14T09:17:09.6027449Z INFO [04/14/22 9:17:02:98] Working directory: D:/a/1/s
2022-04-14T09:17:09.6027884Z INFO [04/14/22 9:17:03:06] Project root is: D:\a\1\s\
2022-04-14T09:17:09.6028318Z INFO [04/14/22 9:17:03:06] DotGit directory is: D:\a\1\s\.git
2022-04-14T09:17:09.6028774Z INFO [04/14/22 9:17:03:06] Branch from build environment: 
2022-04-14T09:17:09.6029237Z INFO [04/14/22 9:17:03:06] Begin: Normalizing git directory for branch ''
2022-04-14T09:17:09.6029877Z   INFO [04/14/22 9:17:03:12] One remote found (origin -> '[...]').
2022-04-14T09:17:09.6030745Z   INFO [04/14/22 9:17:03:12] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
2022-04-14T09:17:09.6031480Z   INFO [04/14/22 9:17:03:15] Creating local branch from remote tracking 'refs/remotes/origin/azure-pipelines'.
2022-04-14T09:17:09.6331767Z   INFO [04/14/22 9:17:08:63] Creating local branch from remote tracking 'refs/remotes/origin/[...]'.
2022-04-14T09:17:09.6332454Z   INFO [04/14/22 9:17:08:70] HEAD is detached and points at commit 'd3a87ff43aa0ef87f233769ddb1d2abf50666bce'.
2022-04-14T09:17:09.6332975Z   INFO [04/14/22 9:17:08:74] Local Refs:
2022-04-14T09:17:09.6333424Z refs/heads/azure-pipelines (beba0ba00c68a6302db05ead874942dced2fd352)
2022-04-14T09:17:09.6773010Z refs/remotes/pull/12445/merge (d3a87ff43aa0ef87f233769ddb1d2abf50666bce)
2022-04-14T09:17:09.6773500Z refs/tags/0.1.142 (52cece2d811cc87c76e80e1173c9513a759d90b9)
2022-04-14T09:17:09.6774139Z   INFO [04/14/22 9:17:08:78] No local branch pointing at the commit 'd3a87ff43aa0ef87f233769ddb1d2abf50666bce'. Fake branch needs to be created.
2022-04-14T09:17:09.6774817Z   INFO [04/14/22 9:17:08:78] Fetching remote refs to see if there is a pull request ref
2022-04-14T09:17:09.6775383Z   INFO [04/14/22 9:17:08:93] End: Normalizing git directory for branch '' (Took: 5,864.56ms)
2022-04-14T09:17:09.6776569Z   ERROR [04/14/22 9:17:09:25] An unexpected error occurred:
2022-04-14T09:17:09.6777330Z LibGit2Sharp.LibGit2SharpException: this remote has never connected
2022-04-14T09:17:09.6777906Z    at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 154
2022-04-14T09:17:09.6778602Z    at LibGit2Sharp.Core.Proxy.git_remote_ls(Repository repository, RemoteHandle remote) in /_/LibGit2Sharp/Core/Proxy.cs:line 2324
2022-04-14T09:17:09.6779878Z    at LibGit2Sharp.Network.ListReferencesInternal(String url, CredentialsHandler credentialsProvider) in /_/LibGit2Sharp/Network.cs:line 130
2022-04-14T09:17:09.6780576Z    at LibGit2Sharp.Network.ListReferences(Remote remote) in /_/LibGit2Sharp/Network.cs:line 55
2022-04-14T09:17:09.6781442Z    at GitVersion.GitRepository.GetPullRequestReference(AuthenticationInfo auth, Remote remote, String headTipSha) in D:\a\GitVersion\GitVersion\src\GitVersion.LibGit2Sharp\Git\GitRepository.cs:line 151
2022-04-14T09:17:09.6782495Z    at GitVersion.GitRepository.<>c__DisplayClass28_0.<CreateBranchForPullRequestBranch>b__0() in D:\a\GitVersion\GitVersion\src\GitVersion.LibGit2Sharp\Git\GitRepository.cs:line 79
2022-04-14T09:17:09.6783558Z    at GitVersion.RepositoryExtensions.RunSafe(Action operation) in D:\a\GitVersion\GitVersion\src\GitVersion.LibGit2Sharp\RepositoryExtensions.cs:line 15
2022-04-14T09:17:09.6784525Z    at GitVersion.GitRepository.CreateBranchForPullRequestBranch(AuthenticationInfo auth) in D:\a\GitVersion\GitVersion\src\GitVersion.LibGit2Sharp\Git\GitRepository.cs:line 69
2022-04-14T09:17:09.6785516Z    at GitVersion.GitPreparer.<>c__DisplayClass18_0.<EnsureHeadIsAttachedToBranch>b__3() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitPreparer.cs:line 237
2022-04-14T09:17:09.6786701Z    at GitVersion.Helpers.RetryAction`1.<>c__DisplayClass1_0.<Execute>b__0() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Helpers\RetryAction.cs:line 16
2022-04-14T09:17:09.6787450Z    at Polly.Policy`1.<>c__DisplayClass11_0.<Execute>b__0(Context _, CancellationToken _)
2022-04-14T09:17:09.6788536Z    at Polly.Retry.RetryEngine.Implementation[TResult](Func`3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates`1 shouldRetryResultPredicates, Action`4 onRetry, Int32 permittedRetryCount, IEnumerable`1 sleepDurationsEnumerable, Func`4 sleepDurationProvider)
2022-04-14T09:17:09.6789654Z    at Polly.Retry.RetryPolicy`1.Implementation(Func`3 action, Context context, CancellationToken cancellationToken)
2022-04-14T09:17:09.6790294Z    at Polly.Policy`1.Execute(Func`3 action, Context context, CancellationToken cancellationToken)
2022-04-14T09:17:09.6790760Z    at Polly.Policy`1.Execute(Func`1 action)
2022-04-14T09:17:09.6791399Z    at GitVersion.Helpers.RetryAction`2.Execute(Func`1 operation) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Helpers\RetryAction.cs:line 35
2022-04-14T09:17:09.6792262Z    at GitVersion.Helpers.RetryAction`1.Execute(Action operation) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Helpers\RetryAction.cs:line 14
2022-04-14T09:17:09.6793232Z    at GitVersion.GitPreparer.EnsureHeadIsAttachedToBranch(String currentBranchName, AuthenticationInfo authentication) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitPreparer.cs:line 237
2022-04-14T09:17:09.6794495Z    at GitVersion.GitPreparer.NormalizeGitDirectory(Boolean noFetch, String currentBranchName, Boolean isDynamicRepository) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitPreparer.cs:line 183
2022-04-14T09:17:09.6795573Z    at GitVersion.GitPreparer.NormalizeGitDirectory(String targetBranch, Boolean isDynamicRepository) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitPreparer.cs:line 134
2022-04-14T09:17:09.6796898Z    at GitVersion.GitPreparer.PrepareInternal(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitPreparer.cs:line 69
2022-04-14T09:17:09.6797720Z    at GitVersion.GitPreparer.Prepare() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitPreparer.cs:line 48
2022-04-14T09:17:09.6798575Z    at GitVersion.GitVersionCalculateTool.CalculateVersionVariables() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitVersionCalculateTool.cs:line 43
2022-04-14T09:17:09.6799519Z    at GitVersion.GitVersionExecutor.RunGitVersionTool(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersion.App\GitVersionExecutor.cs:line 66
2022-04-14T09:17:09.6800402Z   INFO [04/14/22 9:17:09:25] Attempting to show the current git graph (please include in issue): 
2022-04-14T09:17:09.6800916Z   INFO [04/14/22 9:17:09:25] Showing max of 100 commits
2022-04-14T09:17:09.6801386Z   INFO [04/14/22 9:17:09:45] *   d3a87ff4 7 minutes ago  (HEAD, pull/12445/merge)
2022-04-14T09:17:09.6801763Z |\  
2022-04-14T09:17:09.6802244Z | *   173a7c10 7 minutes ago  (tag: 0.1.142, origin/hotfix/[...], hotfix/[...])
2022-04-14T09:17:09.6802731Z | |\  
2022-04-14T09:17:09.6802985Z | |/  
2022-04-14T09:17:09.6803211Z |/|   
2022-04-14T09:17:09.6803532Z * |   74ce1021 17 hours ago  (origin/Development, Development)
2022-04-14T09:17:09.6803870Z |\ \  
2022-04-14T09:17:09.6804137Z | * | 01cfdd6c 25 hours ago 
2022-04-14T09:17:09.6804430Z | * | 1efb2508 26 hours ago 
2022-04-14T09:17:09.6804743Z * | |   3b46bac9 2 days ago 
2022-04-14T09:17:09.6804988Z |\ \ \  
2022-04-14T09:17:09.6805221Z | |/ /  
2022-04-14T09:17:09.6805426Z |/| |   
2022-04-14T09:17:09.6805689Z | * | e4d93ecc 2 days ago 
2022-04-14T09:17:09.6806208Z | * | 50adce61 2 days ago 
2022-04-14T09:17:09.6806518Z | * | c5dfbc40 3 days ago 
2022-04-14T09:17:09.6806798Z | * | beee064a 3 days ago 
2022-04-14T09:17:09.6807061Z |/ /  
2022-04-14T09:17:09.6807308Z | * ae12013e 21 hours ago 
2022-04-14T09:17:09.6807665Z | *   d78db612 2 days ago  (origin/master, master)
2022-04-14T09:17:09.6807955Z | |\  
2022-04-14T09:17:09.6808216Z | | * 08d59a55 2 days ago 
2022-04-14T09:17:09.6808478Z | |/  
2022-04-14T09:17:09.6808724Z | *   e19e606c 3 days ago 
2022-04-14T09:17:09.6808984Z | |\  
2022-04-14T09:17:09.6809184Z | |/  
2022-04-14T09:17:09.6809401Z |/|   
2022-04-14T09:17:09.6875220Z | | | | * a71fbaac 4 weeks ago 
2022-04-14T09:17:09.6875430Z 
2022-04-14T09:17:09.6876310Z   INFO [04/14/22 9:17:09:48] Done writing 
2022-04-14T09:17:09.6915591Z ##[error]SyntaxError: Unexpected end of JSON input
2022-04-14T09:17:09.6938958Z ##[section]Finishing: gitversionexecute

Steps to Reproduce

Install 5.10.0 instead of 5.9.0.
Run gitversion/execute@0 task

Context

Builds fail on the gitversion/execute@0 task when the gitversion/setup@0 task installs 5.10.0.

Your Environment

Issue occurs on azure pipelines running the windows-2022 (windows-latest) image. The repository is hosted on the Azure DevOps Repos

  • Version Used: 5.10.0
  • Operating System and version (Windows 10, Ubuntu 18.04): Windows-latest
@IBlackI IBlackI added the bug label Apr 14, 2022
@IBlackI
Copy link
Author

IBlackI commented Apr 14, 2022

Related issue #3081

@orionstudt
Copy link

orionstudt commented Apr 14, 2022

I'm experiencing this as well currently - can the gitversion/setup command be told to install a specific version?

Edit: I probably should've looked first, it can be provided a version spec. Will try that for now until this is fixed.

@asparrowhawk
Copy link

asparrowhawk commented Apr 14, 2022

It is not clear to me that this is related to GitVersion. I saw an earlier pipeline run today that succeeded.

I am using chocolatey to install GitVersion on the hosted build agent:

- task: PowerShell@2
  displayName: 'Install GitVersion'
  inputs:
    targetType: 'inline'
    script: 'choco install GitVersion.Portable -y'

This pipeline failed:

Initialize Job

2022-04-14T12:27:00.7454463Z ##[section]Starting: Initialize job
2022-04-14T12:27:00.7456371Z Agent name: 'Hosted Agent'
2022-04-14T12:27:00.7456942Z Agent machine name: 'WIN-DS00EOJOLQK'
2022-04-14T12:27:00.7457227Z Current agent version: '2.202.0'
2022-04-14T12:27:00.7528389Z ##[group]Operating System
2022-04-14T12:27:00.7529167Z Microsoft Windows Server 2022
2022-04-14T12:27:00.7529351Z 10.0.20348
2022-04-14T12:27:00.7529492Z Datacenter
2022-04-14T12:27:00.7529652Z ##[endgroup]
2022-04-14T12:27:00.7529814Z ##[group]Virtual Environment
2022-04-14T12:27:00.7530010Z Environment: windows-2022
2022-04-14T12:27:00.7530184Z Version: 20220410.1
2022-04-14T12:27:00.7530535Z Included Software: https://github.com/actions/virtual-environments/blob/win22/20220410.1/images/win/Windows2022-Readme.md
2022-04-14T12:27:00.7530994Z Image Release: https://github.com/actions/virtual-environments/releases/tag/win22%2F20220410.1
2022-04-14T12:27:00.7531266Z ##[endgroup]
2022-04-14T12:27:00.7531669Z ##[group]Virtual Environment Provisioner
2022-04-14T12:27:00.7532341Z 1.0.0.0-main-20220325-1
2022-04-14T12:27:00.7532526Z ##[endgroup]
2022-04-14T12:27:00.7534330Z Current image version: '20220410.1'
2022-04-14T12:27:00.7545806Z Agent running as: 'VssAdministrator'
2022-04-14T12:27:00.7628012Z Prepare build directory.
2022-04-14T12:27:00.8043158Z Set build variables.
2022-04-14T12:27:00.8088222Z Download all required tasks.
2022-04-14T12:27:00.8276958Z Downloading task: PowerShell (2.200.0)
2022-04-14T12:27:01.6312960Z Downloading task: UseDotNet (2.198.0)
2022-04-14T12:27:03.8644177Z Downloading task: CmdLine (2.201.1)
2022-04-14T12:27:04.8680968Z Downloading task: DotNetCoreCLI (2.198.0)
2022-04-14T12:27:07.8832023Z Downloading task: reportgenerator (4.8.13)
2022-04-14T12:27:13.5725388Z Downloading task: PublishCodeCoverageResults (1.200.0)
2022-04-14T12:27:17.2877835Z Checking job knob settings.
2022-04-14T12:27:17.2896066Z    Knob: AgentToolsDirectory = C:\hostedtoolcache\windows Source: ${AGENT_TOOLSDIRECTORY} 
2022-04-14T12:27:17.2897459Z    Knob: AgentPerflog = C:\agents\perflog Source: ${VSTS_AGENT_PERFLOG} 
2022-04-14T12:27:17.2899494Z Finished checking job knob settings.
2022-04-14T12:27:17.3801521Z Start tracking orphan processes.
2022-04-14T12:27:17.3931276Z ##[section]Finishing: Initialize job

Install GitVersion

2022-04-14T12:29:26.3619488Z GitVersion.Portable v5.10.0 [Approved]
2022-04-14T12:29:26.3899787Z gitversion.portable package files install completed. Performing other installation steps.
2022-04-14T12:29:31.7507435Z Added C:\ProgramData\chocolatey\bin\gv.exe shim pointed to '..\lib\gitversion.portable\tools\gitversion.exe'.
2022-04-14T12:29:34.0934673Z  ShimGen has successfully created a shim for gitversion.exe
2022-04-14T12:29:34.1745957Z  The install of gitversion.portable was successful.
2022-04-14T12:29:34.1752773Z   Software install location not explicitly set, it could be in package or
2022-04-14T12:29:34.1754105Z   default install location of installer.
2022-04-14T12:29:34.2047731Z 
2022-04-14T12:29:34.2048950Z Chocolatey installed 1/1 packages. 

Powershell script to invoke GitVersion and write out contents of Directory.Build.props file

2022-04-14T12:29:35.0669997Z ##[section]Starting: Update version information
2022-04-14T12:29:35.0949313Z ==============================================================================
2022-04-14T12:29:35.0949932Z Task         : PowerShell
2022-04-14T12:29:35.0950389Z Description  : Run a PowerShell script on Linux, macOS, or Windows
2022-04-14T12:29:35.0950861Z Version      : 2.200.0
2022-04-14T12:29:35.0951522Z Author       : Microsoft Corporation
2022-04-14T12:29:35.0952098Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2022-04-14T12:29:35.0952784Z ==============================================================================
2022-04-14T12:29:36.6734163Z Generating script.
2022-04-14T12:29:36.6818712Z Formatted command: . 'D:\a\1\s\pipeline-scripts\Set-DirectoryBuildprops.ps1' -OutputFilePath "D:\a\1\s/Directory.Build.props" -Verbose
2022-04-14T12:29:36.8507393Z ========================== Starting Command Output ===========================
2022-04-14T12:29:36.8957195Z ##[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'D:\a\_temp\ce5ee620-5135-41ea-8402-abee66411ccd.ps1'"
2022-04-14T12:29:37.9565308Z VERBOSE: Using GitVersion 5.10.0+Branch.support-5.x.Sha.3892733000b5a4baefa00ef00ef9cd763b5dfcae
2022-04-14T12:29:39.6753081Z VERBOSE: Failed when processing json: INFO [04/14/22 12:29:38:36] Applicable build agent found: 'AzurePipelines'.
2022-04-14T12:29:39.6753853Z 
2022-04-14T12:29:39.6754385Z   ERROR [04/14/22 12:29:39:14] An unexpected error occurred:
2022-04-14T12:29:39.6754762Z 
2022-04-14T12:29:39.6755708Z LibGit2Sharp.LibGit2SharpException: this remote has never connected
2022-04-14T12:29:39.6756066Z 
2022-04-14T12:29:39.6756692Z    at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 154
2022-04-14T12:29:39.6757156Z 
2022-04-14T12:29:39.6759233Z    at LibGit2Sharp.Core.Proxy.git_remote_ls(Repository repository, RemoteHandle remote) in 
2022-04-14T12:29:39.6760652Z /_/LibGit2Sharp/Core/Proxy.cs:line 2324
2022-04-14T12:29:39.6760938Z 
2022-04-14T12:29:39.6761582Z    at LibGit2Sharp.Network.ListReferencesInternal(String url, CredentialsHandler credentialsProvider) in 
2022-04-14T12:29:39.6762366Z /_/LibGit2Sharp/Network.cs:line 130
2022-04-14T12:29:39.6763015Z 
2022-04-14T12:29:39.6763650Z    at LibGit2Sharp.Network.ListReferences(Remote remote) in /_/LibGit2Sharp/Network.cs:line 55

This pipeline from earlier in the day succeeded:

Initialize Job

2022-04-14T08:43:11.5424343Z ##[section]Starting: Initialize job
2022-04-14T08:43:11.5425921Z Agent name: 'Hosted Agent'
2022-04-14T08:43:11.5426348Z Agent machine name: 'fv-az172-203'
2022-04-14T08:43:11.5426581Z Current agent version: '2.202.0'
2022-04-14T08:43:11.5465049Z ##[group]Operating System
2022-04-14T08:43:11.5465302Z Microsoft Windows Server 2022
2022-04-14T08:43:11.5465445Z 10.0.20348
2022-04-14T08:43:11.5465558Z Datacenter
2022-04-14T08:43:11.5465689Z ##[endgroup]
2022-04-14T08:43:11.5465824Z ##[group]Virtual Environment
2022-04-14T08:43:11.5465989Z Environment: windows-2022
2022-04-14T08:43:11.5466147Z Version: 20220410.1
2022-04-14T08:43:11.5466429Z Included Software: https://github.com/actions/virtual-environments/blob/win22/20220410.1/images/win/Windows2022-Readme.md
2022-04-14T08:43:11.5466814Z Image Release: https://github.com/actions/virtual-environments/releases/tag/win22%2F20220410.1
2022-04-14T08:43:11.5467040Z ##[endgroup]
2022-04-14T08:43:11.5467358Z ##[group]Virtual Environment Provisioner
2022-04-14T08:43:11.5467552Z 1.0.0.0-main-20220325-1
2022-04-14T08:43:11.5467684Z ##[endgroup]
2022-04-14T08:43:11.5468404Z Current image version: '20220410.1'
2022-04-14T08:43:11.5475092Z Agent running as: 'VssAdministrator'
2022-04-14T08:43:11.5510212Z Prepare build directory.
2022-04-14T08:43:11.5762978Z Set build variables.
2022-04-14T08:43:11.5792548Z Download all required tasks.
2022-04-14T08:43:11.5897133Z Downloading task: PowerShell (2.200.0)
2022-04-14T08:43:12.1373093Z Downloading task: UseDotNet (2.198.0)
2022-04-14T08:43:13.6593545Z Downloading task: CmdLine (2.201.1)
2022-04-14T08:43:14.0246102Z Downloading task: DotNetCoreCLI (2.198.0)
2022-04-14T08:43:15.3436266Z Downloading task: reportgenerator (4.8.13)
2022-04-14T08:43:17.3211301Z Downloading task: PublishCodeCoverageResults (1.200.0)
2022-04-14T08:43:18.4065753Z Checking job knob settings.
2022-04-14T08:43:18.4074836Z    Knob: AgentToolsDirectory = C:\hostedtoolcache\windows Source: ${AGENT_TOOLSDIRECTORY} 
2022-04-14T08:43:18.4075984Z    Knob: AgentPerflog = c:\vsts\perflog Source: ${VSTS_AGENT_PERFLOG} 
2022-04-14T08:43:18.4077223Z Finished checking job knob settings.
2022-04-14T08:43:18.4477841Z Start tracking orphan processes.
2022-04-14T08:43:18.4545863Z ##[section]Finishing: Initialize job

Install GitVersion

2022-04-14T08:46:39.5157972Z GitVersion.Portable v5.10.0 [Approved]
2022-04-14T08:46:39.5257197Z gitversion.portable package files install completed. Performing other installation steps.
2022-04-14T08:46:46.5602106Z Added C:\ProgramData\chocolatey\bin\gv.exe shim pointed to '..\lib\gitversion.portable\tools\gitversion.exe'.
2022-04-14T08:46:47.6970567Z  ShimGen has successfully created a shim for gitversion.exe
2022-04-14T08:46:47.7342502Z  The install of gitversion.portable was successful.
2022-04-14T08:46:47.7347081Z   Software install location not explicitly set, it could be in package or
2022-04-14T08:46:47.7347603Z   default install location of installer.
2022-04-14T08:46:47.8175176Z 
2022-04-14T08:46:47.8176279Z Chocolatey installed 1/1 packages. 

Powershell script to invoke GitVersion and write out contents of Directory.Build.props file

2022-04-14T08:46:48.4152830Z ##[section]Starting: Update version information
2022-04-14T08:46:48.4264600Z ==============================================================================
2022-04-14T08:46:48.4264896Z Task         : PowerShell
2022-04-14T08:46:48.4265123Z Description  : Run a PowerShell script on Linux, macOS, or Windows
2022-04-14T08:46:48.4265351Z Version      : 2.200.0
2022-04-14T08:46:48.4265544Z Author       : Microsoft Corporation
2022-04-14T08:46:48.4265823Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2022-04-14T08:46:48.4266178Z ==============================================================================
2022-04-14T08:46:49.2828335Z Generating script.
2022-04-14T08:46:49.2880435Z Formatted command: . 'D:\a\1\s\pipeline-scripts\Set-DirectoryBuildprops.ps1' -OutputFilePath "D:\a\1\s/Directory.Build.props" -Verbose
2022-04-14T08:46:49.3272785Z ========================== Starting Command Output ===========================
2022-04-14T08:46:49.3504440Z ##[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'D:\a\_temp\70f9408f-b10f-44d6-853f-1ad6265f1098.ps1'"
2022-04-14T08:46:49.9675728Z VERBOSE: Using GitVersion 5.10.0+Branch.support-5.x.Sha.3892733000b5a4baefa00ef00ef9cd763b5dfcae
2022-04-14T08:46:51.1687932Z 
2022-04-14T08:46:51.2225519Z VERBOSE: Updating Directory.Build.props
2022-04-14T08:46:51.2391876Z #text                                             
2022-04-14T08:46:51.2392847Z -----                                             
2022-04-14T08:46:51.2393481Z 0.1.175+2022-04-14+828257b+master+VssAdministrator
2022-04-14T08:46:51.2394123Z Company Name Ltd.                                     
2022-04-14T08:46:51.2399112Z Copyright © Company Name Ltd. 2021-2021               
2022-04-14T08:46:51.2399484Z 0.1.175.0                                         
2022-04-14T08:46:51.2399709Z 0.1.175.0                                         
2022-04-14T08:46:51.2399934Z                                                   
2022-04-14T08:46:51.2400323Z 
2022-04-14T08:46:51.2400841Z 
2022-04-14T08:46:51.2820304Z ##[section]Finishing: Update version information

@orionstudt
Copy link

So you think it may be the GitVersion setup task that is part of the Azure DevOps extension?

Note that when I told the task to specifically install 5.9.0 all my pipelines started succeeding. Whenever it installed (or at least whenever it said it installed) 5.10.0 my pipelines failed.

@orionstudt
Copy link

orionstudt commented Apr 14, 2022

I also want to note that #1202 implies that this specific error is caused by a detached head. My pipelines in Azure DevOps running 5.9.0 are running against a PR branch and also have a detached head, and they are succeeding - so that doesn't appear to be the difference between these two scenarios.

@asparrowhawk
Copy link

Switching to using version 5.9.0 does allow the pipeline to run. The yaml now includes:

- task: PowerShell@2
    displayName: 'Install GitVersion'
    inputs:
    targetType: 'inline'
    script: 'choco install GitVersion.Portable -y --version=5.9.0'

But that still doesn't explain why earlier on today the pipeline ran without issue when using GitVersion 5.10.0.

@orionstudt
Copy link

orionstudt commented Apr 14, 2022

But that still doesn't explain why earlier on today the pipeline ran without issue when using GitVersion 5.10.0.

@asparrowhawk Did your successful run by chance run against a branch instead of a PR? Comments in #3081 imply that this issue is specific to when GitVersion is executed against a PR.

@cal5barton
Copy link

Running into the same issue on Azure DevOps using version 5.10.0. Pinning the version to 5.9.0 fixes it for now.

@asparrowhawk
Copy link

@orionstudt Success and failure of GitVersion today were seen on a PR. Yesterday's build of the main branch used GitVersion 5.10.0 and that ran without problem.

GitVersion 5.10.0+Branch.support-5.x.Sha.3892733000b5a4baefa00ef00ef9cd763b5dfcae

@arturcic
Copy link
Member

I would recommend to pin the version number always to avoid this type of 'surprises'. So for now I would recommend to pin to version 5.9.0 and when we find some time/will have more details, we will fix this issue.

@FuncLun
Copy link

FuncLun commented Apr 14, 2022

We experienced the same error in our AzDo pipelines. Downgrading to 5.9.0 resolves the problem, but that will require an update to many repositories.

Can I suggest unlisting 5.10.0 until the issue is resolved?

@arturcic
Copy link
Member

closed this in #3085

@arturcic arturcic added this to the 5.10.1 milestone Apr 14, 2022
@github-actions
Copy link

🎉 This issue has been resolved in version 5.10.1 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

@arturcic
Copy link
Member

@IBlackI @cal5barton @asparrowhawk @FuncLun @orionstudt please confirm it's working for you with version 5.10.1

@IBlackI
Copy link
Author

IBlackI commented Apr 14, 2022

@arturcic Confirmed working with 5.10.1

@arturcic
Copy link
Member

@IBlackI thank you for quick confirmation

@FuncLun
Copy link

FuncLun commented Apr 14, 2022

@arturcic Also confirming 5.10.1 works

Thank you for the quick action!

@asparrowhawk
Copy link

@arturcic Yes, the new version is also working for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants