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

Missing password in response

Error message

Missing password in response

What it means

Companion to the username check: GetCredentialsViaHelperAsync requires a 'password' key in the UI helper's response dictionary. Its absence means the helper returned incomplete credentials, so a GitCredential cannot be constructed and Trace2Exception 'Missing password in response' is thrown.

Solutions

  1. Reinstall/upgrade GCM to restore a matching UI helper binary
  2. Clear conflicting credential helpers/config so the official helper handles the prompt
  3. Enable Trace2 tracing to inspect the helper's returned dictionary and confirm which keys were sent

Example fix

// before
// helper output: {"username":"user"}
// after
// helper output: {"username":"user","password":"token"} — reinstall official GCM helper
Defensive patterns

Strategy: try-catch

Validate before calling

var proc = FindHelperBinary();
if (proc == null || !File.Exists(proc)) throw new InvalidOperationException("UI helper missing/stale");

Type guard

bool HasPassword(Dictionary<string,string> o) => o.TryGetValue("password", out var p) && !string.IsNullOrEmpty(p);

Try / catch

try { await auth.GetCredentialsAsync(uri, user, modes); }
catch (Trace2Exception ex) { trace.Error(ex); return null; } // fall back to manual credential entry

Prevention

When it happens

Trigger: GetCredentialsAsync -> GetCredentialsViaHelperAsync: output.TryGetValue("password", out password) fails because the helper process output lacks the password field (partial output, helper bug, or non-standard helper).

Common situations: Outdated or third-party UI helper binary; helper aborted after emitting username; interference from credential-cache tools truncating helper output.

Related errors


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

Appendix: source

Thrown at src/Atlassian.Bitbucket/BitbucketAuthentication.cs:242

            }

            IDictionary<string, string> output = await InvokeHelperAsync(helperCommand, promptArgs.ToString());

            if (output.TryGetValue("mode", out string mode) &&
                StringComparer.OrdinalIgnoreCase.Equals(mode, "oauth"))
            {
                return new CredentialsPromptResult(AuthenticationModes.OAuth);
            }
            else
            {
                if (!output.TryGetValue("username", out userName))
                {
                    throw new Trace2Exception(Context.Trace2, "Missing username in response");
                }

                if (!output.TryGetValue("password", out string password))
                {
                    throw new Trace2Exception(Context.Trace2, "Missing password in response");
                }

                return new CredentialsPromptResult(
                    AuthenticationModes.Basic,
                    new GitCredential(userName, password));
            }
        }

        public async Task<OAuth2TokenResult> CreateOAuthCredentialsAsync(GitRequest request)
        {
            ThrowIfUserInteractionDisabled();

            var browserOptions = new OAuth2WebBrowserOptions
            {
                SuccessResponseHtml = BitbucketResources.AuthenticationResponseSuccessHtml,
                FailureResponseHtmlFormat = BitbucketResources.AuthenticationResponseFailureHtmlFormat
            };

View on GitHub (pinned to e8ce762cd0)