MINGW-packages icon indicating copy to clipboard operation
MINGW-packages copied to clipboard

git error: "fatal: BUG: disabling cancellation: Invalid argument"

Open neclepsio opened this issue 7 years ago • 50 comments

Since some updates, when I try to use git pull I get the error fatal: BUG: disabling cancellation: Invalid argument. I use a proxy.

neclepsio avatar Feb 06 '18 10:02 neclepsio

Reinstallation seemed to fix, but the problem reappeared and this time reinstallation doesn't fix. The problem is present even if the proxy configuration is deleted.

neclepsio avatar Feb 06 '18 11:02 neclepsio

Tracked upstream as git-for-windows/git#1481.

pal1000 avatar Feb 06 '18 20:02 pal1000

The error message is different. Are you sure it's the same problem?

neclepsio avatar Feb 06 '18 20:02 neclepsio

Yes the error messages are related. Differences are only made by presence and absence of proxy and probably Git for Windows running in a slimmer MSYS2 environment. The best we can do is go back to 2,16.1.1.

pal1000 avatar Feb 06 '18 21:02 pal1000

Same problem here with git version 2.16.2. pull, push, log all give the error message "fatal: BUG: disabling cancellation: Invalid argument". If I use the msys2.exe shell they work but in cmd.exe the error message occurs

henkman avatar Feb 22 '18 16:02 henkman

I can't repro. I don't know what happens at your end.

pal1000 avatar Feb 23 '18 16:02 pal1000

Just found out that it works in cmd.exe if you have msys2.exe running but not using it. As soon as you close the msys2 shell - boom it does not work anymore. So there is some interprocess communication involved with either bash.exe or mintty.exe

henkman avatar Feb 23 '18 16:02 henkman

It seems the problem was solve upstream. Will there be a new package for msys2 available? I'm running 2.16.2 (64bit) and I'm still having the described problem.

sroller avatar Mar 23 '18 21:03 sroller

Just found out that it works in cmd.exe if you have msys2.exe running but not using it. As soon as you close the msys2 shell - boom it does not work anymore.

Same on me with MSYS2, git-2.17.0. I need to have msys2 or mingw64/32 windows open, or certain git commands (ie git log, diff ) fail with the above error. But git --version or git status add run fine.

Very strange.

ankostis avatar Apr 25 '18 19:04 ankostis

@sroller, 2.17.0 is available but is not posted here for some reason. A more direct link would be: https://github.com/git-for-windows/git/releases/latest.

pal1000 avatar Apr 25 '18 20:04 pal1000

I note that the problem happens also with older git version 2.15.0.

ankostis avatar Apr 25 '18 20:04 ankostis

Any news on this? This bug keeps nagging me even in git 2.18.0. The same constellation (my MSys2 installation is run from a USB drive) works with Windows 7 while it fails in Windows 10 (1709).

axbender avatar Jul 27 '18 09:07 axbender

In my case this was caused by a path to a different instance of msys64 preceding a path to the Git binaries in the PATH environment variable. Removing the path to msys64 fixed the problem.

dmytrol avatar Sep 11 '18 15:09 dmytrol

@dmytrol's solution fixed it for me, I removed the msys64 from PATH and after rebooting, git works again.

rcorvus avatar Sep 11 '18 15:09 rcorvus

dmytrol's solution DID NOT fix for me, as the path was right.

In my case as henkman writes it works in cmd.exe if msys window is open (https://github.com/Alexpux/MINGW-packages/issues/3351#issuecomment-368065275).

neclepsio avatar Sep 12 '18 08:09 neclepsio

Hi All,

Downgrading the version of git to 2.16.1 helps this issue, one can downgrade the Git version by downloading and installing the same in Windows.

link;- https://github.com/git-for-windows/git/releases/tag/v2.16.1.windows.1

Regards, Anujay

Anujay-Saraf avatar Nov 20 '18 10:11 Anujay-Saraf

@wangxuesong29 Could you please detail on what you mean exactly?

axbender avatar Jul 07 '19 11:07 axbender

@wangxuesong29

Hi! Unfortunately this doesn't work on my end... Also, please consider: a) Git works w/o problems on Windows 7 using the exact same configuration (USB drive). b) Adding an EXE to your PATH environment variable is useless (it's no path); the system will not honor it (lest your "msys2.exe" is a path... ;-).

Once I read something about Windows 10 having problems with the relocation addresses of MSys2 executables. I followed the recipe, but it wouldn't work either. I'm still at loss...

axbender avatar Jul 08 '19 05:07 axbender

Still we have not isolated the root-cause of the issue, and why one installation affects the other.

ankostis avatar Jul 10 '19 10:07 ankostis

No double installation here, just MSys2's git...

axbender avatar Jul 10 '19 19:07 axbender

Just msys2 installation for me, and it doesn't work from any shell if msys2 shell is not open. But if I open a msys2 shell, it works even from every shell.

neclepsio avatar Jul 10 '19 20:07 neclepsio

I see the same behavior as @neclepsio. git fetch works if I have a Mintty Bash window open (MSYS2 or Ming2-w64 64bit), and fails with

> git fetch
BUG: run-command.c:519: disabling cancellation: Invalid argument

otherwise. I'm on Windows 10, I use a proxy as well, and:

> git --version
git version 2.24.0
> which git
/usr/bin/git

gbrunick avatar Dec 17 '19 15:12 gbrunick

I have no clue about the underlying causes, but if it helps someone I was facing this issue (fatal: BUG disabling cancellation: Invalid argument when trying to run git branch --merged) and it was fixed by following @wangxuesong29's suggestion (ie: removing c:\msys64\usr\bin from path). Not sure what the consequences of this for other applications might be though...

4sfaloth avatar Feb 05 '20 23:02 4sfaloth

Are you sure there is no other git.exe in your path?

sroller avatar Feb 06 '20 02:02 sroller

Are you sure there is no other git.exe in your path?

I cannot guarantee that. I can only say that I was experiencing the fatal: BUG described above when trying to run git branch --merged and that it was fixed by removing c:\msys64\usr\bin from the path as per @wangxuesong29 suggestion

4sfaloth avatar Feb 11 '20 03:02 4sfaloth

No "double" git.exe here; however, in my MSys2 installation there's a hard link between /usr/bin/git.exe and /bin/git.exe, and there's a /mingw64/bin/git which calls /usr/bin/git. I renamed/copied/... several combinations but the error remains (other than in Windows 7)

axbender avatar Feb 12 '20 15:02 axbender

No "double" git.exe here; however, in my MSys2 installation there's a hard link between /usr/bin/git.exe and /bin/git.exe, and there's a /mingw64/bin/git which calls /usr/bin/git. I renamed/copied/... several combinations but the error remains (other than in Windows 7)

There's no /bin directory in MSYS2.

StarWolf3000 avatar Feb 13 '20 06:02 StarWolf3000

Hm, I'm tempted to say "you're wrong" (as I do have a /bin and a /usr/bin directory), but may be this is the core of the problem. Here both directories are hardlinked. How would I get rid of this association? Just rm -rf /bin seems to be too dangerous...

axbender avatar Feb 13 '20 08:02 axbender

Addendum: /bin does not exist outside of MSys2 (e.g. using Windows Explorer), but is visible inside of mintty.

axbender avatar Feb 13 '20 09:02 axbender

According to the mount command, /bin is mounted from /usr/bin so doing the rm -rf /bin would kill your MSYS2 environment, except for bash.exe, mintty.exe, rm.exe and several dlls.

StarWolf3000 avatar Feb 13 '20 09:02 StarWolf3000