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

GitVersion crashes on Ubuntu 18.04 with System.BadImageFormatException: Method has no body #1483

Closed
alexeyzimarev opened this issue Sep 27, 2018 · 11 comments

Comments

@alexeyzimarev
Copy link

My build script runs fine in Docker mono image, but when I try to build on my machine, I get this error:

 ✘  ~/dev/infra/email   master ●  mono packages/tools/GitVersion.CommandLine/tools/GitVersion.exe 
INFO [09/27/18 11:39:09:75] Working directory: /home/alexey/dev/infra/email
INFO [09/27/18 11:39:09:76] IsDynamicGitRepository: False
ERROR [09/27/18 11:39:09:77] An unexpected error occurred:
System.BadImageFormatException: Method has no body
File name: 'LibGit2Sharp'
  at LibGit2Sharp.Core.Proxy.git_buf_free (LibGit2Sharp.Core.Handles.GitBuf buf) [0x00000] in <8cb98e2882834fdfae1774f5509e9705>:0 
  at LibGit2Sharp.Core.Handles.GitBuf.Dispose () [0x00000] in <8cb98e2882834fdfae1774f5509e9705>:0 
  at LibGit2Sharp.Core.Proxy.ConvertPath (System.Func`2[T,TResult] pathRetriever) [0x0002e] in <8cb98e2882834fdfae1774f5509e9705>:0 
  at LibGit2Sharp.Core.Proxy.git_repository_discover (LibGit2Sharp.Core.FilePath start_path) [0x00005] in <8cb98e2882834fdfae1774f5509e9705>:0 
  at LibGit2Sharp.Repository.Discover (System.String startingPath) [0x00006] in <8cb98e2882834fdfae1774f5509e9705>:0 
  at GitVersion.GitPreparer.GetDotGitDirectory () [0x0000f] in <d3d987301fcb4b25b3d107f5a758a97d>:0 
  at GitVersion.GitPreparer.GetProjectRootDirectory () [0x00048] in <d3d987301fcb4b25b3d107f5a758a97d>:0 
  at GitVersion.ConfigurationProvider.Verify (GitVersion.GitPreparer gitPreparer, GitVersion.Helpers.IFileSystem fileSystem) [0x00014] in <d3d987301fcb4b25b3d107f5a758a97d>:0 
  at GitVersion.Program.VerifyConfiguration (GitVersion.Arguments arguments, GitVersion.Helpers.IFileSystem fileSystem) [0x00023] in <d3d987301fcb4b25b3d107f5a758a97d>:0 
  at GitVersion.Program.VerifyArgumentsAndRun () [0x00118] in <d3d987301fcb4b25b3d107f5a758a97d>:0 
@asbjornu
Copy link
Member

asbjornu commented Oct 1, 2018

With the new build system, I hope we can get out packages for Unix based operating systems that don't depend on Mono, but can use the more x-platform friendly .NET Core instead. Please be patient while we work on getting #1485 incorporated.

@magne
Copy link

magne commented Nov 29, 2018

Any progress on this issue. #1485 was merged 2 months ago.

@asbjornu
Copy link
Member

@magne: GitVersion v4 was pushed as a stable package a while ago. Have you tested it with .NET Core?

@magne
Copy link

magne commented Nov 29, 2018

GitVersion 4.0.0 and 4.0.1-beta1-50 both fail on Ubuntu 18.10. The failure is not caused by libcurl4.so, but has the exception shown above.

@ivanrusso
Copy link

ivanrusso commented Dec 2, 2018

@asbjornu

Same Issue here running on ubuntu 16.04
Docker Image -> Microsoft/vsts-agent:ubuntu-16.04-docker-18.06.1-ce-standard
[command]/usr/bin/mono /vsts/agent/_work/_tasks/GitVersion_e5983830-3f75-11e5-82ed-81492570a08e/4.0.3/GitVersion.exe /vsts/agent/_work/1/s /output buildserver /nofetch 2018-12-02T10:38:17.9168976Z INFO [12/02/18 10:38:17:88] Working directory: /vsts/agent/_work/1/s 2018-12-02T10:38:17.9285082Z INFO [12/02/18 10:38:17:92] IsDynamicGitRepository: False 2018-12-02T10:38:17.9483265Z ERROR [12/02/18 10:38:17:94] An unexpected error occurred: 2018-12-02T10:38:17.9483625Z System.BadImageFormatException: Method has no body 2018-12-02T10:38:17.9484475Z File name: 'GitVersion' 2018-12-02T10:38:17.9484670Z at LibGit2Sharp.Core.Proxy.git_buf_free (LibGit2Sharp.Core.Handles.GitBuf buf) [0x00000] in <824ee26b2afa49d5948582decd2171d3>:0 2018-12-02T10:38:17.9484950Z at LibGit2Sharp.Core.Handles.GitBuf.Dispose () [0x00000] in <824ee26b2afa49d5948582decd2171d3>:0 2018-12-02T10:38:17.9485064Z at LibGit2Sharp.Core.Proxy.ConvertPath (System.Func2[T,TResult] pathRetriever) [0x0002e] in <824ee26b2afa49d5948582decd2171d3>:0
2018-12-02T10:38:17.9485218Z at LibGit2Sharp.Core.Proxy.git_repository_discover (LibGit2Sharp.Core.FilePath start_path) [0x00005] in <824ee26b2afa49d5948582decd2171d3>:0
2018-12-02T10:38:17.9485323Z at LibGit2Sharp.Repository.Discover (System.String startingPath) [0x00006] in <824ee26b2afa49d5948582decd2171d3>:0
2018-12-02T10:38:17.9485445Z at GitVersion.GitPreparer.GetDotGitDirectory () [0x0000f] in <824ee26b2afa49d5948582decd2171d3>:0
2018-12-02T10:38:17.9485605Z at GitVersion.GitPreparer.GetProjectRootDirectory () [0x00048] in <824ee26b2afa49d5948582decd2171d3>:0
2018-12-02T10:38:17.9485714Z at GitVersion.ConfigurationProvider.Verify (GitVersion.GitPreparer gitPreparer, GitVersion.Helpers.IFileSystem fileSystem) [0x00014] in <824ee26b2afa49d5948582decd2171d3>:0
2018-12-02T10:38:17.9485867Z at GitVersion.Program.VerifyConfiguration (GitVersion.Arguments arguments, GitVersion.Helpers.IFileSystem fileSystem) [0x00023] in <824ee26b2afa49d5948582decd2171d3>:0
2018-12-02T10:38:17.9485976Z at GitVersion.Program.VerifyArgumentsAndRun () [0x00118] in <824ee26b2afa49d5948582decd2171d3>:0
2018-12-02T10:38:17.9486115Z INFO [12/02/18 10:38:17:94]
2018-12-02T10:38:17.9486280Z INFO [12/02/18 10:38:17:94] Attempting to show the current git graph (please include in issue):
2018-12-02T10:38:17.9486389Z INFO [12/02/18 10:38:17:94] Showing max of 100 commits
2018-12-02T10:38:19.1833171Z INFO [12/02/18 10:38:19:18] * ab7029a 7 hours ago (HEAD, origin/master)
2018-12-02T10:38:19.1834637Z * 3658a7c 8 hours ago (tag: 2.0.5)
2018-12-02T10:38:19.1834960Z * 303bb25 8 hours ago
2018-12-02T10:38:19.1835082Z * 03674a8 3 months ago
2018-12-02T10:38:19.1835194Z * bbbf873 3 months ago (tag: 2.0.3)
2018-12-02T10:38:19.1835351Z * 8dce322 3 months ago
2018-12-02T10:38:19.1835455Z * 8f32afc 3 months ago
2018-12-02T10:38:19.1835565Z * 01b5a51 3 months ago (tag: 2.0.2)
2018-12-02T10:38:19.1835711Z * bfb3ee9 3 months ago
2018-12-02T10:38:19.1835822Z * c3914c0 3 months ago
2018-12-02T10:38:19.1835928Z * 587d1d2 3 months ago
2018-12-02T10:38:19.1836070Z * 834d9e4 4 months ago (tag: 2.0.0)
2018-12-02T10:38:19.1836181Z * 3290867 4 months ago
2018-12-02T10:38:19.1836286Z |\
2018-12-02T10:38:19.1836734Z | * 84edd6e 4 months ago
2018-12-02T10:38:19.1837302Z | * e8ac764 4 months ago
2018-12-02T10:38:19.1838138Z | * 58ae5a6 4 months ago
2018-12-02T10:38:19.1838871Z | * 3f1033f 4 months ago
2018-12-02T10:38:19.1839722Z | * 35625fa 4 months ago
2018-12-02T10:38:19.1839931Z | * 518f8c2 4 months ago
2018-12-02T10:38:19.1840037Z |/
2018-12-02T10:38:19.1840184Z * fb7ed00 4 months ago
`

@asbjornu
Copy link
Member

asbjornu commented Dec 3, 2018

I suppose #1511 might be related and that an upgrade to LibGit2Sharp 0.26.0-preview-0070 might help. If anyone who are able to reproduce this issue can perform that upgrade locally and see if the problem goes away, that would be highly appreciated.

@Sam13
Copy link

Sam13 commented Mar 15, 2019

I had the same problem in a Ubuntu 16.04 Docker image with Mono.
A local build of https://github.com/magne/GitVersion/tree/upgrade-libgit2sharp fixed the problem.

So having LibGit2Sharp 0.26 would be appreciated

@asbjornu
Copy link
Member

@Sam13, I've rebased @magne's work in #1642, so let's see how that goes. If the build turns green, I'll merge it.

@pauldotknopf
Copy link

I just wanted to add, I'm getting issues running dotnet gitversion on Ubuntu 18.10. The issues with with a newer version of libcurl being on Ubuntu 18.10.

I downloaded libgit2-572e4d8.so from LibGit2Sharp.NativeBinaries version 2.0.267 and copied it to ~/.dotnet/tools/.store/gitversion.tool/5.0.0-beta2-61/gitversion.tool/5.0.0-beta2-61/tools/netcoreapp2.1/any/runtimes/linux-x64/native/libgit2-15e1193.so and the issue was resolved.

The latest libgit2 version doesn't depend on libcurl at all, so we shouldn't have these distro issues anymore.

@arturcic
Copy link
Member

I think this one is fixed with this version. In case it's still reproduceable please open the issue again

@asbjornu
Copy link
Member

Yes, this should hopefully be fixed by #1713. (Referencing the issue to get issue links)

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

No branches or pull requests

8 participants