Skip to content

[Improvement] The executable 'git' could not be found #543

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
GeertvanHorrik opened this issue Jul 28, 2015 · 11 comments
Closed

[Improvement] The executable 'git' could not be found #543

GeertvanHorrik opened this issue Jul 28, 2015 · 11 comments

Comments

@GeertvanHorrik
Copy link
Contributor

Haven't really dug into this problem, but it's related to #542 (I found this out via that issue):

INFO [07/28/15 11:14:12:11] Here is the current git graph (please include in issue): 
INFO [07/28/15 11:14:12:11] Showing max of 100 commits
INFO [07/28/15 11:14:12:11] Could not execute 'git log' due to the following error:
System.IO.FileNotFoundException: The executable file 'git' could not be found.
File name: 'git' ---> System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at GitVersion.Helpers.ProcessHelper.Start(ProcessStartInfo startInfo) in c:\projects\gitversion\src\GitVersionCore\Helpers\ProcessHelper.cs:line 26
at GitVersion.Helpers.ProcessHelper.Start(ProcessStartInfo startInfo) in c:\projects\gitversion\src\GitVersionCore\Helpers\ProcessHelper.cs:line 40
at GitVersion.Helpers.ProcessHelper.Run(Action`1 output, Action`1 errorOutput, TextReader input, String exe, String args, String workingDirectory, KeyValuePair`2[] environmentalVariables) in c:\projects\gitversion\src\GitVersionCore\Helpers\ProcessHelper.cs:line 85
at GitVersion.LibGitExtensions.DumpGraph(String workingDirectory, Action`1 writer, Nullable`1 maxCommits) in c:\projects\gitversion\src\GitVersionCore\LibGitExtensions.cs:line 192

Maybe the path determination should be improved a bit?

@JakeGinnivan
Copy link
Contributor

Currently assume git is installed on the %PATH%, is git actually installed on the box which had the error?

@GeertvanHorrik
Copy link
Contributor Author

To be honest git isn't installed on any of my build agents.

@GeertvanHorrik
Copy link
Contributor Author

Maybe we can investigate if we really need git.exe for this or if we can use libgit2sharp as well.

@JakeGinnivan
Copy link
Contributor

This is not possible unless we re implement the graph drawing stuff from log.

@JakeGinnivan
Copy link
Contributor

This is not required for any core parts of gitversion, it is only when there is an unhandled exception, we attempt to dump out a git log showing the current state of the repo which can help with debugging

@ghost
Copy link

ghost commented Aug 24, 2015

That error message is a bit misleading. We use TeamCity and I forgot to select

VCS checkout mode: Automatically on agent.

By default it will checkout on server --> the build agent has not local .git directory.

@JakeGinnivan
Copy link
Contributor

Can you paste your logs, I thought we detected that condition and gave a decent error message.

I will improve the error message around the missing git exe as well, its causing a lot of confusion

@ghost
Copy link

ghost commented Aug 24, 2015

NuGet: GitVersion.CommandLine (3.0.2)

Sorry, German region settings:

INFO [08/24/15 15:27:29:19] Working directory: C:\BuildAgent\work\88ea5793095502ba
ERROR [08/24/15 15:27:29:23] An unexpected error occurred:
System.ArgumentNullException: Der Wert darf nicht NULL sein.
Parametername: path
   bei System.IO.Directory.GetParent(String path)
   bei GitVersion.GitPreparer.GetProjectRootDirectory() in c:\projects\gitversion\src\GitVersionCore\GitPreparer.cs:Zeile 108.
   bei GitVersion.ExecuteCore.ExecuteGitVersion(IFileSystem fileSystem, String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId) in c:\projects\gitversion\src\GitVersionCore\ExecuteCore.cs:Zeile 15.
   bei GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem) in c:\projects\gitversion\src\GitVersionExe\SpecifiedArgumentRunner.cs:Zeile 22.
   bei GitVersion.Program.VerifyArgumentsAndRun() in c:\projects\gitversion\src\GitVersionExe\Program.cs:Zeile 90.
INFO [08/24/15 15:27:29:23]
INFO [08/24/15 15:27:29:23] Here is the current git graph (please include in issue):
INFO [08/24/15 15:27:29:23] Showing max of 100 commits
INFO [08/24/15 15:27:29:24] Could not execute 'git log' due to the following error: System.IO.FileNotFoundException: The executable file 'git' could not be found.
Dateiname: 'git' ---> System.ComponentModel.Win32Exception (0x80004005): Das System kann die angegebene Datei nicht finden
   bei System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   bei System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   bei GitVersion.Helpers.ProcessHelper.Start(ProcessStartInfo startInfo) in c:\projects\gitversion\src\GitVersionCore\Helpers\ProcessHelper.cs:Zeile 26.
   bei GitVersion.Helpers.ProcessHelper.Start(ProcessStartInfo startInfo) in c:\projects\gitversion\src\GitVersionCore\Helpers\ProcessHelper.cs:Zeile 40.
   bei GitVersion.Helpers.ProcessHelper.Run(Action`1 output, Action`1 errorOutput, TextReader input, String exe, String args, String workingDirectory, KeyValuePair`2[] environmentalVariables) in c:\projects\gitversion\src\GitVersionCore\Helpers\ProcessHelper.cs:Zeile 85.
   bei GitVersion.LibGitExtensions.DumpGraph(String workingDirectory, Action`1 writer, Nullable`1 maxCommits) in c:\projects\gitversion\src\GitVersionCore\LibGitExtensions.cs:Zeile 192.

@JakeGinnivan
Copy link
Contributor

We need to get a test around that.. thats a regression :( Will get it fixed

@ghost
Copy link

ghost commented Aug 24, 2015

Wait.. there is a new version 3.1.0 from last weekend.. let me check this first :-)

@ghost
Copy link

ghost commented Aug 24, 2015

Nope, same problem with 3.1.0.

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

2 participants