GitVersion.exe failed with return code 3221225725

Created on 30 May 2019  路  17Comments  路  Source: GitTools/GitVersion

Hi,

We are using YAML build pipeline for our continuous integration. One of PR from Master to Develop is continuously failing in GitVersion task and the version we are using is 4.0.3. It is going for infinite loop for searching commit and exiting with error code 3221225725. Logs are as followed

NFO [05/30/19 1:58:11:74] Begin: Getting branches containing the commit '9fdc305af7b84eaf10ccf3dfc92245736c71073a'.
2019-05-30T08:58:11.7558389Z INFO [05/30/19 1:58:11:74] Trying to find direct branches.
2019-05-30T08:58:11.7559860Z INFO [05/30/19 1:58:11:74] No direct branches found, searching through tracked branches.
2019-05-30T08:58:11.8153589Z INFO [05/30/19 1:58:11:80] Searching for commits reachable from 'origin/develop'.
2019-05-30T08:58:11.8493240Z INFO [05/30/19 1:58:11:84] The branch 'origin/develop' has a matching commit.
2019-05-30T08:58:11.8493822Z INFO [05/30/19 1:58:11:84] Searching for commits reachable from 'origin/hotfix/237384'.
2019-05-30T08:58:11.8604821Z INFO [05/30/19 1:58:11:85] The branch 'origin/hotfix/237384' has no matching commits.
2019-05-30T08:58:11.8605591Z INFO [05/30/19 1:58:11:85] Searching for commits reachable from 'origin/hotfix/239816'.
2019-05-30T08:58:11.8757227Z INFO [05/30/19 1:58:11:87] The branch 'origin/hotfix/239816' has no matching commits.
2019-05-30T08:58:11.8757885Z INFO [05/30/19 1:58:11:87] Searching for commits reachable from 'origin/hotfix/247276'.
2019-05-30T08:58:11.8884771Z INFO [05/30/19 1:58:11:88] The branch 'origin/hotfix/247276' has no matching commits.

INFO [05/30/19 1:58:11:48] The branch 'origin/support/7.3.3' has no matching commits.
2019-05-30T08:58:11.4957593Z INFO [05/30/19 1:58:11:48] End: Getting branches containing the commit 'e44a2793ae04e0645d583939050a098641caa4de'. (Took: 1,265.62ms)
2019-05-30T08:58:11.4958274Z INFO [05/30/19 1:58:11:48] Found possible parent branches: origin/develop, origin/hotfix/7.3-samplehotfix, origin/hotfix/7.3.2Develop, origin/hotfix/7.3.2Doc, origin/hotfix/7.3.3Develop, origin/hotfix/BUG114267, origin/hotfix/Bug91644, origin/hotfix/ConfigDBMigrationFix, origin/hotfix/DiagnosticExchOl, origin/hotfix/HelpDocBug, origin/hotfix/hotfix-template-7.3, origin/hotfix/NCC-AngularJs-ScriptInjectionFix, origin/hotfix/NCC-XSRF-XSS-Fix, origin/hotfix/NCC_773060, origin/hotfix/NCCGroupFix, origin/hotfix/SOL263708, origin/hotfix/Support-Autotest73-CP, origin/hotfix/syncservice-testing, origin/hotfix/VFBinaries2Analyze, origin/support/7.3, origin/support/7.3.2, origin/support/7.3.3
2019-05-30T08:58:11.5699152Z WARN [05/30/19 1:58:11:55] Failed to inherit Increment branch configuration, ended up with: origin/develop, origin/hotfix/7.3-samplehotfix, origin/hotfix/7.3.2Develop, origin/hotfix/7.3.2Doc, origin/hotfix/7.3.3Develop, origin/hotfix/BUG114267, origin/hotfix/Bug91644, origin/hotfix/ConfigDBMigrationFix, origin/hotfix/DiagnosticExchOl, origin/hotfix/HelpDocBug, origin/hotfix/hotfix-template-7.3, origin/hotfix/NCC-AngularJs-ScriptInjectionFix, origin/hotfix/NCC-XSRF-XSS-Fix, origin/hotfix/NCC_773060, origin/hotfix/NCCGroupFix, origin/hotfix/SOL263708, origin/hotfix/Support-Autotest73-CP, origin/hotfix/syncservice-testing, origin/hotfix/VFBinaries2Analyze, origin/support/7.3, origin/support/7.3.2, origin/support/7.3.3
2019-05-30T08:58:11.5699586Z
2019-05-30T08:58:11.5699664Z Falling back to 05a421e3-on-hotfix-7.3.3Develop branch config
2019-05-30T08:58:11.5700043Z INFO [05/30/19 1:58:11:55] No branch configuration found for branch 05a421e3-on-hotfix-7.3.3Develop, falling back to default configuration
2019-05-30T08:58:11.5700650Z INFO [05/30/19 1:58:11:55] Begin: Attempting to inherit branch configuration from parent branch
2019-05-30T08:58:11.6355095Z INFO [05/30/19 1:58:11:62] HEAD is merge commit, this is likely a pull request using master as base
2019-05-30T08:58:11.7554946Z INFO [05/30/19 1:58:11:74] Begin: Finding branch source of 'master'
2019-05-30T08:58:11.7556507Z INFO [05/30/19 1:58:11:74] Multiple source branches have been found, picking the first one (develop).
2019-05-30T08:58:11.7556743Z This may result in incorrect commit counting.
2019-05-30T08:58:11.7556814Z Options were:
2019-05-30T08:58:11.7556888Z develop, origin/develop, release/7.3.1, origin/release/7.3.1, release/7.3.0, origin/release/7.3.0, release/7.2.0, origin/release/7.2.0
2019-05-30T08:58:11.7557317Z INFO [05/30/19 1:58:11:74] End: Finding branch source of 'master' (Took: 0.00ms)

Any help would be appreciated.

Regards,
Kotresh

All 17 comments

How does your GitVersion.yml file look like and which version and variant of GitVersion are you using?

I'm experiencing the same issue. We're using the GitVersion extension for Azure Devops, version 4.0.3. Our gitversion.yml looks like this:

assembly-versioning-scheme: MajorMinorPatchTag
mode: Mainline
continuous-delivery-fallback-tag: ''
branches:
  develop:
    regex: ^dev(elop(ment)?)?$
    increment: Patch
    tag: unstable
  master:
    tag: ''
    increment: Minor

@thoemmi, do you have a public repository on which this problem can be reproduced?

Unfortunately not. Also we temporarily disabled the GitVersion build step, so the PR build succeeded. After merging to our dev branch we re-enabled the GitVersion task, and now it works again without a flaw.

However, I may provide you with the (anonymized) log of the failed build.

@thoemmi, I'm sorry, but as I wrote in https://github.com/GitTools/GitVersion/issues/1328#issuecomment-498705714, logs won't be of much help to debug this.

We also followed the same workaround to proceed. i.e. Disable Gitversion task to complete the PR from support to Develop. But we get the same issue while we merge Develop to feature branches. So, to get out of problem, either we need to disable GitVersion task at least once or make a commit after merging changes from Develop in the same feature branch.

And our gitversion.yml is as below.

assembly-versioning-scheme: MajorMinorPatch
mode: ContinuousDelivery
tag-prefix: '[vV]'
continuous-delivery-fallback-tag: ci
major-version-bump-message: '\+semver:\s?(breaking|major)'
minor-version-bump-message: '\+semver:\s?(feature|minor)'
patch-version-bump-message: '\+semver:\s?(fix|patch)'
legacy-semver-padding: 4
build-metadata-padding: 4
commits-since-version-source-padding: 4
commit-message-incrementing: Enabled
branches:
  release:
    mode: ContinuousDelivery
    tag: release
    increment: Patch
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false
  hotfix:
    mode: ContinuousDelivery
    tag: hotfix
    increment: Patch
    prevent-increment-of-merged-branch-version: false
    track-merge-target: false

We also tried by adding support to above list. But no luck.

@KotreshAvinalli, are you able to provide a public repository where this problem is reproducible?

To add some detail to this, we're seeing this sporadically. It's not reproducible - you can run the same build straight away again with no changes to the repo, and it will work. Usually GitVersion takes around 15s to run on our repo. When this happens, it runs for about 20 minutes, and produces around 350 MB of log output, although that's only around 4MB zipped.

Some interesting lines:

2019-09-13T14:31:57.5291605Z   INFO [09/13/19 10:31:57:52] End: Finding branch source of 'feature/57608_RA_Connectivity_Issues' (Took: 140.63ms)
2019-09-13T14:31:57.5355572Z   INFO [09/13/19 10:31:57:52] Begin: Getting branches containing the commit 'b03eee10ed451d515e9e820ce35ac223e573ad1b'.

<snip>

2019-09-13T14:31:57.6927090Z   INFO [09/13/19 10:31:57:68] End: Getting branches containing the commit 'b03eee10ed451d515e9e820ce35ac223e573ad1b'. (Took: 164.06ms)
2019-09-13T14:31:57.6933252Z   INFO [09/13/19 10:31:57:69] Begin: Getting branches containing the commit 'abefb75fd42e9896eebc8bb6d931b4b891346ef7'.

<snip>

2019-09-13T14:31:57.9030511Z   INFO [09/13/19 10:31:57:89] End: Getting branches containing the commit 'abefb75fd42e9896eebc8bb6d931b4b891346ef7'. (Took: 203.12ms)
2019-09-13T14:31:57.9032260Z   INFO [09/13/19 10:31:57:89] Found possible parent branches: master, origin/master
2019-09-13T14:31:57.9101432Z   WARN [09/13/19 10:31:57:89] Failed to inherit Increment branch configuration, ended up with: master, origin/master
2019-09-13T14:31:57.9101600Z 
2019-09-13T14:31:57.9101741Z Falling back to feature/56889_AgentReAuth-revert-from-master branch config
2019-09-13T14:31:57.9101818Z   INFO [09/13/19 10:31:57:89] Begin: Attempting to inherit branch configuration from parent branch
2019-09-13T14:31:57.9155933Z     INFO [09/13/19 10:31:57:91] HEAD is merge commit, this is likely a pull request using feature/57608_RA_Connectivity_Issues as base
2019-09-13T14:31:57.9202331Z     INFO [09/13/19 10:31:57:91] Begin: Finding branch source of 'feature/57608_RA_Connectivity_Issues'
2019-09-13T14:31:57.9202500Z       INFO [09/13/19 10:31:57:91] Multiple source branches have been found, picking the first one (master).
2019-09-13T14:31:57.9202730Z This may result in incorrect commit counting.
2019-09-13T14:31:57.9202772Z Options were:
2019-09-13T14:31:57.9202849Z  master, origin/master, release/2019.4, origin/release/2019.4, release/2019.3, origin/release/2019.3, release/2019.2.1, origin/release/2019.2.1, release/2019.1.1, origin/release/2019.1.1, release/2018.5.1, release/2018.5.2, origin/release/2018.5.1, origin/release/2018.5.2, release/2018.4.1.629, origin/release/2018.4.1.629, release/2018.3.3.629, origin/release/2018.3.3.629, release/2018.3.1.426, origin/release/2018.3.1.426, release/2018.2.3.328, origin/release/2018.2.3.328, release/2018.2.2.302, origin/release/2018.2.2.302
2019-09-13T14:31:57.9202937Z     INFO [09/13/19 10:31:57:91] End: Finding branch source of 'feature/57608_RA_Connectivity_Issues' (Took: 0.00ms)
2019-09-13T14:31:57.9202997Z     INFO [09/13/19 10:31:57:91] Begin: Getting branches containing the commit 'b03eee10ed451d515e9e820ce35ac223e573ad1b'.

<snip>

2019-09-13T14:31:58.1166425Z     INFO [09/13/19 10:31:58:11] End: Getting branches containing the commit 'b03eee10ed451d515e9e820ce35ac223e573ad1b'. (Took: 203.13ms)
2019-09-13T14:31:58.1166527Z     INFO [09/13/19 10:31:58:11] Begin: Getting branches containing the commit 'abefb75fd42e9896eebc8bb6d931b4b891346ef7'.

<snip>

INFO [09/13/19 10:31:58:30] End: Getting branches containing the commit 'abefb75fd42e9896eebc8bb6d931b4b891346ef7'. (Took: 187.52ms)
2019-09-13T14:31:58.3099232Z     INFO [09/13/19 10:31:58:30] Found possible parent branches: master, origin/master
2019-09-13T14:31:58.3150890Z     WARN [09/13/19 10:31:58:30] Failed to inherit Increment branch configuration, ended up with: master, origin/master
2019-09-13T14:31:58.3151140Z 
2019-09-13T14:31:58.3151247Z Falling back to feature/56889_AgentReAuth-revert-from-master branch config
2019-09-13T14:31:58.3151414Z     INFO [09/13/19 10:31:58:30] Begin: Attempting to inherit branch configuration from parent branch
2019-09-13T14:31:58.3195247Z       INFO [09/13/19 10:31:58:31] HEAD is merge commit, this is likely a pull request using feature/57608_RA_Connectivity_Issues as base
2019-09-13T14:31:58.3254307Z       INFO [09/13/19 10:31:58:31] Begin: Finding branch source of 'feature/57608_RA_Connectivity_Issues'
2019-09-13T14:31:58.3254587Z         INFO [09/13/19 10:31:58:31] Multiple source branches have been found, picking the first one (master).
2019-09-13T14:31:58.3254724Z This may result in incorrect commit counting.
2019-09-13T14:31:58.3254801Z Options were:
2019-09-13T14:31:58.3254961Z  master, origin/master, release/2019.4, origin/release/2019.4, release/2019.3, origin/release/2019.3, release/2019.2.1, origin/release/2019.2.1, release/2019.1.1, origin/release/2019.1.1, release/2018.5.1, release/2018.5.2, origin/release/2018.5.1, origin/release/2018.5.2, release/2018.4.1.629, origin/release/2018.4.1.629, release/2018.3.3.629, origin/release/2018.3.3.629, release/2018.3.1.426, origin/release/2018.3.1.426, release/2018.2.3.328, origin/release/2018.2.3.328, release/2018.2.2.302, origin/release/2018.2.2.302
2019-09-13T14:31:58.3255122Z       INFO [09/13/19 10:31:58:31] End: Finding branch source of 'feature/57608_RA_Connectivity_Issues' (Took: 0.00ms)
2019-09-13T14:31:58.3255289Z       INFO [09/13/19 10:31:58:31] Begin: Getting branches containing the commit 'b03eee10ed451d515e9e820ce35ac223e573ad1b'.

It proceeds in this loop all the way to the end of the log file, getting further and further indented as it does so. The last lines are indented with 4498 spaces, and then we get:

2019-09-13T14:50:38.1824916Z Process is terminated due to StackOverflowException.
2019-09-13T14:50:38.3109733Z ##[error]Error: D:\agent\_work\_tasks\GitVersion_e5983830-3f75-11e5-82ed-81492570a08e\4.0.1\GitVersion.exe failed with return code: 3221225725
2019-09-13T14:50:38.3204405Z ##[section]Finishing: GitVersion

Our GitVersion.yml is as follows:

mode: ContinuousDelivery
next-version: 2018.4.2
assembly-informational-format: '{SemVer}'
branches: 
    master:
        mode: ContinuousDeployment
        tracks-release-branches: true
        tag: alpha
    release:
        mode: ContinuousDeployment
        is-release-branch: true
        tag: beta
    feature:
        tag: useBranchName
ignore:
  sha: []

If I can provide any more useful info, please let me know.

@mattwhitfield, thanks for the information. A repository where this can be reproduced would be very helpful, so we can put a breakpoint and see exactly why we're incurring a recursion or infinite loop here.

@asbjornu - unfortunately, I can't help you there. As I said above, it's not reproducible for us. I can run the same build on the same source repo and it will work on the second attempt - with no commits being made to any branch. I don't have any helpful indicators as to what might be a factor in that seemingly non-deterministic behaviour. If I do notice anything further, I will let you know.

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

Just to confirm, this issue is still a problem for us. When we retry the build off the same sources, it generally passes. Also, fwiw, it seems to happen when two build agents that are on separate machines are building from the same source tree at the same time. This might just be anecdotal, because we notice it most often on PRs where builds get kicked off together.

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

Is this still an issue in version 5.2.3?

As far as I can tell it hasn't been an issue since moving to v5. But we had other issues with v5 so we are moving to a custom approach so we probably won't be able to say for sure if v5 eradicates the issue seeing as it was sporadic...

Closing this issue then, please open it again if the issue occurs in the newest version

Was this page helpful?
0 / 5 - 0 ratings