VSTS构建失败,Git获取失败,退出代码为128。

6

我在VSTS上设置了一个构建代理和构建流程。所有的配置都正确,但是在获取源代码的步骤中构建失败了。以下是我尝试过的方法:

  • Check permission: Since my profile is owner of this project so I do not specify permission in Roles
  • I tried to change PAT's scope to ALL scope but I have no luck.
  • Upgrade to latest version 2.14.1.windows.1. But I know why it still shows 2.12.0.windows.1.

    2017-08-15T03:51:34.4449577Z ##[command]git version
    2017-08-15T03:51:34.5159426Z git version 2.12.0.windows.1
    2017-08-15T03:51:34.5239707Z ##[command]git init "C:\agent\_work\1\s"
    2017-08-15T03:51:34.5889586Z Initialized empty Git repository in C:/agent/_work/1/s/.git/
    2017-08-15T03:51:34.5929735Z ##[command]git remote add origin https://ezcm.visualstudio.com/_git/NSample
    2017-08-15T03:51:34.6430065Z ##[command]git config gc.auto 0
    2017-08-15T03:51:34.6915534Z ##[command]git config --get-all http.https://ezcm.visualstudio.com/_git/NSample.extraheader
    2017-08-15T03:51:34.7356779Z ##[command]git config --get-all http.proxy
    2017-08-15T03:51:34.7846598Z ##[command]git -c http.extraheader="AUTHORIZATION: bearer ********" fetch --tags --prune
    

    --progress --no-recurse-submodules origin 2017-08-15T03:51:34.8901839Z ##[error]Git fetch failed with exit code: 128 2017-08-15T03:51:34.8981753Z ##[section]Finishing: Get Sources

请帮我找出问题所在。谢谢!


你能否直接通过git命令在构建代理上获取远程源代码?尝试在构建定义中设置System.Debug变量为true,然后排队构建并在此处发布详细日志。 - starian chen-MSFT
@starain-MSFT:当我打开system.Debug并再次排队构建时,日志显示:“System.InvalidOperationException: Git fetch failed with exit code: 128”。我在C:\agent_work\1\s启动git并执行git_fetch命令。结果显示:“Receiving objects: 100% (123/123), 28.46 KiB | 1.29 MiB/s, done. Resolving deltas: 100% (64/64), done. From https://ezcm.visualstudio.com/_git/NSample
  • [new branch] Dev -> origin/Dev
  • [new branch] Version_1_1_0 -> origin/Version_1_1_0
  • [new branch] master -> origin/master”。
- Cycloguy
如果您正在使用托管代理,如果您使用私有代理排队构建,会得到什么结果? - Marina Liu
@Marina-MSFT:如果我使用托管代理排队构建,则可以成功运行。 - Cycloguy
@Cycloguy 好的,请再确认一下是意外情况还是您私有代理的问题:您可以在构建定义中选择干净的源目录,然后通过私有代理排队构建代理。 - Marina Liu
显示剩余2条评论
1个回答

0

我有一个企业级GitHub存储库。当我将存储库设置为“私有”时,即使用户是存储库的管理员,我也会继续收到退出代码128的错误。

我将其改回公共存储库后,它就可以正常工作了。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接