Skip to content

[ISSUE]: ADO execute@0 Cannot read property 'message' of undefined #4394

@grixxie

Description

@grixxie

Prerequisites

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

GitVersion package

AzureDevops task

GitVersion version

5.11.1

Operating system

Linux

What are you seeing?

A YAML CI/CD pipeline in ADO that has been working for a long time, is suddenly failing since last night. The agent is self-hosted Linux, with Git version 2.34.1 installed.

The install task is installing version 5.11.1 of the GitVersion Tool, which is the same version the pipeline was using yesterday when this was working.
The install and execute tasks are both version 0.13.6, which is the same version the pipeline was using yesterday when this was working.

The settings of the pipeline are configured to have shallow fetch disabled.

The Install task appears to work fine.
The Execute task is failing with the following:

Starting: Use GitVersion
==============================================================================
Task         : Execute GitVersion Task
Description  : Easy Semantic Versioning (https://semver.org) for projects using Git
Version      : 0.13.6
Author       : GitTools Contributors
Help         : See the [documentation](https://gitversion.net/docs/) for help
==============================================================================
Agent: 'Azure Pipelines'
Command: git rev-parse --is-shallow-repository
/usr/bin/git rev-parse --is-shallow-repository
fatal: not a git repository (or any of the parent directories): .git
Command: dotnet-gitversion /agent/_work/18/s /output json /output buildserver /config /agent/_work/18/s/GitVersion.yml
/agent/_work/_tool/GitVersion.Tool/5.11.1/x64/dotnet-gitversion /agent/_work/18/s /output json /output buildserver /config /agent/_work/18/s/GitVersion.yml
unsupported extension name extensions.worktreeconfig
INFO [01/24/25 14:27:57:48] Working directory: /agent/_work/18/s
INFO [01/24/25 14:27:57:51] Done writing 
##[error]TypeError: Cannot read property 'message' of undefined
Finishing: Use GitVersion

I don't believe that anything on my side has changed since yesterday, so I'm struggling to fix this! Any more information required let me know!

Any suggestions or help is much appreciated.

What is expected?

I would expect this to not error. As mentioned, the same pipeline with the seemingly the same versions of the tools was working fine yesterday.

Steps to Reproduce

My GitVersion tasks in the pipeline look like the following:

stages:
  - stage: Build_and_Publish
    jobs:
      - job: Build
        pool:
          name: MyAgents

        steps:
          - task: gitversion/setup@0
            displayName: Install GitVersion
            inputs:
              versionSpec: '5.11.1'

          - task: gitversion/execute@0
            displayName: Use GitVersion
            inputs:
              updateAssemblyInfo: false
              useConfigFile: true
              configFilePath: './GitVersion.yml'

          - task: Bash@3
            displayName: 'Set Build Number to Semantic Version'
            inputs:
              targetType: 'inline'
              script: 'echo "##vso[build.updatebuildnumber]$(fullSemVer)"'

As mentioned above, issue is on the Execute task.

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

See above.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions