无法使用Azure Dev Ops管道获取其他Git帐户的源代码

时间:2020-01-21 20:36:26

标签: git azure-devops azure-pipelines gerrit git-checkout

我相信Microsoft必须在1月16日至17日之间引入一个漏洞。我想知道其他人是否遇到过类似的问题并找到了解决方法。 基本上,我有一个项目,什么都没有改变,但是管道开始失败。

尝试从git中获取代码时失败。这是工作时以及当前的日志文件的一部分。

日志文件:工作时

2020-01-16T03:00:26.2926085Z ##[section]Starting: Checkout
2020-01-16T03:00:26.2928221Z ==============================================================================
2020-01-16T03:00:26.2928417Z Task         : Get sources
2020-01-16T03:00:26.2928576Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-16T03:00:26.2928700Z Version      : 1.0.0
2020-01-16T03:00:26.2928830Z Author       : Microsoft
2020-01-16T03:00:26.2928976Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-01-16T03:00:26.2929185Z ==============================================================================
2020-01-16T03:00:26.7775173Z Syncing repository: repository (ExternalGit)
2020-01-16T03:00:26.9327220Z ##[command]git version
2020-01-16T03:00:26.9728952Z git version 2.24.1
2020-01-16T03:00:26.9892738Z ##[command]git lfs version
2020-01-16T03:00:27.0835630Z git-lfs/2.9.2 (GitHub; linux amd64; go 1.13.1)
2020-01-16T03:00:27.1149634Z ##[command]git init "/home/vsts/work/1/s"
2020-01-16T03:00:27.1246583Z Initialized empty Git repository in /home/vsts/work/1/s/.git/
2020-01-16T03:00:27.1291339Z ##[command]git remote add origin https://***@partners.macadamian.com/gerrit/a/mdgateway-mdgdemo
2020-01-16T03:00:27.1395074Z ##[command]git config gc.auto 0
2020-01-16T03:00:27.1448215Z ##[command]git config --get-all http.https://***@partners.macadamian.com/gerrit/a/mdgateway-mdgdemo.extraheader
2020-01-16T03:00:27.1508170Z ##[command]git config --get-all http.proxy
2020-01-16T03:00:27.1557498Z ##[command]git remote set-url origin https://***:***@partners.macadamian.com/gerrit/a/mdgateway-mdgdemo
2020-01-16T03:00:27.1614885Z ##[command]git remote set-url --push origin https://***:***@partners.macadamian.com/gerrit/a/mdgateway-mdgdemo
2020-01-16T03:00:27.1744097Z ##[command]git fetch --force --tags --prune --progress --no-recurse-submodules origin
2020-01-16T03:00:28.3617772Z remote: Counting objects: 1           
2020-01-16T03:00:28.3621364Z remote: Counting objects: 856, done        
2020-01-16T03:00:28.3622001Z remote: Finding sources:   1% (9/856)           
2020-01-16T03:00:28.3622483Z remote: Finding sources:   2% (18/856)           
2020-01-16T03:00:28.3622793Z remote: Finding sources:   3% (26/856)           
...
2020-01-16T03:00:28.3984234Z Resolving deltas: 100% (417/417), done.
2020-01-16T03:00:28.3984993Z From https://partners.macadamian.com/gerrit/a/mdgateway-mdgdemo
2020-01-16T03:00:28.3985319Z  * [new branch]      master     -> origin/master
2020-01-16T03:00:28.4871619Z ##[command]git checkout --progress --force refs/remotes/origin/master
2020-01-16T03:00:28.4874383Z Note: switching to 'refs/remotes/origin/master'.
2020-01-16T03:00:28.4874483Z 
2020-01-16T03:00:28.4874774Z You are in 'detached HEAD' state. You can look around, make experimental
2020-01-16T03:00:28.4874905Z changes and commit them, and you can discard any commits you make in this
2020-01-16T03:00:28.4875039Z state without impacting any branches by switching back to a branch.
2020-01-16T03:00:28.4875122Z 
2020-01-16T03:00:28.4875386Z If you want to create a new branch to retain commits you create, you may
2020-01-16T03:00:28.4875732Z do so (now or later) by using -c with the switch command. Example:
2020-01-16T03:00:28.4875824Z 
2020-01-16T03:00:28.4876049Z   git switch -c <new-branch-name>
2020-01-16T03:00:28.4876123Z 
2020-01-16T03:00:28.4876210Z Or undo this operation with:
2020-01-16T03:00:28.4876265Z 
2020-01-16T03:00:28.4876485Z   git switch -
2020-01-16T03:00:28.4876536Z 
2020-01-16T03:00:28.4876641Z Turn off this advice by setting config variable advice.detachedHead to false
2020-01-16T03:00:28.4876726Z 
2020-01-16T03:00:28.4876829Z HEAD is now at 6edf9ec Added special file for staging, removed landscape
2020-01-16T03:00:28.4877693Z ##[command]git remote set-url origin https://***@partners.macadamian.com/gerrit/a/mdgateway-mdgdemo
2020-01-16T03:00:28.4880668Z ##[command]git remote set-url --push origin https://***@partners.macadamian.com/gerrit/a/mdgateway-mdgdemo
2020-01-16T03:00:28.4914507Z ##[section]Finishing: Checkout

日志文件:不起作用时

2020-01-20T14:54:57.9988687Z ##[section]Starting: Checkout repository@master to s
2020-01-20T14:54:57.9990848Z ==============================================================================
2020-01-20T14:54:57.9991037Z Task         : Get sources
2020-01-20T14:54:57.9991189Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-20T14:54:57.9991357Z Version      : 1.0.0
2020-01-20T14:54:57.9991441Z Author       : Microsoft
2020-01-20T14:54:57.9991585Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-01-20T14:54:57.9991775Z ==============================================================================
2020-01-20T14:54:58.4808374Z Syncing repository: repository (ExternalGit)
2020-01-20T14:54:58.6686429Z ##[command]git version
2020-01-20T14:54:58.7183612Z git version 2.24.1
2020-01-20T14:54:58.7275067Z ##[command]git lfs version
2020-01-20T14:54:58.8017234Z git-lfs/2.9.2 (GitHub; linux amd64; go 1.13.1)
2020-01-20T14:54:58.8365628Z ##[command]git init "/home/vsts/work/1/s"
2020-01-20T14:54:58.8462491Z Initialized empty Git repository in /home/vsts/work/1/s/.git/
2020-01-20T14:54:58.8510054Z ##[command]git remote add origin https://***@partners.macadamian.com/gerrit/a/mdgateway-mdgdemo
2020-01-20T14:54:58.8651845Z ##[command]git config gc.auto 0
2020-01-20T14:54:59.6862773Z ##[command]git config --get-all http.https://***@partners.macadamian.com/gerrit/a/mdgateway-mdgdemo.extraheader
2020-01-20T14:54:59.6866098Z ##[command]git config --get-all http.proxy
2020-01-20T14:54:59.6872351Z ##[command]git remote set-url origin https://***:***@partners.macadamian.com/gerrit/a/mdgateway-mdgdemo
2020-01-20T14:54:59.6878555Z ##[command]git remote set-url --push origin https://***:***@partners.macadamian.com/gerrit/a/mdgateway-mdgdemo
2020-01-20T14:54:59.6882565Z ##[command]git fetch --force --tags --prune --progress --no-recurse-submodules origin
2020-01-20T14:54:59.6886270Z remote: Counting objects: 1           
2020-01-20T14:54:59.6886446Z remote: Counting objects: 856, done        
2020-01-20T14:54:59.6886701Z remote: Finding sources:   1% (9/856)           
...
2020-01-20T14:54:59.9019224Z Resolving deltas: 100% (417/417), done.
2020-01-20T14:54:59.9020439Z From https://partners.macadamian.com/gerrit/a/mdgateway-mdgdemo
2020-01-20T14:54:59.9020866Z  * [new branch]      master     -> origin/master
2020-01-20T14:55:00.0065267Z ##[command]git checkout --progress --force
2020-01-20T14:55:00.0067477Z fatal: You are on a branch yet to be born
2020-01-20T14:55:00.0128473Z ##[error]Git checkout failed with exit code: 128
2020-01-20T14:55:00.0176542Z ##[section]Finishing: Checkout repository@master to s

如您所见,两个日志文件之间的区别是(靠近底部),它是在尝试执行“ git checkout”的时候:

  • git checkout --progress --force refs / remotes / origin / master(工作时)
  • git checkout --progress --force(不起作用时)

基本上,代理在执行git checkout命令时不再尝试指定分支名称(在我的情况下为master)。这就是为什么它不起作用。我唯一可以解释的是Microsoft在git checkout任务中做了一些更改,并引入了回归。现在,我看不到任何解决方法。

谢谢, 斯蒂芬。

1 个答案:

答案 0 :(得分:1)

对于此问题,Azure Devops最近有multiple pipeline service degradation events,这可能就是您遇到上述问题的原因。

一些用户在1月17日左右遇到了类似的git checkout错误:Git checkout failed with exit code: 128

在开发者社区论坛上类似的case中,用户使用github作为远程仓库,作为一种解决方法,他完全重新运行了管道(使用/ azp run)。这通常可以解决问题,但是非常耗时

此问题正在调查中,您可以对该票进行表决,并将您的情况作为评论添加到反馈中。如果该问题在解决之后仍然存在,我们的工程师将进行进一步调查。