Azure Devops不允许我推送更新

时间:2019-11-21 12:57:17

标签: azure-devops

我正在尝试将更新推送到我们的Azure devops组织,这给我带来了问题。我已经尝试过在网上找到的有关删除tenant.cache,用新的凭据管理器文件替换文件的所有建议。我尝试退出所有帐户并重新登录,但到目前为止没有任何效果。这是Visual Studio告诉我的:

Pushing master
Logon failed, use ctrl+c to cancel basic credential prompt.
Error: cannot spawn askpass: No such file or directory
Error encountered while pushing to the remote repository: Git failed with a fatal error.
could not read Username for 'https://dev.azure.com': terminal prompts disabled

这是git log响应:

07:49:26.686693 exec-cmd.c:236          trace: resolved executable dir: c:/program files (x86)/microsoft visual studio/2019/professional/common7/ide/commonextensions/microsoft/teamfoundation/team explorer/Git/mingw32/bin
07:49:26.885471 git.c:419               trace: built-in: git for-each-ref '--format='\''[%(refname)][%(objecttype)][%(objectname)][%(upstream)][%(push)][%(HEAD)]'\''' refs/heads/ refs/remotes/
07:49:27.205394 exec-cmd.c:236          trace: resolved executable dir: c:/program files (x86)/microsoft visual studio/2019/professional/common7/ide/commonextensions/microsoft/teamfoundation/team explorer/Git/mingw32/bin
07:49:27.292891 git.c:419               trace: built-in: git remote --verbose
07:49:27.360870 exec-cmd.c:236          trace: resolved executable dir: c:/program files (x86)/microsoft visual studio/2019/professional/common7/ide/commonextensions/microsoft/teamfoundation/team explorer/Git/mingw32/bin
07:49:27.448248 git.c:419               trace: built-in: git push --verbose --progress origin refs/heads/master:master
07:49:27.453255 run-command.c:643       trace: run_command: GIT_DIR=.git git remote-https origin https://dev.azure.com/{ORGNAME}/repo
07:49:27.499097 exec-cmd.c:236          trace: resolved executable dir: c:/program files (x86)/microsoft visual studio/2019/professional/common7/ide/commonextensions/microsoft/teamfoundation/team explorer/Git/mingw32/bin
07:49:27.529472 git.c:676               trace: exec: git-remote-https origin https://dev.azure.com/{ORGNAME}/repo
07:49:27.529472 run-command.c:643       trace: run_command: git-remote-https origin https://dev.azure.com/{ORGNAME}/repo
07:49:27.564880 exec-cmd.c:236          trace: resolved executable dir: c:/program files (x86)/microsoft visual studio/2019/professional/common7/ide/commonextensions/microsoft/teamfoundation/team explorer/Git/mingw32/bin
07:49:27.907250 run-command.c:643       trace: run_command: 'git credential-manager get'
07:49:28.121488 exec-cmd.c:236          trace: resolved executable dir: C:/program files (x86)/microsoft visual studio/2019/professional/common7/ide/commonextensions/microsoft/teamfoundation/team explorer/Git/mingw32/bin
07:49:28.152479 git.c:676               trace: exec: git-credential-manager get
07:49:28.152479 run-command.c:643       trace: run_command: git-credential-manager get
07:49:28.225935 ...\Common.cs:744       trace: [Main] git-credential-manager (v1.20.0) 'get'
07:49:28.280823 ...\Git\Where.cs:348    trace: [FindGitInstallations] found 1 Git installation(s).
07:49:28.308087 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 26 entries.
07:49:28.309084 ...\Common.cs:427       trace: [LoadOperationArguments] GCM_HTTP_USER_AGENT = 'git-credential-manager (Microsoft Windows NT 10.0.18362.0; Win32NT x64) CLR/4.0.30319 VS15/16.0.0'.
07:49:28.312076 ...\Common.cs:479       trace: [LoadOperationArguments] interactive = 'Auto'.
07:49:28.312076 ...\Common.cs:497       trace: [LoadOperationArguments] validate = 'True'.
07:49:28.312076 ...\Common.cs:513       trace: [LoadOperationArguments] modalPrompt = 'True'.
07:49:28.353964 ...\Common.cs:85        trace: [CreateAuthentication] detecting authority type for 'https://dev.azure.com/'.
07:49:28.640259 ...uthentication.cs:223 trace: [DetectAuthority] detected 'https://dev.azure.com/{ORGNAME}/' as Azure DevOps from GET response.
07:49:28.641289 ...uthentication.cs:291 trace: [DetectAuthority] tenant resource for 'https://dev.azure.com/{ORGNAME}/' is {00000000000000000000000000000000}.
07:49:28.641289 ...uthentication.cs:354 trace: [GetAuthentication] MSA authority detected.
07:49:28.647276 ...\Common.cs:205       trace: [CreateAuthentication] authority for 'https://dev.azure.com/' is Microsoft Live.
07:49:28.647276 ...\Common.cs:765       trace: [QueryCredentials] querying 'MicrosoftAccount' for credentials.
07:49:35.535626 ...\Authority.cs:195    trace: [InteractiveAcquireToken] authority host URL = 'https://login.microsoftonline.com/common', token acquisition for tenant [1bac877aca7c4b73b2c19dc2d3ed4df3] succeeded.
07:49:35.535626 ...Authentication.cs:86 trace: [InteractiveLogon] token 'https://dev.azure.com/' successfully acquired.
07:49:35.868880 ...\Authority.cs:533    trace: [GetAccessTokenRequestBody] creating access token scoped to 'vso.code_write vso.packaging' for 'https://dev.azure.com/{ORGNAME}/'
07:49:36.614779 ...\Authority.cs:131    trace: [GeneratePersonalAccessToken] failed to acquire personal access token for 'https://dev.azure.com/' [200].
07:49:36.614779 ...\Authority.cs:139    trace: [GeneratePersonalAccessToken] personal access token acquisition for 'https://dev.azure.com/' failed.
07:49:36.614779 ...\Common.cs:854       trace: [QueryCredentials] credentials for 'https://dev.azure.com/' not found.
07:49:36.614779 ...\Common.cs:709       trace: [LogEvent] Failed to retrieve Microsoft Live credentials for 'https://dev.azure.com/'.
07:49:36.616760 ...\Program.cs:414      trace: [Get] Logon failed, use ctrl+c to cancel basic credential prompt.
07:49:36.659579 run-command.c:643       trace: run_command: askpass 'Username for '\''https://dev.azure.com'\'': '

为了公司安全,我将组织名称和存储库替换为{ORGNAME} / repo

所以它说失败了:

  

07:49:36.614779 ... \ Authority.cs:139跟踪:[GeneratePersonalAccessToken]为“ https://dev.azure.com/”获取个人访问令牌失败。

但是在团队资源管理器中,它使我可以连接到Repo:

team explorer

1 个答案:

答案 0 :(得分:1)

  

Azure Devops不允许我推送更新

根据错误git log:

[InteractiveLogon] token 'https://dev.azure.com/' successfully acquired.
[GetAccessTokenRequestBody] creating access token scoped to 'vso.code_write vso.packaging' for 'https://dev.azure.com/{ORGNAME}/'
GeneratePersonalAccessToken] failed to acquire personal access token for 'https://dev.azure.com/' [200].

似乎git没有获得PAT(或有效的PAT)。您可以尝试使用以下方法解决此问题:

  • 删除https://dev.azure.com/的凭据 存储在凭据管理器中。

    enter image description here

    然后再次推送,git将允许您输入存储库的凭据。输入可以访问Azure devops帐户的用户名(电子邮件地址)和密码后。

  • 将用户名和密码或个人访问令牌(PAT)添加到 git push命令:

    git push https://username:password(or PAT)@dev.azure.com/username/reponame.git

希望这会有所帮助。