Skip to content

Commit 9d709b8

Browse files
authored
Merge pull request #8544 from MicrosoftDocs/main
Auto push to live 2025-03-24 02:00:02
2 parents be13e6c + 8188245 commit 9d709b8

2 files changed

Lines changed: 47 additions & 21 deletions

File tree

support/azure/devops/git-clone-push-operation-failing-devops-repo.md

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ title: Git clone or Git push fails to an Azure DevOps repository
33
description: This article discusses problems that might occur when you try to perform Git clone or Git push function to an Azure DevOps repository.
44
author: HaiyingYu
55
ms.author: haiyingyu
6-
ms.reviewer: kirt
6+
ms.reviewer: kirt, dmittal
77
ms.topic: troubleshooting
8-
ms.date: 05/19/2023
8+
ms.date: 03/24/2025
99
ms.service: azure-devops
1010
ms.custom: sap:Repos
1111
---
@@ -42,7 +42,7 @@ To learn more about Git environment variables, see [Git Internals - Environment
4242

4343
If you're using a proxy server but the Git configuration isn't set to connect through the proxy server, you might see the 407 or 502 error messages. This issue also occurs when the connection can't establish through the proxy server, and you see the errors similar to "unable to access <`your github url`\>:" or "couldn't resolve host `github.com`".
4444

45-
### Solution: Configure Git to use the proxy server
45+
### Recommendation: Configure Git to use the proxy server
4646

4747
Run `git config --list` to get a list of all the Git configuration on the system, and check whether the proxy server is in use.
4848

@@ -65,13 +65,13 @@ For more information on Git configuration, see [Git Config Documentation](https:
6565

6666
If Git is using a local self-signed certificate, you might see the error "SSL certificate problem: unable to get local issuer certificate."
6767

68-
### Solution 1: Disable the TLS/SSL verification
68+
### Recommendation 1: Disable the TLS/SSL verification
6969

7070
If you've installed a local Team Foundation Server (TFS) and if you want to disable the TLS/SSL verification that Git performs, run the following command:
7171

7272
`git config --global http.sslVerify false`
7373

74-
### Solution 2: Configure the self-signed certificates in Git
74+
### Recommendation 2: Configure the self-signed certificates in Git
7575

7676
If you want to continue the TLS/SSL verification that Git does, follow these steps to add the root certificate in the local Git:
7777

@@ -122,20 +122,44 @@ If you want to continue the TLS/SSL verification that Git does, follow these ste
122122

123123
If your account name or domain password has changed, or you're getting an authentication error, there could be authentication and credential cache issues.
124124

125-
### Solution: Reset the Git credentials manager (GCM)
125+
### Recommendation: Reset the Git credentials manager (GCM)
126126

127127
To resolve the authentication error or credentials cache issues, begin by following the [Troubleshooting checklist](#troubleshooting-checklist) to get the error information, and then follow these steps:
128128

129-
1. Run the `git config --list` command, and then check if you're using Git Credentials Manager (GCM). If the `credential.helper` is set to manager, then GCM is in use.
130-
1. Reset the GCM by following these steps:
129+
1. Run the `git config --list` command, and then check if you're using Git Credentials Manager (GCM). If the `credential.helper` is set to manager, GCM is in use.
130+
1. Follow these steps to reset the GCM:
131131
1. Run the `git config --global --unset credential.helper` command to unset the GCM.
132-
1. Run the `git config credential.helper manager` command to set the GCM back. Alternatively, follow these steps to delete the credentials cache first:
133-
1. When unset, search for **Credentials Manager** in Windows search, select **Open**, and then remove any credential that is for a Git repo.
134-
1. Go to _%localappdata%/GitCredentialManager_ path, and then delete the _tenant.cache_ file.
135-
1. Set the GCM back by running the `git config credential.helper manager` command.
132+
1. Run the `git config --global credential.helper manager` command to set the GCM back.
133+
134+
Alternatively, you can follow these steps to remove cached credentials:
135+
- On Windows, Git credentials are stored in the Windows Credential Manager. You can access it in the following ways:
136+
137+
- Using GUI (Windows Credential Manager):
138+
139+
1. Open Control Panel and select **User Accounts** > **Credential Manager**.
140+
1. Select **Windows Credentials**.
141+
1. Look for entries related to `git:https://dev.azure.com/<orgname>` or your Git provider and manage them. For github, it's like `git:https://github.com/`.
142+
143+
- Using command line:
144+
145+
1. Run `cmdkey /list | findstr "git"` to list Git credentials.
146+
1. Run `cmdkey /delete:https://dev.azure.com/<orgname>` to delete the credentials.
147+
1. If you need to reset credentials and re-enter them, run `git credential reject https://dev.azure.com/<orgname>`.
148+
149+
- On MacOS:
150+
151+
- `git credential reject https://dev.azure.com/<orgname>`
152+
153+
When you run this command, you're instructing Git to invalidate or remove the stored credentials for the specified URL. This means that the next time you try to access the repository at that URL, Git will prompt you to enter your credentials again. This is useful if you need to reset your credentials.
154+
155+
- `git credential approve https://dev.azure.com/<orgname>` to approve the credentials.
156+
157+
This command is used to manually store and approve credentials for future use, which ensures that you won't be prompted for credentials each time.
158+
136159
1. Perform the cloning operation to verify if the issue is resolved.
137160

138-
**Note:** Depending on the version of Git for Windows, the `credential.helper` value would be different. See the following table for details:
161+
> [!NOTE]
162+
> Depending on the version of Git for Windows, the `credential.helper` value is different. See the following table for details:
139163
140164
|Versions of Git for Windows|Git Credential Manager for Windows|Git Credential Manager Core|Git Credential Manager (Renamed from GCM Core)|
141165
|--|--|--|--|

support/developer/webapps/iis/www-authentication-authorization/http-bad-request-response-kerberos.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
2-
title: HTTP 400 error responses to HTTP requests
2+
title: HTTP 400 Error Responses to HTTP Requests
33
description: Works around an HTTP 400 error that the HTTP request header is too long.
4-
ms.date: 01/10/2025
4+
ms.date: 03/24/2025
55
ms.custom: sap:WWW Authentication and Authorization\Windows Authentication
66
ms.reviewer: ivanpash, paulboc
77
---
88
# HTTP 400 Bad Request (Request Header too long) responses to HTTP requests
99

10-
When an HTTP request that needs Kerberos authentication is sent to a website that's hosted on Internet Information Services (IIS) and is configured to use Kerberos authentication, the HTTP request header would be very long. This article helps you work around the HTTP 400 error that occurs when the HTTP request header is too long.
10+
When an HTTP request that contains a Kerberos authentication ticket is sent to a website that's hosted on Internet Information Services (IIS) and is configured to use Windows Integrated Authentication, the HTTP request header can have a considerable length that exceeds the maximum size of such headers accepted by the IIS server by default. This article helps you work around the HTTP 400 error that occurs when the HTTP request header is too long.
1111

1212
_Original product version:_ &nbsp; Windows Server 2016
1313
_Original KB number:_ &nbsp; 2020943
1414

1515
## Symptoms
1616

17-
An HTTP request that needs Kerberos authentication is sent from a browser to a website that's hosted on IIS. The website is configured to use Kerberos authentication. However, instead of receiving the expected webpage, you receive an error message that resembles the following one:
17+
When attempting to access a web application hosted on IIS that requires Windows Integrated Authentication to grant users access to its resources, the client (browser) will submit an HTTP request that includes an authentication header (header name: `Authorization`) that uses either NTLM or Kerberos as authentication protocols. In the scenario where a Kerberos authentication token is sent from a browser to a website that's hosted on IIS, instead of receiving the expected webpage, you receive an error message that resembles the following one:
1818

1919
> HTTP 400 - Bad Request (Request header too long)
2020
@@ -24,28 +24,30 @@ This response could be generated by any HTTP request that includes Windows Remot
2424

2525
This issue may occur if the user is a member of many Active Directory user groups.
2626

27-
The HTTP request to the server contains the Kerberos token in the `WWW-Authenticate` header. The header size increases together with the number of user groups. If the HTTP header or packet size increases past the limits that are configured on the server, the server may reject the request and send an error message as the response.
27+
The HTTP request to the server contains the Kerberos token in the `Authorize` header. The size of the Kerberos token contained within the HTTP header increases together with the number of user groups for the authenticating user. If the HTTP header or packet size increases past the limits that are configured on the server, the server may reject the request and send an error message as the response.
2828

2929
## Workaround 1: Decrease the number of Active Directory groups
3030

3131
Decrease the number of Active Directory groups that the user is a member of.
3232

3333
## Workaround 2: Set MaxFieldLength and MaxRequestBytes registry entries
3434

35-
Increase the settings for the `MaxFieldLength` and the `MaxRequestBytes` registry entries on the server so that the user's request headers don't exceed these values. To determine the appropriate settings, use the following calculations:
35+
Increase the settings for the `MaxFieldLength` and the `MaxRequestBytes` registry entries on the IIS server so that the user's request headers don't exceed these values. To determine the appropriate settings, use the following calculations:
3636

3737
1. Calculate the size of the user's Kerberos token by using the formula described in [Problems with Kerberos authentication when a user belongs to many groups](../../../../windows-server/windows-security/kerberos-authentication-problems-if-user-belongs-to-groups.md).
3838

3939
2. Set the value of `MaxFieldLength` and `MaxRequestBytes` on the server to 4/3 * T bytes, where T is the user's token size in bytes. HTTP encodes the Kerberos token by using base64 encoding.
4040

4141
> [!NOTE]
42-
> This replaces every three bytes in the token with four base64-encoded bytes. Changes that are made to the registry do not take effect until you restart the HTTP service. Additionally, you may have to restart any related services, such as IIS services.
42+
> This replaces every three bytes in the token with four base64-encoded bytes. Changes that are made to the registry don't take effect until you restart the HTTP service. Additionally, you'll need to restart any related services, such as IIS services.
4343
4444
Depending on your application environment, you might also work around this problem by configuring the website to use Windows NT LAN Manager (NTLM) instead of Kerberos. Some application environments require Kerberos authentication to be used for delegation. We consider Kerberos authentication to be more secure than NTLM. And we recommend that you don't disable Kerberos authentication before you consider the security and delegation ramifications.
4545

4646
## More information
4747

48-
By default, there is no `MaxFieldLength` registry entry. This entry specifies the maximum size limit of each HTTP request header. The `MaxRequestBytes` registry entry specifies the upper limit for the total size of the Request line and the headers. Typically, this registry entry is configured together with the `MaxRequestBytes` registry entry. If the `MaxRequestBytes` value is lower than the `MaxFieldLength` value, the `MaxFieldLength` value is adjusted. In large Active Directory environments, users may experience logon failures if the values for both these entries aren't set to a sufficiently high value.
48+
By default, there's no `MaxFieldLength` registry entry. This entry specifies the maximum size limit of each HTTP request header. The `MaxRequestBytes` registry entry specifies the upper limit for the total size of the Request line and the headers. Typically, this registry entry is configured together with the `MaxRequestBytes` registry entry. If the `MaxRequestBytes` value is lower than the `MaxFieldLength` value, the `MaxFieldLength` value is adjusted. In large Active Directory environments, users may experience logon failures if the values for both these entries aren't set to a sufficiently high value.
49+
50+
The size of `MaxFieldLength` and `MaxRequestBytes` shouldn't exceed the maximum allowed values for these fields that are defined in [Http.sys registry settings for Windows](../health-diagnostic-performance/httpsys-registry-windows.md).
4951

5052
For IIS versions shipped with Windows Server 2016 and later, the `MaxFieldLength` and `MaxRequestBytes` registry keys are located in the following subkey:
5153

0 commit comments

Comments
 (0)