GitVersion Azure Pipelines Task fails on linux

Created on 24 Apr 2019  路  9Comments  路  Source: GitTools/GitVersion

Output:

==============================================================================
Task         : GitVersion Task
Description  : Easy Semantic Versioning (http://semver.org) for projects using Git
Version      : 4.0.3
Author       : GitVersion Contributors
Help         : See the [documentation](http://gitversion.readthedocs.org/en/latest/) for help
==============================================================================
[command]/usr/bin/mono /home/vsts/work/_tasks/GitVersion_e5983830-3f75-11e5-82ed-81492570a08e/4.0.3/GitVersion.exe /home/vsts/work/1/s /output buildserver /nofetch /nocache
INFO [04/24/19 3:51:16:74] Working directory: /home/vsts/work/1/s
INFO [04/24/19 3:51:16:93] IsDynamicGitRepository: False
ERROR [04/24/19 3:51:16:97] An unexpected error occurred:
System.BadImageFormatException: Method has no body
File name: 'GitVersion'
  at LibGit2Sharp.Core.Proxy.git_buf_free (LibGit2Sharp.Core.Handles.GitBuf buf) [0x00000] in <824ee26b2afa49d5948582decd2171d3>:0 
  at LibGit2Sharp.Core.Handles.GitBuf.Dispose () [0x00000] in <824ee26b2afa49d5948582decd2171d3>:0 
  at LibGit2Sharp.Core.Proxy.ConvertPath (System.Func`2[T,TResult] pathRetriever) [0x0002e] in <824ee26b2afa49d5948582decd2171d3>:0 
  at LibGit2Sharp.Core.Proxy.git_repository_discover (LibGit2Sharp.Core.FilePath start_path) [0x00005] in <824ee26b2afa49d5948582decd2171d3>:0 
  at LibGit2Sharp.Repository.Discover (System.String startingPath) [0x00006] in <824ee26b2afa49d5948582decd2171d3>:0 
  at GitVersion.GitPreparer.GetDotGitDirectory () [0x0000f] in <824ee26b2afa49d5948582decd2171d3>:0 
  at GitVersion.GitPreparer.GetProjectRootDirectory () [0x00048] in <824ee26b2afa49d5948582decd2171d3>:0 
  at GitVersion.ConfigurationProvider.Verify (GitVersion.GitPreparer gitPreparer, GitVersion.Helpers.IFileSystem fileSystem) [0x00014] in <824ee26b2afa49d5948582decd2171d3>:0 
  at GitVersion.Program.VerifyConfiguration (GitVersion.Arguments arguments, GitVersion.Helpers.IFileSystem fileSystem) [0x00023] in <824ee26b2afa49d5948582decd2171d3>:0 
  at GitVersion.Program.VerifyArgumentsAndRun () [0x00118] in <824ee26b2afa49d5948582decd2171d3>:0 

The weird part is it then proceeds to show my git log ...

bug

All 9 comments

I actually tried the GitVersion .NET Core version and it also did not work. I got the error Cannot find module 'argparse'

The exact same issue happens with the MacOS hosted images.

Same issue here on MacOS, any news ?

Any update on this?

See #1610 for more info

Have just tested the newly released 5.0.0 Preview task and still getting the same error

##[debug]Evaluating condition for step: 'GitVersion'
##[debug]Evaluating: succeeded()
##[debug]Evaluating succeeded:
##[debug]=> True
##[debug]Result: True
Starting: GitVersion
==============================================================================
Task         : GitVersion .NET Core Task
Description  : Easy Semantic Versioning (http://semver.org) for projects using Git
Version      : 5.0.0
Author       : GitVersion Contributors
Help         : See the [documentation](http://gitversion.readthedocs.org/en/latest/) for help
==============================================================================
##[debug]agent.TempDirectory=/vsts/agent/_work/_temp
##[debug]loading inputs and endpoints
##[debug]loading INPUT_UPDATEASSEMBLYINFO
##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
##[debug]loaded 4
##[debug]Agent.ProxyUrl=undefined
##[debug]Agent.CAInfo=undefined
##[debug]Agent.ClientCert=undefined
##[debug]Agent.SkipCertValidation=undefined
##[debug]task result: Failed
##[error]Unhandled: Cannot find module 'argparse'
##[debug]Processed: ##vso[task.issue type=error;]Unhandled: Cannot find module 'argparse'
##[debug]Processed: ##vso[task.complete result=Failed;]Unhandled: Cannot find module 'argparse'
Finishing: GitVersion

@EwanNoble can you uninstall the extension from the organization and install it again? Looks like you have cashed the older version

I have removed the old preview extension and installed the new one and now GitVersion is working successfully on my Linux agents. Thank you very much @arturcic !

Closing

Was this page helpful?
0 / 5 - 0 ratings

Related issues

willhughes-au picture willhughes-au  路  4Comments

makuepfer picture makuepfer  路  4Comments

afcruzs picture afcruzs  路  4Comments

drewwilliams1982 picture drewwilliams1982  路  5Comments

aronsky picture aronsky  路  4Comments