git-ecosystem/git-credential-manager · error · Exception

No host provider available to service this request.

Error message

No host provider available to service this request.

What it means

After trying all registered providers in priority order (High, Normal, Low) via MatchProviderAsync, if none matches the request's URI/authority, GetProviderAsync throws this generic Exception. It means auto-detection and all registered providers were unable to service the given remote URL.

Solutions

  1. Check the URL in the error context — confirm the host is a supported service (GitHub, GitLab, Azure DevOps, Bitbucket, ...)
  2. Register a generic/custom host provider for the unsupported host at an appropriate priority
  3. Force a known provider via GCM configuration (e.g. credential.provider setting) so auto-detection is skipped
  4. If a custom provider should have matched, verify its SupportedAuthorityIds and priority registration

Example fix

// before (git config)
// no provider configured, unknown host git.example.com
// after
// git config --global credential.provider generic
// or in code:
registry.Register(new GenericHostProvider(context), HostProviderPriority.Low);
Defensive patterns

Strategy: fallback

Validate before calling

var uri = input.GetRemoteUri();
bool isSupported = new[] { "github.com", "gitlab.com", "dev.azure.com", "bitbucket.org" }
    .Any(h => uri?.Host.EndsWith(h, StringComparison.OrdinalIgnoreCase) == true);

Try / catch

try
{
    provider = await registry.GetProviderAsync(input);
}
catch (Exception ex) when (ex.Message == "No host provider available to service this request.")
{
    provider = new GenericHostProvider(context); // fallback for unsupported hosts
}

Prevention

When it happens

Trigger: GetProviderAsync with a remote URL whose host/authority matches no registered provider — no providers registered, URL scheme unprobeable (non-HTTP(S)), or host is an unsupported Git service.

Common situations: Pushing to a lesser-known/self-hosted Git host with no matching provider, a custom provider not registered in the app setup, or URLs with unusual ports/schemes that fail provider matching.

Related errors


AI-assisted analysis of git-ecosystem/git-credential-manager@e8ce762cd0 (2026-09-11). Data as JSON: /api/errors/8bc4c928dbe123a5. Report an issue: GitHub.

Appendix: source

Thrown at src/Core/HostProviderRegistry.cs:226

                                }
                            }
                        }

                        if (providers.TryGetFirst(x => x.IsSupported(probeResponse), out match))
                        {
                            return match;
                        }
                    }
                }

                return null;
            }

            // Match providers starting with the highest priority
            IHostProvider match = await MatchProviderAsync(HostProviderPriority.High, canProbeUri) ??
                                  await MatchProviderAsync(HostProviderPriority.Normal, canProbeUri) ??
                                  await MatchProviderAsync(HostProviderPriority.Low, canProbeUri) ??
                                  throw new Exception("No host provider available to service this request.");

            // If we ended up making a network call then set the host provider explicitly
            // to avoid future calls!
            if (probeResponse != null)
            {
                IGitConfiguration gitConfig = _context.Git.GetConfiguration();
                var keyName = string.Format(CultureInfo.InvariantCulture, "{0}.{1}.{2}",
                    Constants.GitConfiguration.Credential.SectionName, uri.ToString().TrimEnd('/'),
                    Constants.GitConfiguration.Credential.Provider);

                try
                {
                    _context.Trace.WriteLine($"Remembering host provider for '{uri}' as '{match.Id}'...");
                    gitConfig.Set(GitConfigurationLevel.Global, keyName, match.Id);
                }
                catch (Exception ex)
                {
                    var message = "Failed to set host provider!";

View on GitHub (pinned to e8ce762cd0)