【问题标题】:Unable to download artifact from azure repo for release pipeline in azure devops server无法从 azure repo 下载工件以用于 azure devops 服务器中的发布管道
【发布时间】:2021-05-20 23:04:32
【问题描述】:

无法从 azure repo 下载工件以用于 azure devops 服务器中的发布管道

尝试在 azure devops 服务器/TFS 中创建发布管道,我将 deplpyment yamls 保存在 azure repo 中,大多数人在尝试所有可能的解决方案时都死了

2021-02-18T01:29:00.4023196Z ##[debug]Evaluating: SucceededNode()
2021-02-18T01:29:00.4028590Z ##[debug]Evaluating SucceededNode:
2021-02-18T01:29:00.4062985Z ##[debug]=> True
2021-02-18T01:29:00.4084197Z ##[debug]Result: True
2021-02-18T01:29:00.4139706Z ##[section]Starting: Download Artifacts
2021-02-18T01:29:00.4228690Z Creating artifacts directory: C:\application2_agent\_work\r1\a
2021-02-18T01:29:00.4312837Z Created artifacts directory: C:\application2_agent\_work\r1\a
2021-02-18T01:29:00.4312949Z Downloading artifact
2021-02-18T01:29:00.4322919Z Starting artifacts download...
2021-02-18T01:29:00.4333439Z Downloading linked artifact application-ebx-acc-repo of type TFGit...
2021-02-18T01:29:00.4357233Z Ensuring artifact folder C:\application2_agent\_work\r1\a\application-ebx-acc-repo exists and is clean.
2021-02-18T01:29:00.4588608Z Syncing repository: 18c91948-ed72-4057-8f2f-3dcf1cf9eb97 (Git)
2021-02-18T01:29:00.4622920Z Prepending Path environment variable with directory containing 'git.exe'.
2021-02-18T01:29:00.4628360Z ##[debug]Path: 'C:\application2_agent\externals\git\cmd;C:\Program Files\Common Files\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Users\tsiadm\Downloads;C:\Program Files\Docker;F:\agentutility\apache-maven-3.6.3\bin;C:\PROGRA~1\Java\jdk-15.0.2\bin;C:\Users\admjawedt02\AppData\Local\Microsoft\WindowsApps'
2021-02-18T01:29:00.4649646Z ##[debug]Get git version.
2021-02-18T01:29:00.4665743Z ##[command]git version
2021-02-18T01:29:00.5619545Z git version 2.18.0.windows.1
2021-02-18T01:29:00.5642621Z ##[debug]Detect git version: 2.18.0.
2021-02-18T01:29:00.5726643Z ##[debug]Get git-lfs version.
2021-02-18T01:29:00.5727602Z ##[command]git lfs version
2021-02-18T01:29:00.7459095Z git-lfs/2.12.1 (GitHub; windows amd64; go 1.14.10; git 85b28e06)
2021-02-18T01:29:00.7460870Z ##[debug]Detect git-lfs version: '2.12.1'.
2021-02-18T01:29:00.7464636Z ##[debug]Set git useragent to: git/2.18.0 (vsts-agent-git/2.144.2).
2021-02-18T01:29:00.7500381Z ##[debug]Checking if the repo on C:\application2_agent\_work\r1\a\application-ebx-acc-repo matches the expected repository origin URL. expected Url: https://azdevops.demo.net/DefaultCollection/Datsoul/_git/Datsoul
2021-02-18T01:29:00.7501113Z ##[debug]Repository is not found since '.git' directory does not exist under. C:\application2_agent\_work\r1\a\application-ebx-acc-repo
2021-02-18T01:29:00.7526034Z ##[debug]Init git repository at: C:\application2_agent\_work\r1\a\application-ebx-acc-repo.
2021-02-18T01:29:00.7540690Z ##[command]git init "C:\application2_agent\_work\r1\a\application-ebx-acc-repo"
2021-02-18T01:29:00.8541126Z Initialized empty Git repository in C:/application2_agent/_work/r1/a/application-ebx-acc-repo/.git/
2021-02-18T01:29:00.8615931Z ##[debug]Add git remote: origin to url: https://azdevops.demo.net/DefaultCollection/Datsoul/_git/Datsoul for repository under: C:\application2_agent\_work\r1\a\application-ebx-acc-repo.
2021-02-18T01:29:00.8616101Z ##[command]git remote add origin https://azdevops.demo.net/DefaultCollection/Datsoul/_git/Datsoul
2021-02-18T01:29:00.9703602Z ##[debug]Disable git auto garbage collection.
2021-02-18T01:29:00.9703752Z ##[command]git config gc.auto 0
2021-02-18T01:29:01.0556858Z ##[debug]Checking git config http.https://azdevops.demo.net/DefaultCollection/Datsoul/_git/Datsoul.extraheader exist or not
2021-02-18T01:29:01.0557012Z ##[command]git config --get-all http.https://azdevops.demo.net/DefaultCollection/Datsoul/_git/Datsoul.extraheader
2021-02-18T01:29:01.1484525Z ##[debug]Checking git config http.proxy exist or not
2021-02-18T01:29:01.1484704Z ##[command]git config --get-all http.proxy
2021-02-18T01:29:01.2489712Z ##[debug]Remove any proxy setting from git config.
2021-02-18T01:29:01.2524557Z ##[debug]Unset git config --unset-all http.proxy
2021-02-18T01:29:01.2524692Z ##[command]git config --unset-all http.proxy
2021-02-18T01:29:01.3521192Z ##[warning]Unable to remove "http.proxy" from the git config. To remove the credential, execute "git config --unset-all http.proxy" from the repository root "http.proxy".
2021-02-18T01:29:01.3559540Z ##[debug]Fetch git repository at: C:\application2_agent\_work\r1\a\application-ebx-acc-repo remote: origin.
2021-02-18T01:29:01.3580216Z ##[command]git -c http.extraheader="AUTHORIZATION: bearer ***" fetch --tags --prune --progress --no-recurse-submodules origin
2021-02-18T01:29:01.5248741Z fatal: could not read Password for 'http://satyam@xyz.net@10.220.129.49:80': terminal prompts disabled
2021-02-18T01:29:01.5514915Z An error occurred during download: Microsoft.VisualStudio.Services.Agent.Worker.Release.Artifacts.ArtifactDownloadException: Unexpected error occurred while downloading artifacts ---> System.InvalidOperationException: Git fetch failed with exit code: 128
   at Microsoft.VisualStudio.Services.Agent.Worker.Build.GitSourceProvider.GetSourceAsync(IExecutionContext executionContext, ServiceEndpoint endpoint, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.Agent.Worker.Release.Artifacts.TfsGitArtifact.DownloadAsync(IExecutionContext executionContext, ArtifactDefinition artifactDefinition, String downloadFolderPath)
   --- End of inner exception stack trace ---
   at 
Microsoft.VisualStudio.Services.Agent.Worker.Build.GitSourceProvider.GetSourceAsync(IExecutionContext executionContext, ServiceEndpoint endpoint, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.Agent.Worker.Release.Artifacts.TfsGitArtifact.DownloadAsync(IExecutionContext executionContext, ArtifactDefinition artifactDefinition, String downloadFolderPath)
   --- End of inner exception stack trace ---
   at 
Microsoft.VisualStudio.Services.Agent.Worker.Release.ReleaseJobExtension.DownloadArtifacts(IExecutionContext executionContext, IList`1 agentArtifactDefinitions, String artifactsWorkingFolder)
   at Microsoft.VisualStudio.Services.Agent.Worker.Release.ReleaseJobExtension.DownloadArtifactsAndCommitsAsync(IExecutionContext executionContext, Object data)
2021-02-18T01:29:01.5566770Z ##[error]Unexpected error occurred while downloading artifacts
2021-02-18T01:29:01.5570926Z ##[debug]Microsoft.VisualStudio.Services.Agent.Worker.Release.Artifacts.ArtifactDownloadException: Unexpected error occurred while downloading artifacts ---> System.InvalidOperationException: Git fetch failed with exit code: 128
   at Microsoft.VisualStudio.Services.Agent.Worker.Build.GitSourceProvider.GetSourceAsync(IExecutionContext executionContext, ServiceEndpoint endpoint, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.Agent.Worker.Release.Artifacts.TfsGitArtifact.DownloadAsync(IExecutionContext executionContext, ArtifactDefinition artifactDefinition, String downloadFolderPath)
   --- End of inner exception stack trace ---
2021-02-18T01:29:01.5574268Z ##[section]Finishing: Download Artifacts

【问题讨论】:

  • 由于大小限制删除了一些日志
  • 这能回答你的问题吗? VSTS Git Fetch Failed with exit code: 128
  • 嗨,您有机会查看以下答案吗?如果它可以帮助您解决此问题,请告诉我。
  • 是的,我们已经重新配置了一个新的自托管代理,然后它开始工作
  • 很高兴听到它已修复。您可以分享您的解决方案,以防其他社区用户遇到此问题。

标签: git visual-studio github tfs azure-devops


【解决方案1】:

##[警告]无法从 git 配置中删除“http.proxy”。要删除凭据...

致命:无法读取“http://satyam@xyz.net@10.220.129.49:80”的密码:终端提示已禁用

从上面的错误来看,它似乎是由您的代理机器上的 git 代理设置引起的。 git代理设置删除失败,提示询问代理密码。

您可以尝试登录您的代理机器并在本地运行以下命令以从 git config 中删除任何代理设置。

git config --unset-all http.proxy

然后您还需要检查 Windows 上的系统范围配置区域,即 %PROGRAMDATA%\Git\config 文件。您需要手动编辑此配置文件以取消设置代理设置。

您可以运行命令git config --show-origin http.proxy 来获取系统范围的配置区域。见this thread

代理设置从 git config 中删除后。您可以尝试再次运行您的管道。

【讨论】:

    【解决方案2】:

    将工作授权范围限制为当前项目 Azure Pipelines 为当前项目设置提供了两个限制作业授权范围:

    将作业授权范围限制为非发布管道的当前项目 - 此设置适用于 YAML 管道和经典构建管道。此设置不适用于经典发布管道。 将作业授权范围限制为发布管道的当前项目 - 此设置仅适用于经典发布管道。

    【讨论】:

      猜你喜欢
      • 2019-08-01
      • 2020-12-13
      • 1970-01-01
      • 1970-01-01
      • 2021-03-09
      • 2023-01-05
      • 1970-01-01
      • 1970-01-01
      • 2021-09-07
      相关资源
      最近更新 更多