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

[ISSUE]: Azure DevOps Pipeline GitVersion Task with error: "maxBuffer length exceeded" #1237

Closed
2 tasks done
ulluoink opened this issue Aug 23, 2024 · 9 comments · Fixed by #1278
Closed
2 tasks done

Comments

@ulluoink
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

AzureDevops task

What are you seeing?

In Azure yml pipeline step we use the gitversion tasks just like in the usage examples and get following error when executing

gitversion/[email protected]

This is the output:

Command: git -C C:/a/15/s rev-parse --is-shallow-repository
Command: C:\hostedtoolcache\windows\GitVersion.Tool\6.0.2\dotnet-gitversion.exe C:/a/15/s /output json /output buildserver /config C:\a\15\s\GitVersion.yml
##[error]stdout maxBuffer length exceeded

What is expected?

well guess what ? should work

Steps to Reproduce

azure devops pipeline with these steps:

steps:

  • task: gitversion/[email protected]
    displayName: 'Install GitVersion'
    inputs:
    versionSpec: '6.x'

  • task: gitversion/[email protected]
    displayName: 'Configure Git Version'
    name: ${{ parameters.VersionStepName }}
    inputs:
    useConfigFile: true
    configFilePath: ${{ parameters.ConfigFilePath }}

Output log or link to your CI build (if appropriate).

No response

@edwardvandevorst-philips

I see similar issue on GitHub. Removing stale branches, i.e. making sure that the output is smaller, solves the issue.

@arielangeles
Copy link

Same here. This happens in task version 2.x and 3.x, using version spec 5.x. Workaround for now is to go back to v1.x on those pipelines.

@LiamCottrell
Copy link

Had the same issue as well as others, version 3 of task with version spec 5 of the tool. Couldn't resolve until i went back to version 0 of the devops tasks.

arturcic added a commit to arturcic/gittools-actions that referenced this issue Sep 24, 2024
arturcic added a commit that referenced this issue Sep 24, 2024
#1237 - increase 'maxBuffer' to 10MB
@luk355
Copy link

luk355 commented Nov 5, 2024

This issue is still occurring on our repo with v3 of the execute task. The version calculation works fine with v0.

- task: gitversion/[email protected]
  displayName: Install GitVersion
  inputs:
    versionSpec: '6.0.4'

## fails
- task: gitversion/[email protected]
  displayName: Determine Version
  inputs:
    useConfigFile: true
    configFilePath: 'GitVersion.yml'

## works
- task: gitversion/execute@0
  displayName: Determine Version
  inputs:
    useConfigFile: true
    configFilePath: 'GitVersion.yml'

The pipeline job fails with:

Task         : Execute GitVersion Task
Description  : Easy Semantic Versioning (https://semver.org/) for projects using Git
Version      : 3.0.0
Author       : GitTools Contributors
Help         : See the [documentation](https://gitversion.net/docs/) for help
==============================================================================
Running on: 'Azure Pipelines'
Disable Telemetry
Executing GitVersion
Command: git -C /home/vsts/work/1/s rev-parse --is-shallow-repository
Command: /opt/hostedtoolcache/GitVersion.Tool/6.0.4/dotnet-gitversion /home/vsts/work/1/s /output json /output buildserver /config /home/vsts/work/1/s/GitVersion.yml
##[error]stdout maxBuffer length exceeded

@arturcic
Copy link
Member

arturcic commented Nov 5, 2024

@luk355 can you attach some logs as it's not clear what you see

@luk355
Copy link

luk355 commented Nov 5, 2024

@arturcic, thanks for prompt response. I've updated the post above with pipeline output. It fails with ##[error]stdout maxBuffer length exceeded. Let me know if you require more info.

@arturcic
Copy link
Member

arturcic commented Nov 5, 2024

@luk355 this is the buffer size

const commandOptions: ExecOptions = { maxBuffer: 1024 * 1024 * 10 } // 10MB
. I wonder if your log output is bigger then 10MB. Mind if you pull the same branch you run in the Azure Pipelines and run this command in the git root and see how big the log is?

export TF_BUILD=true
export GIT_BRANCH={your-branch-name}
dotnet-gitversion /home/vsts/work/1/s /output json /output buildserver /config GitVersion.yml

@arturcic
Copy link
Member

arturcic commented Nov 5, 2024

@luk355 this is the buffer size

actions/src/agents/common/build-agent.ts

Line 233 in 8bbeaf6

const commandOptions: ExecOptions = { maxBuffer: 1024 * 1024 * 10 } // 10MB
. I wonder if your log output is bigger then 10MB. Mind if you pull the same branch you run in the Azure Pipelines and run this command in the git root and see how big the log is?
export TF_BUILD=true
export GIT_BRANCH={your-branch-name}
dotnet-gitversion /home/vsts/work/1/s /output json /output buildserver /config GitVersion.yml

you will need to install the dotnet sdk if you don't have it

@luk355
Copy link

luk355 commented Nov 7, 2024

I did try to run the command locally on on one of the failing branches in Azure Pipelines.

dotnet-gitversion . /output json /output buildserver /config GitVersion.yml > gitversion.log

... when checking the size of gitversion.log file, it has 150076 bytes ~ 0.143 MB

I thought the git state (branch) before the command is run might have affect on the log output but it seems it does not. I have tried to run this command on main branch as well as on a detached state based on the commit (the same way as a repo is checked out in Azure Pipelines) and the log output size is very similar.

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

Successfully merging a pull request may close this issue.

6 participants