-2
 1. 2020-09-18T19:03:37.9661852Z ##[debug]Evaluating condition for step:
    'Get Sources'
 2. 2020-09-18T19:03:37.9783485Z ##[debug]Evaluating: SucceededNode()
 3. 2020-09-18T19:03:37.9798521Z ##[debug]Evaluating SucceededNode:
 4. 2020-09-18T19:03:37.9848754Z ##[debug]=> True    
 5. 2020-09-18T19:03:37.9888404Z ##[debug]Result:
True 
 6. 2020-09-18T19:03:37.9971561Z ##[section]Starting: Get Sources    
 7. 2020-09-18T19:03:38.0033628Z ##[debug]Sync source for endpoint: DIAMONDS
 8. 2020-09-18T19:03:38.0470845Z Syncing repository: DIAMONDS (TfsGit)
 9. 2020-09-18T19:03:38.0560347Z Prepending Path environment variable
    with directory containing 'git.exe'.
 10. 2020-09-18T19:03:38.0571574Z ##[debug]Path:
     'C:\Agent\vsts-agent-win-x64-2.136.1\externals\git\cmd;C:\Program
     Files\Common Files\Oracle\Java\javapath;C:\Program Files
     (x86)\Common
     Files\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program
     Files (x86)\HID Global\ActivClient\;C:\Program Files\HID
     Global\ActivClient\;C:\Program Files\dotnet\;C:\Program
     Files\Microsoft SQL
     Server\130\Tools\Binn\;C:\Users\svc.dsms.vissvc.sa\AppData\Local\Microsoft\WindowsApps'
 11. 2020-09-18T19:03:38.0618801Z ##[debug]Get git version. 
 12. 2020-09-18T19:03:38.0659586Z ##[command]git version
 13. 2020-09-18T19:03:38.4081255Z git version 2.17.1.windows.2
 14. 2020-09-18T19:03:38.4111608Z ##[debug]Detect git version: 2.17.1.
 15. 2020-09-18T19:03:38.4204178Z ##[debug]Set git useragent to:
     git/2.17.1 (vsts-agent-git/2.136.1).
 16. 2020-09-18T19:03:38.4267175Z
     ##[debug]Checking if the repo on C:\Agent\vsts-agent-win-x64-2.136.1\_work\2\s matches the expected
     repository origin URL. expected Url: https://XXX 
 17. 2020-09-18T19:03:38.4320839Z ##[debug]Inspect remote.origin.url for
     repository under C:\Agent\vsts-agent-win-x64-2.136.1\_work\2\s
 18. 020-09-18T19:03:38.4321081Z ##[command]git config --get
     remote.origin.url
 19. 2020-09-18T19:03:38.7395942Z ##[debug]Get remote origin fetch url
     from git config: https:XXX
 20. 2020-09-18T19:03:38.7396356Z ##[debug]Repository remote origin
     fetch url is https://XXX 
 21. 2020-09-18T19:03:38.7396743Z ##[debug]URLs match.
 22. 2020-09-18T19:03:38.7431528Z ##[debug]Delete untracked 
     files/folders for repository at 
     C:\Agent\vsts-agent-win-x64-2.136.1\_work\2\s.
 23. 2020-09-18T19:03:38.7467645Z ##[command]git clean -fdx
 24. 2020-09-18T19:03:39.0583899Z ##[debug]Undo any changes to tracked
     files in the working tree for repository at
     C:\Agent\vsts-agent-win-x64-2.136.1\_work\2\s.
 25. 2020-09-18T19:03:39.0585957Z ##[command]git reset --hard HEAD
 26. 2020-09-18T19:03:39.2995536Z fatal: ambiguous argument 'HEAD':
     unknown revision or path not in the working tree. 
 27. 2020-09-18T19:03:39.3000326Z Use '--' to separate paths from
     revisions, like this: 
 28. 2020-09-18T19:03:39.3022533Z 'git <command> [<revision>...] --
     [<file>...]' 
 29. 2020-09-18T19:03:39.3195495Z
     ##[debug]'git reset --hard HEAD' failed with exit code 128 For 
 30. futher investigation, manually run 'git reset --hard HEAD' on repo
root: C:\Agent\vsts-agent-win-x64-2.136.1\_work\2\s after each
     build.
 31. 2020-09-18T19:03:39.3226184Z ##[warning]Unable to run "git clean 
     -fdx" and "git reset --hard HEAD" successfully, delete source folder instead.
 32. 2020-09-18T19:03:39.3415125Z ##[debug]Init git repository at:
     C:\Agent\vsts-agent-win-x64-2.136.1\_work\2\s.
 33. 2020-09-18T19:03:39.3415414Z ##[command]git init
     "C:\Agent\vsts-agent-win-x64-2.136.1\_work\2\s"
 34. 2020-09-18T19:03:39.8849476Z Initialized empty Git repository in
     C:/Agent/vsts-agent-win-x64-2.136.1/_work/2/s/.git/ 
 35. 2020-09-18T19:03:39.9152342Z ##[debug]Add git remote: origin to
     url: https://XXXfor repository under:
     C:\Agent\vsts-agent-win-x64-2.136.1\_work\2\s.
 36. 2020-09-18T19:03:39.9152668Z ##[command]git remote add origin
     https://XXX
 37. 2020-09-18T19:03:40.2769659Z ##[debug]Disable git auto garbage
     collection. 
 38. 2020-09-18T19:03:40.2769869Z ##[command]git config gc.auto 0
 39. 2020-09-18T19:03:40.5400860Z ##[debug]Checking git config
     http.https://XXX.extraheader exist or not
 40. 2020-09-18T19:03:40.5401139Z ##[command]git config --get-all
     http.https://XXX.extraheader 
 41. 2020-09-18T19:03:40.7805892Z
     ##[debug]Checking git config http.proxy exist or not
 42. 2020-09-18T19:03:40.7806064Z ##[command]git config --get-all
     http.proxy 
 43. 2020-09-18T19:03:41.0134148Z ##[debug]Fetch git
          repository at: C:\Agent\vsts-agent-win-x64-2.136.1\_work\2\s
          remote: origin. 
 44. 2020-09-18T19:03:41.0174569Z ##[command]git -c 
     http.extraheader="AUTHORIZATION: bearer ***" fetch --tags --prune 
     --progress --no-recurse-submodules origin
 45. 2020-09-18T19:03:41.5941543Z fatal: unable to access 'https://XXX':
     error setting certificate verify locations: 
 46. 2020-09-18T19:03:41.5958389Z   CAfile: C:/Program
     Files/Git/mingw64/ssl/certs/ca-bundle.crt
 47. 2020-09-18T19:03:41.5958752Z   CApath: none
 48. 2020-09-18T19:03:41.6419509Z ##[error]Git fetch failed with exit
     code: 128 
 49. 2020-09-18T19:03:41.6467215Z
 50. ##[debug]System.InvalidOperationException: Git fetch failed with exit code: 128

   

at Microsoft.VisualStudio.Services.Agent.Worker.Build.GitSourceProvider.<GetSourceAsync>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.VisualStudio.Services.Agent.Worker.Build.BuildJobExtension.<GetSourceAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.VisualStudio.Services.Agent.Worker.JobExtensionRunner.<RunAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.VisualStudio.Services.Agent.Worker.StepsRunner.<RunStepAsync>d__1.MoveNext() 2020-09-18T19:03:41.6475180Z ##[section]Finishing: Get Sources
harlam357
  • 1,471
  • 1
  • 13
  • 26

1 Answers1

0

Please try the following ways:

  1. Look for ca-bundle.crt in the "C:/Program Files/Git" folder. If you find this file, copy it and paste it to "C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt".

  2. Fix the path to “C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt”

    git config --system http.sslcainfo " C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt "

  3. Switch off ALL SSL checks completely by executing:

    git config --system http.sslverify false

Since you have this issue in the checkout step, you can use

steps:
- checkout: none

to disable the checkout step first. After the above command is completed, use the git checkout command in your tasks to checkout your repository.

Please refer to this ticket for more details: Github: error cloning my private repository.

Walter
  • 2,640
  • 1
  • 5
  • 11