Skip to content

Problem with 1.2.0 release of GitVersion #246

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

Closed
gep13 opened this issue Aug 20, 2014 · 16 comments
Closed

Problem with 1.2.0 release of GitVersion #246

gep13 opened this issue Aug 20, 2014 · 16 comments
Milestone

Comments

@gep13
Copy link
Member

gep13 commented Aug 20, 2014

I have just upgraded my build server (TeamCity) to use the latest release of GitVersion.Portable from Chocolatey.org, and I am now seeing this failure in the TeamCity Build Log:

[07:37:01][Step 1/5] Step 1/1: GitVersion (Powershell) (1s)

[07:37:01][Step 1/1] Starting:  C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive -ExecutionPolicy ByPass -File C:\TeamCity\buildAgent\temp\buildTmp\powershell6252309034209318036.ps1

[07:37:01][Step 1/1] in directory: C:\TeamCity\buildAgent\work\a52e278acd0e90b

[07:37:01][Step 1/1] Chocolatey already installed

[07:37:01][Step 1/1] GitVersion already installed

[07:37:01][Step 1/1] Running: C:\ProgramData\chocolatey\bin\gitversion.exe "C:\TeamCity\buildAgent\work\a52e278acd0e90b" /output "buildserver"

[07:37:01][Step 1/1] Working directory: C:\TeamCity\buildAgent\work\a52e278acd0e90b

[07:37:01][Step 1/1] Applicable build agent found: 'TeamCity'.

[07:37:02][Step 1/1] One remote found (origin -> '****.git').

[07:37:02][Step 1/1] Fetching from remote 'origin' using the following refspecs: +refs/heads/*:refs/remotes/origin/*.

[07:37:02][Step 1/1] An unexpected error occurred:

[07:37:02][Step 1/1] LibGit2Sharp.LibGit2SharpException: Failed to mmap. Invalid handle value: The volume for a file has been externally altered so that the opened file is no longer valid.

[07:37:02][Step 1/1] 

[07:37:02][Step 1/1]    at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)

[07:37:02][Step 1/1]    at LibGit2Sharp.Core.Proxy.git_remote_fetch(RemoteSafeHandle remote, Signature signature, String logMessage)

[07:37:02][Step 1/1]    at LibGit2Sharp.Network.DoFetch(RemoteSafeHandle remoteHandle, FetchOptions options, Signature signature, String logMessage)

[07:37:02][Step 1/1]    at LibGit2Sharp.Network.Fetch(Remote remote, FetchOptions options, Signature signature, String logMessage)

[07:37:02][Step 1/1]    at GitVersion.GitHelper.NormalizeGitDirectory(String gitDirectory, Authentication authentication, String branch) in c:\BuildAgent\work\5e0d79a4e3943b17\GitVersionCore\BuildServers\GitHelper.cs:line 26

[07:37:02][Step 1/1]    at GitVersion.Program.Main() in c:\BuildAgent\work\5e0d79a4e3943b17\GitVersionExe\Program.cs:line 60

[07:37:02][Step 1/1] Working directory: C:\TeamCity\buildAgent\work\a52e278acd0e90b

[07:37:02][Step 1/1] Applicable build agent found: 'TeamCity'.

[07:37:02][Step 1/1] One remote found (origin -> '****.git').

[07:37:02][Step 1/1] Fetching from remote 'origin' using the following refspecs: +refs/heads/*:refs/remotes/origin/*.

[07:37:02][Step 1/1] An unexpected error occurred:

[07:37:02][Step 1/1] LibGit2Sharp.LibGit2SharpException: Failed to mmap. Invalid handle value: The volume for a file has been externally altered so that the opened file is no longer valid.

[07:37:02][Step 1/1] 

[07:37:02][Step 1/1]    at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)

[07:37:02][Step 1/1]    at LibGit2Sharp.Core.Proxy.git_remote_fetch(RemoteSafeHandle remote, Signature signature, String logMessage)

[07:37:02][Step 1/1]    at LibGit2Sharp.Network.DoFetch(RemoteSafeHandle remoteHandle, FetchOptions options, Signature signature, String logMessage)

[07:37:02][Step 1/1]    at LibGit2Sharp.Network.Fetch(Remote remote, FetchOptions options, Signature signature, String logMessage)

[07:37:02][Step 1/1]    at GitVersion.GitHelper.NormalizeGitDirectory(String gitDirectory, Authentication authentication, String branch) in c:\BuildAgent\work\5e0d79a4e3943b17\GitVersionCore\BuildServers\GitHelper.cs:line 26

[07:37:02][Step 1/1]    at GitVersion.Program.Main() in c:\BuildAgent\work\5e0d79a4e3943b17\GitVersionExe\Program.cs:line 60

[07:37:02][Step 1/1] ##teamcity[buildStatus text='Error running GitVersion' status='FAILURE']

[07:37:02][Step 1/1] Error running GitVersion

I should mention that I am using the MetaRunner for GitVersion that was created by @robdmoore, but I don't think that this is the issue.

Based on the error message, I thought it could be an issue with a modification to the AssemblyInfo files causing a problem, so I removed that as a test, but I get the same error for both.

Any thoughts on what could be going on here?

Thanks!

@gep13
Copy link
Member Author

gep13 commented Aug 20, 2014

Actually, this is the same issue as I was seeing here in #226 which I thought was down to a modified version of GitVersion that I was using. Seeing this even with the official release. I will close the other issue, sorry for duplicate.

@gep13
Copy link
Member Author

gep13 commented Aug 20, 2014

When I originally raised this issue, @SimonCropp called out to @nulltoken for some help. Can either of you help with this? Is there something wrong with my repo? Is there any additional information I can provide to help solve this issue?

For now, I am going to fall back to using the older version of GitVersion, but I would like to move onto the new released version as soon as possible as I would like to take advantage of some of the newer features. Thanks!

@gep13
Copy link
Member Author

gep13 commented Aug 20, 2014

Looks like someone else, unrelated to GitVersion is also seeing this issue:

http://stackoverflow.com/questions/25378038/libgit2sharp-clone-fails-with-libgit2sharpexception-failed-to-mmap

@gep13
Copy link
Member Author

gep13 commented Aug 20, 2014

To confirm, I have just rolled back to version 1.0.0 of GitVersion, and it generates the following:

[08:12:47][Step 1/1] Starting:  C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive -ExecutionPolicy ByPass -File C:\TeamCity\buildAgent\temp\buildTmp\powershell7026762816251497676.ps1

[08:12:47][Step 1/1] in directory: C:\TeamCity\buildAgent\work\a52e278acd0e90b

[08:12:49][Step 1/1] Chocolatey already installed

[08:12:49][Step 1/1] GitVersion already installed

[08:12:49][Step 1/1] Running: C:\ProgramData\chocolatey\bin\gitversion.exe "C:\TeamCity\buildAgent\work\a52e278acd0e90b" /output "buildserver"

[08:12:49][Step 1/1] Working directory: C:\TeamCity\buildAgent\work\a52e278acd0e90b

[08:12:49][Step 1/1] Applicable build agent found: 'TeamCity'.

[08:12:49][Step 1/1] One remote found (origin -> '******.git').

[08:12:49][Step 1/1] Fetching from remote 'origin' using the following refspecs: +refs/heads/*:refs/remotes/origin/*.

[08:13:07][Step 1/1] Skipping local branch creation since it already exists 'refs/remotes/origin/develop'.

[08:13:07][Step 1/1] Creating local branch from remote tracking 'refs/remotes/origin/feature/GSA-14'.

[08:13:07][Step 1/1] Creating local branch from remote tracking 'refs/remotes/origin/feature/GSA-15'.

[08:13:07][Step 1/1] Creating local branch from remote tracking 'refs/remotes/origin/feature/GSA-16'.

[08:13:07][Step 1/1] Creating local branch from remote tracking 'refs/remotes/origin/master'.

[08:13:07][Step 1/1] Creating local branch from remote tracking 'refs/remotes/origin/PullRequestTest'.

[08:13:07][Step 1/1] HEAD points at branch 'refs/heads/develop'.

[08:13:07][Step 1/1] Version not in cache. Calculating version.

[08:13:07][Step 1/1] Running against branch: develop

[08:13:07][Step 1/1] GitFlow version strategy will be used

[08:13:07][Step 1/1] Executing GenerateSetVersionMessage for 'TeamCity'.

[08:13:07][Step 1/1] ##teamcity[buildNumber '0.3.0-unstable.22+22']

[08:13:07][Step 1/1] Executing GenerateBuildLogOutput for 'TeamCity'.

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.Major' value='0']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.Major' value='0']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.Minor' value='3']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.Minor' value='3']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.Patch' value='0']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.Patch' value='0']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.PreReleaseTag' value='unstable.22']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.PreReleaseTag' value='unstable.22']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.PreReleaseTagWithDash' value='-unstable.22']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.PreReleaseTagWithDash' value='-unstable.22']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.BuildMetaData' value='22']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.BuildMetaData' value='22']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.FullBuildMetaData' value='22.Branch.develop.Sha.59ce940a7e8758a81c3193843ec3ef2832bdf5f2']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.FullBuildMetaData' value='22.Branch.develop.Sha.59ce940a7e8758a81c3193843ec3ef2832bdf5f2']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.MajorMinorPatch' value='0.3.0']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.MajorMinorPatch' value='0.3.0']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.SemVer' value='0.3.0.22-unstable']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.SemVer' value='0.3.0.22-unstable']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.LegacySemVer' value='0.3.0-unstable22']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.LegacySemVer' value='0.3.0-unstable22']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.LegacySemVerPadded' value='0.3.0-unstable0022']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.LegacySemVerPadded' value='0.3.0-unstable0022']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.AssemblySemVer' value='0.3.0.0']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.AssemblySemVer' value='0.3.0.0']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.FullSemVer' value='0.3.0.22-unstable']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.FullSemVer' value='0.3.0.22-unstable']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.InformationalVersion' value='0.3.0-unstable.22+22.Branch.develop.Sha.59ce940a7e8758a81c3193843ec3ef2832bdf5f2']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.InformationalVersion' value='0.3.0-unstable.22+22.Branch.develop.Sha.59ce940a7e8758a81c3193843ec3ef2832bdf5f2']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.ClassicVersion' value='0.3.0.22']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.ClassicVersion' value='0.3.0.22']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.ClassicVersionWithTag' value='0.3.0.22-unstable.22']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.ClassicVersionWithTag' value='0.3.0.22-unstable.22']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.BranchName' value='develop']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.BranchName' value='develop']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.Sha' value='59ce940a7e8758a81c3193843ec3ef2832bdf5f2']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.Sha' value='59ce940a7e8758a81c3193843ec3ef2832bdf5f2']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.AssemblyVersion' value='0.3.0.0']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.AssemblyVersion' value='0.3.0.0']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.AssemblyFileVersion' value='0.3.0.0']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.AssemblyFileVersion' value='0.3.0.0']

[08:13:07][Step 1/1] ##teamcity[setParameter name='GitVersion.OriginalRelease' value='59ce940a7e8758a81c3193843ec3ef2832bdf5f2.2014-08-13 14:38:00Z']

[08:13:07][Step 1/1] ##teamcity[setParameter name='system.GitVersion.OriginalRelease' value='59ce940a7e8758a81c3193843ec3ef2832bdf5f2.2014-08-13 14:38:00Z']

[08:13:07][Step 1/1] Process exited with code 0

No other changes in the Build Configuration, or Repository, were made.

Any thoughts?

@nulltoken
Copy link
Contributor

When I originally raised this issue, @SimonCropp called out to @nulltoken for some help.

Sorry for that. It looks like I completely overlooked this call for help. 😿

To confirm, I have just rolled back to version 1.0.0 of GitVersion, and it generates the following:

That may hint at a regression at the libgit2 level. I'm afraid that without a repro case that will be very difficult to troubleshoot.

Would the repo you're working against be public or have you experienced similar problems with a public one which url you could share with us?

@gep13
Copy link
Member Author

gep13 commented Aug 20, 2014

Not a problem at all, thanks for getting in touch!

Unfortunately no, this repo is not a public one, so not in a position to share it :-( I have not seen this happen in any other public repo, but my coverage of using GitVersion is limited to my own internal repository.

What I can say is that this is relatively new repository, which was created in Stash.

I have just tested with Version 1.1.0 and 1.1.1 of GitVersion, and both of them result in the same error message, only version 1.0.0 seems to work correctly. I don't know if there was an upgrade of libgit2 between 1.0.0 and 1.1.0.

Any thoughts on how to proceed?

Thanks!

@gep13
Copy link
Member Author

gep13 commented Aug 20, 2014

@gep13
Copy link
Member Author

gep13 commented Aug 20, 2014

And it looks like GitVersion relies on new functionality within the latest version of LibGit2Sharp, so it is not even as though I can re-compile with a reference to the earlier version.

@nulltoken
Copy link
Contributor

Any thoughts on how to proceed?

Adding a comment to the SO question might help to get a potential public repository to work with.

Looks like LibGit2Sharp jumped from version 0.17.0.0 to 0.18.1.0 between Version 1.0.0 and 1.1.0 for GitVersion.

Which reduces the set to only 328 commits... Yeah! (@carlosmn any idea?)

libgit2/libgit2@06d772d...90befde

@gep13
Copy link
Member Author

gep13 commented Aug 20, 2014

Ha ha, somewhere to start anyway?

I have just tried to re-compile GitVersion with both 0.17.0.0 and 0.18.0.0, to try to narrow down further, but GitVersion relies on functionality in 0.18.1.0, so without modifying GitVersion, I can't reproduce.

Is there some small sample application that I could create to try to reproduce the error, taking GitVersion out of the equation? That way I could test on different version of LibGit2Sharp.

Should this issue really be moved to LibGit2Sharp?

I will go an post on StackOverflow just now.

@nulltoken
Copy link
Contributor

Should this issue really be moved to LibGit2Sharp?

I think it should be mainly handled in the LibGit2Sharp repo with libgit2/libgit2sharp#794. Once it's fixed there, we should eventually be able to close this one.

@carlosmn
Copy link

I suspect the workaround for Windows remote filesystem oddities, which introduced memory-mapped writing into the packfiles. I've commented with more detail in the libgit2sharp issue.

@gep13 from the stacktrace, any clone or fetch under the same conditions should be enough to trigger this issue.

@SimonCropp
Copy link
Contributor

@nulltoken should we roll back libgit in the short term?

@nulltoken
Copy link
Contributor

@SimonCropp From a GitVersion standpoint, I don't know the impact of moving GitVersion back to LibGit2Sharp v0.17.

With libgit2/libgit2sharp#794, we've been able to identify a repro case. It's possible one of the libgit2 team member may work on try and fixing it in the following days.

Proposal:

  • Let's get back to this on Monday. If it's fixed, I'll package a new LibGit2Sharp version and we'll upgrade GV.
  • Meanwhile, I'll start to work on a GitVersion PR that will revert to v0.17.

@SimonCropp
Copy link
Contributor

Sounds good

On 22 Aug 2014, at 5:46 pm, nulltoken [email protected] wrote:

@SimonCropp From a GitVersion standpoint, I don't know the impact of moving GitVersion back to LibGit2Sharp v0.17.

With libgit2/libgit2sharp#794, we've been able to identify a repro case. It's possible one of the libgit2 team member may work on try and fixing it in the following days.

Proposal:

Let's get back to this on Monday. If it's fixed, I'll package a new LibGit2Sharp version and we'll upgrade GV.
Meanwhile, I'll start to work on a GitVersion PR that will revert to v0.17.

Reply to this email directly or view it on GitHub.

@gep13
Copy link
Member Author

gep13 commented Aug 24, 2014

Looks like this is going to be covered in the new release of LibGit2Sharp:

libgit2/libgit2sharp#798

This will require pulling the new version into GitVersion when it is released. I have tested this on my Sample Application, using Stash as the target to Clone from, and I am happy to report that it is all working.

@SimonCropp SimonCropp added this to the 1.3.0 milestone Sep 3, 2014
@SimonCropp SimonCropp modified the milestones: 1.2.1, 1.3.0 Sep 24, 2014
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

4 participants