git-for-windows / git

A fork of Git containing Windows-specific patches.
http://gitforwindows.org/
Other
8.38k stars 2.54k forks source link

git error #4748

Open venus-Liu opened 10 months ago

venus-Liu commented 10 months ago

git version:2.43.0 windows:win11 error log: warning: failed to restrict file handles (5)

handle #0: 000000000000018c (type 3, handle info (1) 0 handle #1: 0000000000000190 (type 3, handle info (1) 1 handle #2: 000000000000015c (type 2, handle info (1) 1

This is a bug; please report it at https://github.com/git-for-windows/git/issues/new

To suppress this warning, please set the environment variable

    SUPPRESS_HANDLE_INHERITANCE_WARNING=1

git credential-manager get: line 1: /mingw64/libexec/git-core/git: Permission denied 0 [bash] bash 1027 dofork: child -1 - CreateProcessW failed for 'D:\Git\usr\bin\bash.exe', errno 13 bash: fork: Permission denied error: failed to execute prompt script (exit code 254) fatal: could not read Username for 'https://XXXXXXXX': No such file or directory

dscho commented 10 months ago

Can you provide some background? Like, what your setup looks like, what command you ran, etc.

zeeshan-k commented 6 months ago

Can you provide some background? Like, what your setup looks like, what command you ran, etc.

Sorry for jumping on someone else's thread, BUT I faced the same issue so thought of adding some context here since the OP hasn't since a long time.

The warning was a one off thing, it never happened before on the same version of Git, and it never happened after. Although I tried reproducing the same warning again.

Environment: Repo is hosted on Github Enterprise, I am using git for windows on my local development environment (Windows 11). Versions are mentioned in the end, and it is restricted by organization's policy hence I can't upgrade on my own.

What I did: I did a git push --force and it worked. Then I added a few file changes (just some whitespaces cleanup, no other big change), amended the last commit and did the git push --force again which resulted into this warning. When I look in the github web UI, the git push appears to have been pushed. Although the git for windows CLI gave me warnings. Below is the CLI dump (sensitive/user specific information may have been removed):


$ git push zeeshan master --force Enumerating objects: 11, done. Counting objects: 100% (11/11), done. Delta compression using up to 8 threads Compressing objects: 100% (6/6), done. Writing objects: 100% (6/6), 7.87 KiB | 1.12 MiB/s, done. Total 6 (delta 5), reused 0 (delta 0), pack-reused 0 (from 0) remote: Resolving deltas: 100% (5/5), completed with 5 local objects. To https://github.xxxxxx.corp/xxxxxx/xxxx.git

@ MINGW64 ~/git/xxxx (master) $ `git add .` @ MINGW64 ~/git/xxxx (master) $ `git commit --amend` [master 3714ef3] Date: Tue May 7 11:11:28 2024 +0530 4 files changed, 1183 insertions(+), 1128 deletions(-) @ MINGW64 ~/git/xxxx (master) $ `git push zeeshan master --force` warning: failed to restrict file handles (5) handle #0: 0000000000000164 (type 3, handle info (1) 0 handle #1: 0000000000000168 (type 3, handle info (1) 1 handle #2: 0000000000000420 (type 3, handle info (1) 1 This is a bug; please report it at https://github.com/git-for-windows/git/issues/new To suppress this warning, please set the environment variable SUPPRESS_HANDLE_INHERITANCE_WARNING=1 Enumerating objects: 11, done. Counting objects: 100% (11/11), done. Delta compression using up to 8 threads Compressing objects: 100% (6/6), done. Writing objects: 100% (6/6), 7.87 KiB | 474.00 KiB/s, done. Total 6 (delta 5), reused 0 (delta 0), pack-reused 0 (from 0) remote: Resolving deltas: 100% (5/5), completed with 5 local objects. To https://github.xxxxxx.corp/xxxxxx/xxxx.git + 16b9306...3714ef3 master -> master (forced update) $ `git -v` git version 2.44.0.windows.1 Github: GitHub Enterprise Server 3.11.7