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

GetBuildVersion task fails with ArgumentNullException #870

Closed
dfederm opened this issue Dec 5, 2022 · 0 comments
Closed

GetBuildVersion task fails with ArgumentNullException #870

dfederm opened this issue Dec 5, 2022 · 0 comments
Assignees
Milestone

Comments

@dfederm
Copy link

dfederm commented Dec 5, 2022

The "Nerdbank.GitVersioning.Tasks.GetBuildVersion" task failed unexpectedly.
System.ArgumentNullException: Array cannot be null.
Parameter name: bytes
   at System.Text.Encoding.GetString(Byte* bytes, Int32 byteCount)
   at Nerdbank.GitVersioning.ManagedGit.GitRepository.GetString(ReadOnlySpan`1 bytes)
   at Nerdbank.GitVersioning.ManagedGit.GitCommitReader.TryReadAuthor(ReadOnlySpan`1 line, GitSignature& signature)
   at Nerdbank.GitVersioning.ManagedGit.GitCommitReader.Read(ReadOnlySpan`1 commit, GitObjectId sha, Boolean readAuthor)
   at Nerdbank.GitVersioning.ManagedGit.GitCommitReader.Read(Stream stream, GitObjectId sha, Boolean readAuthor)
   at Nerdbank.GitVersioning.ManagedGit.GitRepository.GetCommit(GitObjectId sha, Boolean readAuthor)
   at Nerdbank.GitVersioning.Managed.ManagedGitContext.get_GitCommitDate()
   at Nerdbank.GitVersioning.Tasks.GetBuildVersion.ExecuteInner()
   at MSBuildExtensionTask.ContextAwareTask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

I can share the specific commit offline, but the issue seems to be due to the author not having a proper email address (it's a service principal in Azure DevOps). ie the "git log" shows: Author: Something <> (where "Something" is some other redacted string).

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

No branches or pull requests

2 participants