git-ecosystem / git-ecosystem/git-credential-manager

The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.

Open
#1,635 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

auth-issue
Dominant language
C#
Stars
9.3k
Forks
2.9k
Avg merge
7d 1h
Merged PRs (30d)
14

Description

Version

2.5.0+85dab25e2a2dd10defc15e8679dd58982c532f2b

Operating system

Linux

OS version or distribution

Fedora 40

Git hosting provider(s)

Azure DevOps

Other hosting provider

No response

(Azure DevOps only) What format is your remote URL?

https://dev.azure.com/{org}

Can you access the remote repository directly in the browser?

Yes, I can access the repository

Expected behavior

I have configured msauthFlow = devicecode and expecting device code reported on console.

Actual behavior

Instead of providing authentication code it asks for password.

git pull
fatal: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
fatal: A task was canceled.
fatal: A task was canceled.
fatal: Authentication failed for 'https://dev.azure.com/<org>/<project>/_git/<repository>/'

Additionally when I run dignostics I'll get following result:

git-credential-manager diagnose
Running diagnostics...

 [ OK ] Environment
 [ OK ] File system
  >>>>  NetworkingUnhaSystem.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
 ---> System.TimeoutException: A task was canceled.
 ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at GitCredentialManager.Diagnostics.NetworkingDiagnostic.SendHttpRequest(StringBuilder log, HttpClient httpClient)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

git-credential-manager is installed from source with installPrefix="/home/<username>/.local"

Logs
13:59:57.082489 git.c:465               trace: built-in: git pull
13:59:57.084057 run-command.c:657       trace: run_command: git fetch --update-head-ok
13:59:57.087772 git.c:465               trace: built-in: git fetch --update-head-ok
13:59:57.089359 run-command.c:657       trace: run_command: GIT_DIR=.git git remote-https origin https://<org>@dev.azure.com/<org>/<project>/_git/<repository>/
13:59:57.094418 git.c:750               trace: exec: git-remote-https origin https://<org>@dev.azure.com/<org>/<project>/_git/<repository>/
13:59:57.094514 run-command.c:657       trace: run_command: git-remote-https origin https://<org>@dev.azure.com/<org>/<project>/_git/<repository>/
13:59:57.481652 run-command.c:657       trace: run_command: '/home/<username>/.local/bin/git-credential-manager get'
13:59:57.659801 git.c:465               trace: built-in: git config --null --list
13:59:57.744048 ...e/Application.cs:106 trace: [RunInternalAsync] Version: 2.5.0.0
13:59:57.749964 ...e/Application.cs:107 trace: [RunInternalAsync] Runtime: .NET 8.0.4
13:59:57.750033 ...e/Application.cs:108 trace: [RunInternalAsync] Platform: Linux (x86-64)
13:59:57.750048 ...e/Application.cs:109 trace: [RunInternalAsync] OSVersion: Fedora Linux 40 (Workstation Edition)
13:59:57.750079 ...e/Application.cs:110 trace: [RunInternalAsync] AppPath: /home/<username>/.local/bin/git-credential-manager
13:59:57.750195 ...e/Application.cs:111 trace: [RunInternalAsync] InstallDir: /home/<username>/.local/share/gcm-core/
13:59:57.750237 ...e/Application.cs:112 trace: [RunInternalAsync] Arguments: get
13:59:57.792280 ...GitCommandBase.cs:32 trace: [ExecuteAsync] Start 'get' command...
13:59:57.811103 ...GitCommandBase.cs:46 trace: [ExecuteAsync] Detecting host provider for input:
13:59:57.812826 ...GitCommandBase.cs:47 trace: [ExecuteAsync]   protocol=https
13:59:57.812915 ...GitCommandBase.cs:47 trace: [ExecuteAsync]   host=dev.azure.com
13:59:57.812953 ...GitCommandBase.cs:47 trace: [ExecuteAsync]   path=<org>/<project>/_git/<repository>
13:59:57.812990 ...GitCommandBase.cs:47 trace: [ExecuteAsync]   username=<org>
13:59:57.813016 ...GitCommandBase.cs:47 trace: [ExecuteAsync]   wwwauth=Basic realm="https://tfsprodweu4.visualstudio.com/"
13:59:57.818329 ...viderRegistry.cs:149 trace: [GetProviderAsync] Performing auto-detection of host provider.
13:59:57.822183 ...viderRegistry.cs:162 trace: [GetProviderAsync] Auto-detect probe timeout is 2 ms.
13:59:57.829527 ...viderRegistry.cs:170 trace: [GetProviderAsync] Checking against 4 host providers registered with priority 'Normal'.
13:59:57.831044 ...GitCommandBase.cs:49 trace: [ExecuteAsync] Host provider 'Azure Repos' was selected.
13:59:57.839634 ...sHostProvider.cs:476 trace: [UsePersonalAccessTokens] Azure Repos credential type override set to 'oauth'
13:59:57.842601 ...sHostProvider.cs:272 trace: [GetAzureAccessTokenAsync] Determining Microsoft Authentication authority for Azure DevOps organization '<org>'...
13:59:57.861010 ...AuthorityCache.cs:57 trace: [GetAuthority] Looking up cached authority for organization '<org>'...
13:59:57.866330 git.c:465               trace: built-in: git version
13:59:57.877646 git.c:465               trace: built-in: git config --null --global credential.azrepos:org/<org>.azureAuthority
13:59:57.878472 ...sHostProvider.cs:284 trace: [GetAzureAccessTokenAsync] No cached authority value - querying https://dev.azure.com/<org> for authority...
13:59:57.883804 ...eDevOpsRestApi.cs:43 trace: [GetAuthorityAsync] HTTP: HEAD https://dev.azure.com/<org>
13:59:57.886838 ...pClientFactory.cs:60 trace: [CreateClient] Creating new HTTP client instance...
13:59:57.893209 ...pClientFactory.cs:80 trace: [CreateClient] Git's SSL/TLS backend is: OpenSsl
13:59:57.896438 git.c:465               trace: built-in: git config --null --type=path http.https://dev.azure.com/<org>/<project>/_git/<repository>/.sslCAInfo
13:59:57.900148 git.c:465               trace: built-in: git config --null --type=path http.dev.azure.com/<org>/<project>/_git/<repository>/.sslCAInfo
13:59:57.902899 git.c:465               trace: built-in: git config --null --type=path http.https://dev.azure.com/<org>/<project>/_git.sslCAInfo
13:59:57.905197 git.c:465               trace: built-in: git config --null --type=path http.dev.azure.com/<org>/<project>/_git.sslCAInfo
13:59:57.907660 git.c:465               trace: built-in: git config --null --type=path http.https://dev.azure.com/<org>/<project>.sslCAInfo
13:59:57.910615 git.c:465               trace: built-in: git config --null --type=path http.dev.azure.com/<org>/<project>.sslCAInfo
13:59:57.913039 git.c:465               trace: built-in: git config --null --type=path http.https://dev.azure.com/<org>.sslCAInfo
13:59:57.917587 git.c:465               trace: built-in: git config --null --type=path http.dev.azure.com/<org>.sslCAInfo
13:59:57.921095 git.c:465               trace: built-in: git config --null --type=path http.https://dev.azure.com.sslCAInfo
13:59:57.923484 git.c:465               trace: built-in: git config --null --type=path http.dev.azure.com.sslCAInfo
13:59:57.925672 git.c:465               trace: built-in: git config --null --type=path http.https://azure.com.sslCAInfo
13:59:57.928621 git.c:465               trace: built-in: git config --null --type=path http.azure.com.sslCAInfo
13:59:57.933297 git.c:465               trace: built-in: git config --null --type=path http.sslCAInfo
13:59:57.936890 git.c:465               trace: built-in: git config --null --type=path http.https://dev.azure.com/<org>/<project>/_git/<repository>/.cookieFile
13:59:57.939255 git.c:465               trace: built-in: git config --null --type=path http.dev.azure.com/<org>/<project>/_git/<repository>/.cookieFile
13:59:57.945862 git.c:465               trace: built-in: git config --null --type=path http.https://dev.azure.com/<org>/<project>/_git.cookieFile
13:59:57.950185 git.c:465               trace: built-in: git config --null --type=path http.dev.azure.com/<org>/<project>/_git.cookieFile
13:59:57.953314 git.c:465               trace: built-in: git config --null --type=path http.https://dev.azure.com/<org>/<project>.cookieFile
13:59:57.955898 git.c:465               trace: built-in: git config --null --type=path http.dev.azure.com/<org>/<project>.cookieFile
13:59:57.958077 git.c:465               trace: built-in: git config --null --type=path http.https://dev.azure.com/<org>.cookieFile
13:59:57.961481 git.c:465               trace: built-in: git config --null --type=path http.dev.azure.com/<org>.cookieFile
13:59:57.965080 git.c:465               trace: built-in: git config --null --type=path http.https://dev.azure.com.cookieFile
13:59:57.968813 git.c:465               trace: built-in: git config --null --type=path http.dev.azure.com.cookieFile
13:59:57.971824 git.c:465               trace: built-in: git config --null --type=path http.https://azure.com.cookieFile
13:59:57.974026 git.c:465               trace: built-in: git config --null --type=path http.azure.com.cookieFile
13:59:57.976706 git.c:465               trace: built-in: git config --null --type=path http.cookieFile
fatal: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
   at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at Microsoft.AzureRepos.AzureDevOpsRestApi.GetAuthorityAsync(Uri organizationUri)
   at Microsoft.AzureRepos.AzureReposHostProvider.GetAzureAccessTokenAsync(InputArguments input)
   at Microsoft.AzureRepos.AzureReposHostProvider.GetCredentialAsync(InputArguments input)
   at GitCredentialManager.Commands.GetCommand.ExecuteInternalAsync(InputArguments input, IHostProvider provider)
   at GitCredentialManager.Commands.GitCommandBase.ExecuteAsync()
   at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass15_0.<<AddMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__5_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext()
fatal: A task was canceled.

fatal: A task was canceled.
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
14:01:38.035797 run-command.c:657       trace: run_command: /usr/share/code/resources/app/extensions/git/dist/askpass.sh 'Password for '\''https://<org>@dev.azure.com/<org>/<project>/_git/<repository>/'\'': '

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Microsoft.AzureRepos.AzureDevOpsRestApi.GetAuthorityAsync and AzureReposHostProvider.GetAzureAccessTokenAsync, using the reported devicecode configuration on Fedora. Review the NetworkingDiagnostic.SendHttpRequest path and reproduce the Azure Repos authentication flow. Done means the device-code prompt appears and the request no longer fails with the reported timeout.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, git, linux
Domain
authentication, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.