6

I setup a build agent and build process on VSTS. All configuration is ok but build is failed at getting source step. Here is what I have tried:

  • 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

Please help me to figured out the issue. Thank you!

Cycloguy
  • 221
  • 3
  • 6
  • Could you fetch source from that remote through git command on build agent directly? Try to set System.Debug variable to true in build definition, then queue build and post the detail log here. – starian chen-MSFT Aug 15 '17 at 05:18
  • @starain-MSFT: When I turn on system.Debug and queue a build again. in the log show: `System.InvalidOperationException: Git fetch failed with exit code: 128`. I start git at C:\agent\_work\1\s and do command git_fetch. The result shows: `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 Aug 15 '17 at 06:34
  • If you are using Hosted Agent, what's the result if you queue the build with private agent? – Marina Liu Aug 15 '17 at 07:08
  • @Marina-MSFT: If I queue the build by using Hosted Agent, it runs successfully. – Cycloguy Aug 15 '17 at 09:53
  • @Cycloguy ok, please double check it's an accident or the issue for your private agent: you can select clean source directory in your build definition and then queue the build agent by private agent. – Marina Liu Aug 15 '17 at 10:00
  • The result is the same but it adds one more warning: `Unable to run "git clean -fdx" and "git reset --hard HEAD" successfully, delete source folder instead.` and in log: `fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tr ee.` – Cycloguy Aug 16 '17 at 02:52
  • I think the root cause is the built-in Git in VSTS Agent. The version of Git is 2.12.0.windows.1 is included in 2.120.1. I download the latest version of Git (2.14.1.windows.1) and overwrite to agent\externals\git. Then it works. – Cycloguy Aug 16 '17 at 06:31

1 Answers1

0

I have a Enterprise GitHub repository. I started getting this error when I made the repository 'Private' even if the user was Admin on the repository I would continue to get exit code 128.

I changed it back to be public repository it worked fine.

CBBSpike
  • 1,385
  • 1
  • 13
  • 18