Skip to content

Windows Sever 2008 R2 graceful handing of pre-receive hooks #1927

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
JayD123 opened this issue Nov 12, 2018 · 6 comments
Closed

Windows Sever 2008 R2 graceful handing of pre-receive hooks #1927

JayD123 opened this issue Nov 12, 2018 · 6 comments
Labels

Comments

@JayD123
Copy link

JayD123 commented Nov 12, 2018

Git version - git version 2.11.1.windows.1
OS - Windows Server 2008 R2 machine.

pre-receive hooks does not work. Throws the following exception

Counting objects: 2, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 257 bytes | 0 bytes/s, done.
Total 2 (delta 0), reused 0 (delta 0)
remote:       0 [main] sh 5764 D:\git\installation\Git\usr\bin\sh.exe: *** fatal error - add_item ("\??\D:\git\installation\Git", "/", ...) failed, errno 1
remote: Stack trace:
remote: Frame        Function    Args
remote: 000FFFF9BB0  0018005CCCE (00180241542, 0018021EC39, 000FFFF9BB0, 000FFFF8B30)
remote: 000FFFF9BB0  00180046419 (000FFFFABE6, 000FFFF9BB0, 1D4755E137B33C4, 00000000000)
remote: 000FFFF9BB0  00180046452 (000FFFF9BB0, 00000000001, 000FFFF9BB0, 675C3A445C3F3F5C)
remote: 000FFFF9BB0  001800CB8AB (00000000000, 000FFFFCE00, 001800BB2D8, 1D4755E1C6C0544)
remote: 000FFFFCC00  001801195B5 (00000000000, 00000000000, 001800B39DE, 00000000000)
remote: 000FFFFCCC0  00180046A45 (00000000000, 00000000000, 00000000000, 00000000000)
remote: 00000000000  001800456B3 (00000000000, 00000000000, 00000000000, 00000000000)
remote: 000FFFFFFF0  00180045764 (00000000000, 00000000000, 00000000000, 00000000000)
remote: End of stack trace
remote: warning: updating the current branch
@JayD123 JayD123 changed the title Git for Windows - Pre receive hook not working in Windows Sever 2008 R2 Windows Sever 2008 R2 graceful handing of pre-receive hooks Nov 12, 2018
@dscho
Copy link
Member

dscho commented Nov 13, 2018

Git version - git version 2.11.1.windows.1

Please try a current version.

fatal error - add_item ("??\D:\git\installation\Git", "/", ...) failed, errno 1

Please search the issues (open and closed) for this symptom ("add_item", I am sure I saw this at least once before).

@JayD123
Copy link
Author

JayD123 commented Nov 29, 2018

I upgraded to 2.19.1 but I still get the same exception. I noticed that the sh.exe process max'es out before I get the above exception for something as simple as

#!D:/git/installation/Git-2.19.1-64-bit/usr/bin/sh.exe
echo "Test"
exit 1

I think it has something to do some inteference with sh.exe and could be local to my Window Server OS. You can close out this ticket, I just need to figure out what is messing up sh.exe

@JayD123
Copy link
Author

JayD123 commented Nov 29, 2018

I used Windows process explorer and it looks like some windows functions was messing up sh.exe. Reordered the Path variable and the server side hooks started working. I read in a couple of stackoverflow posts that issue is mainly for 64-bit installer.

@dscho Can I close this issue or is there a fix needed ?

https://stackoverflow.com/questions/47823054/sh-exe-stackdump-when-use-git-stash/53546463#53546463

@dscho
Copy link
Member

dscho commented Nov 30, 2018

Reordered the Path variable and the server side hooks started working

Was C:\Windows\system32 in your PATH before Git's usr\bin? If so, how did that happen?

Can I close this issue or is there a fix needed ?

If you want, you can close it. I would still like to find out how the PATH could end up causing these exceptions. That usually only happens if some internal Windows <-> Unix-y path conversion in the MSYS2 runtimes hits a buggy code path.

In any case, the good news is that git stash is already available as a built-in command in Git for Windows v2.19.1, but it is marked experimental. "Built-in" in this case means that it no longer uses the MSYS2 runtime that showed these exceptions. In v2.20.0, it is no longer experimental and switched on by default.

@JayD123
Copy link
Author

JayD123 commented Dec 21, 2018

It was the following

C:\Program Files (x86)\Python37-32\Scripts;C:\Program Files (x86)\Python37-32;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\HP\HP BTO Software\lib;C:\Program Files\HP\HP BTO Software\bin;C:\Program Files\HP\HP BTO Software\bin\win64;C:\Program Files\HP\HP BTO Software\bin\win64\OpC; D:\Program Files\Java\jdk1.8.0_121\bin;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Puppet Labs\Puppet\bin;C:\ProgramData\chocolatey\bin;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\WindowsPowerShell\v1.0;D:\git\installation\Git-2.19.1-64-bit\cmd;D:\git\installation\Git-2.19.1-64-bit\mingw64\bin;D:\git\installation\Git-2.19.1-64-bit\usr\bin

I had to change it to the following to get it to work

D:\git\installation\Git-2.19.1-64-bit\cmd;D:\git\installation\Git-2.19.1-64-bit\mingw64\bin;D:\git\installation\Git-2.19.1-64-bit\usr\bin ;C:\Program Files (x86)\Python37-32\Scripts;C:\Program Files (x86)\Python37-32;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\HP\HP BTO Software\lib;C:\Program Files\HP\HP BTO Software\bin;C:\Program Files\HP\HP BTO Software\bin\win64;C:\Program Files\HP\HP BTO Software\bin\win64\OpC; D:\Program Files\Java\jdk1.8.0_121\bin;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Puppet Labs\Puppet\bin;C:\ProgramData\chocolatey\bin;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\WindowsPowerShell\v1.0\

@dscho
Copy link
Member

dscho commented Feb 26, 2019

I guess that means that one of the other PATH components also contains a msys-2.0.dll that is incompatible with Git for Windows' copy? My hunch would be that C:\ProgramData\chocolatey\bin and/or C:\Program Files\Puppet Labs\Puppet\bin might be candidates for that.

In any case, calling Git via D:\git\installation\Git-2.19.1-64-bit\cmd\git.exe should fix this issue, as it will prepend Git's bin directories to the PATH for the git.exe process and its spawned processes, which should make it find the .dll and .exe files expected by Git for Windows.

@dscho dscho closed this as completed Feb 26, 2019
@dscho dscho added the question label Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants