{"record":{"id":"82c29377eca5d3fc","repo":"git-ecosystem/git-credential-manager","slug":"missing-password-in-response-82c293","errorCode":null,"errorMessage":"Missing 'password' in response","messagePattern":"Missing 'password' in response","errorType":"exception","errorClass":"Trace2Exception","httpStatus":null,"severity":"error","filePath":"src/Core/Authentication/BasicAuthentication.cs","lineNumber":120,"sourceCode":"            {\n                promptArgs.AppendFormat(\" --resource {0}\", QuoteCmdArg(resource));\n            }\n\n            if (!string.IsNullOrWhiteSpace(userName))\n            {\n                promptArgs.AppendFormat(\" --username {0}\", QuoteCmdArg(userName));\n            }\n\n            IDictionary<string, string> resultDict = await InvokeHelperAsync(command, promptArgs.ToString(), null);\n\n            if (!resultDict.TryGetValue(\"username\", out userName))\n            {\n                throw new Trace2Exception(Context.Trace2, \"Missing 'username' in response\");\n            }\n\n            if (!resultDict.TryGetValue(\"password\", out string password))\n            {\n                throw new Trace2Exception(Context.Trace2, \"Missing 'password' in response\");\n            }\n\n            return new GitCredential(userName, password);\n        }\n\n        private bool TryFindHelperCommand(out string command, out string args)\n        {\n            return TryFindHelperCommand(\n                Constants.EnvironmentVariables.GcmUiHelper,\n                Constants.GitConfiguration.Credential.UiHelper,\n                Constants.DefaultUiHelper,\n                out command,\n                out args);\n        }\n    }\n}\n","sourceCodeStart":102,"sourceCodeEnd":137,"githubUrl":"https://github.com/git-ecosystem/git-credential-manager/blob/e8ce762cd04b4100ae637b5fbf39ef9d0a96561e/src/Core/Authentication/BasicAuthentication.cs#L102-L137","documentation":"Same failure mode as the missing 'username' case but for the 'password' key: the credential helper responded without a password, so no GitCredential can be returned. The helper is not following Git's credential output protocol.","triggerScenarios":"GetCredentialsViaHelperAsync successfully parsed a 'username' from the helper response, but resultDict.TryGetValue(\"password\", out password) failed because the helper printed no password=... line.","commonSituations":"Helper authenticates the user but fails to obtain/decrypt the secret; helper emits username only (e.g. OAuth-style helper where the code path errored); partially implemented custom helper; helper errored internally but still exited 0.","solutions":["Run the helper manually and confirm it prints both username= and password= lines","Fix the helper's password retrieval (keychain/decrypt) logic","Check helper logs/trace output (GCM_TRACE) for helper-side errors","Switch to a maintained helper that emits complete credential responses"],"exampleFix":"# before (helper prints only username)\necho \"username=$USER\"\n# after\necho \"username=$USER\"\necho \"password=$PASS\"","handlingStrategy":"validation","validationCode":"var output = RunHelper(command, args);\nif (!output.Contains(\"password=\")) throw new InvalidOperationException(\"Helper does not emit password=\");","typeGuard":null,"tryCatchPattern":"try { /* get creds via helper */ }\ncatch (Trace2Exception ex) when (ex.Message.Contains(\"Missing 'password'\")) { /* fix helper secret retrieval */ }","preventionTips":["Ensure helpers always print both username= and password= lines","Check keychain/secret-store access permissions for the helper process","Log helper stderr separately to catch partial failures"],"tags":["credential-helper","missing-password","protocol"],"backgroundTag":"missing-credentials","analyzedSha":"e8ce762cd04b4100ae637b5fbf39ef9d0a96561e","analyzedAt":"2026-09-11T17:15:08.753Z","contentChangedAt":"2026-09-11T17:15:08.753Z","schemaVersion":2},"datasetVersion":"2026-09-16T14:17:13.074Z"}