# git-http-backend errors under IIS

1 messages from 2024-09-02 to 2024-09-02. Participants: forums@hyper-plaza.com.
Thread: https://gitlist.dev/t/62040

## forums@hyper-plaza.com, 2024-09-02 20:18

Subject: git-http-backend errors under IIS
Message-ID: <001301dafd75$3f95bdf0$bec139d0$@hyper-plaza.com>
URL: https://gitlist.dev/e/001301dafd75%243f95bdf0%24bec139d0%24%40hyper-plaza.com

```
Im getting errors trying to execute simple git clone from IIS-hosted
git-http-backend to a local folder.

Setup:
Host: fresh install of x64 Windows Server 2022 Standard on i7-11700K @
3.60GHz with 32GB RAM & 2x 1TB SSD drives, named zeus, IIS version 10.0.
Host has the latest 64-bit git version 2.46.0.windows.1
Client: either the same machine or Hyper-V VM on the same box with 1 Virtual
CPU & 4GB of RAM running Windows 10 Enterprise LTSC 21H2. VM has 64-bit git
version 2.37.0.windows.1

IIS is configured with dedicated git website running on port 80 with its
own app pool and local git user as identity. Therere no other sites on
that port and I stopped the rest of the sites anyway. The site has Anonymous
authentication disabled and Basic Authentication enabled with CGI
Impersonation True

Test git repository myproject.git was initialized from command window in the
host folder pointed to by IIS git website using command:
git init --bare myproject.git using git version 2.46.0

Test case 1:
git clone http://zeus/myproject.git executed from the host command window
using test user credentials results in error:
>fatal: http://zeus/myproject.git/info/refs not valid: could not determine
hash algorithm; is this a git repository?<

Please note the path myproject.git/info/refs doesnt even exist in the repo,
the folder myproject.git/info/ contains single file exclude and nothing
else. 

Test case 2:
git clone http://zeus/myproject.git executed from the VM command window
using test user credentials results in error:
>fatal: unable to access 'http://zeus/myproject.git/': Header without colon<

If I execute the above commands with host Administrator credentials they
both succeed with correct warning (the repo was just initialized):
>warning: You appear to have cloned an empty repository.<

So far the issue sounds like some permissions problem, especially taking
into account when I tried to make test user member of the host
Administrators group both commands worked after iisreset.
Unfortunately I was unable to figure out what permission(s) are missing, the
user clearly passes authentication step and executes git-http-backend.exe as
I had different error when it was unable to.

What is really odd if I downgrade git version on the host to 2.44.0 then
everything starts working as expected for the test user as well even after I
removed it from Administrators group and performed iisreset, the rest was
the same:  the site / permissions / etc

I actually started from version 2.37.0 thinking may be it would make a
difference as I recalled the similar set up was working under 2.37.0 and to
my great surprise it worked indeed. Then I decided to upgrade the version
and 2.44.0 was the latest one that worked from the versions I tried. I
believe I also tried 2.45.2 and it gave the same errors as 2.46.0 so I left
it at 2.44.0. I didnt try any other version between 2.44.0 and 2.45.2.

Since this issue misleadingly looks like permission one and the error
messages are really odd and it cost me a day to troubleshoot I decided to
publish it here to possibly spare someone major headache.

Please let me know if Im missing something obvious or if its indeed a bug
that very well may be specific to my environment which triggers some racing
condition in the code. 
If theres an interest in tracing this problem further I can easily
reproduce it as the system is not used for Production. The Portable version
2.46.0 has the same problem so switching back and forth between versions is
really simple, I just replace content of the git folder with another
version.

Thanks,
Michael.




```
