{"record":{"id":"d33c6ac2cd0aeda6","repo":"git-ecosystem/git-credential-manager","slug":"missing-use-default-account-in-response","errorCode":null,"errorMessage":"Missing use_default_account in response","messagePattern":"Missing use_default_account in response","errorType":"exception","errorClass":"Trace2Exception","httpStatus":null,"severity":"error","filePath":"src/Core/Authentication/Entra/EntraAuthentication.PublicClient.cs","lineNumber":346,"sourceCode":"    {\n        ThrowIfUserInteractionDisabled();\n\n        if (Context.SessionManager.IsDesktopSession && Context.Settings.IsGuiPromptsEnabled)\n        {\n            if (TryFindHelperCommand(out string command, out string args))\n            {\n                var sb = new StringBuilder(args);\n                sb.Append(\"default-account\");\n                sb.AppendFormat(\" --username {0}\", QuoteCmdArg(userName));\n\n                IDictionary<string, string> result = await InvokeHelperAsync(command, sb.ToString());\n\n                if (result.TryGetValue(\"use_default_account\", out string str) && !string.IsNullOrWhiteSpace(str))\n                {\n                    return str.ToBooleanyOrDefault(false);\n                }\n\n                throw new Trace2Exception(Context.Trace2, \"Missing use_default_account in response\");\n            }\n\n            var viewModel = new DefaultAccountViewModel(Context.SessionManager)\n            {\n                UserName = userName\n            };\n\n            await AvaloniaUi.ShowViewAsync<DefaultAccountView>(viewModel, GetParentWindowHandle(), ct);\n\n            ThrowIfWindowCancelled(viewModel);\n\n            return viewModel.UseDefaultAccount;\n        }\n\n        var prompt = new ConfirmationPrompt($\"Continue with current account ({userName})?\");\n        return await prompt.ShowAsync(Context.Console, ct);\n    }\n","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/git-ecosystem/git-credential-manager/blob/e8ce762cd04b4100ae637b5fbf39ef9d0a96561e/src/Core/Authentication/Entra/EntraAuthentication.PublicClient.cs#L328-L364","documentation":"Raised in UseDefaultAccountAsync when a GUI helper command (invoked with the 'default-account' subcommand) returns a response dictionary that does not contain a usable 'use_default_account' key. The library treats a helper response missing this field as a contract violation and throws Trace2Exception instead of guessing the user's answer.","triggerScenarios":"A configured credential helper GUI process is invoked via TryFindHelperCommand and InvokeHelperAsync but its JSON/stdout response lacks the 'use_default_account' entry, or the entry is null/whitespace.","commonSituations":"Out-of-date or third-party helper executable that predates the 'default-account' protocol, a helper crashing or returning partial output, or a misconfigured helper command path pointing at the wrong binary.","solutions":["Update the credential helper/GUI application to a version that implements the default-account protocol and returns 'use_default_account'.","Verify the helper command configuration (TryFindHelperCommand resolution) points at the correct bundled helper.","Disable the helper or GUI prompts (Context.Settings / IsGuiPromptsEnabled) so the built-in dialog or confirmation prompt is used instead.","Capture trace2 output to inspect the raw helper response and fix the helper's output format."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    useDefault = await auth.UseDefaultAccountAsync(userName, ct);\n}\ncatch (Trace2Exception ex) when (ex.Message.Contains(\"use_default_account\"))\n{\n    // helper is non-compliant; fall back to GUI dialog / prompt path\n    useDefault = false;\n}","preventionTips":["Keep the GUI credential helper up to date with the current protocol.","Validate helper output includes required keys during helper onboarding.","Disable the helper (fall back to built-in prompts) when a third-party helper is detected.","Capture trace2 logs to diagnose helper response issues."],"tags":["helper-protocol","authentication","unexpected-response","gui-helper"],"backgroundTag":"unexpected-response-shape","analyzedSha":"e8ce762cd04b4100ae637b5fbf39ef9d0a96561e","analyzedAt":"2026-09-11T17:15:08.753Z","contentChangedAt":"2026-09-11T17:15:08.753Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}