0

TFS2017 を GitHub for Enterprise に接続したいと考えています。

  • 「外部 Git」に新しいサービス エンドポイントを追加しました
  • 私のgheユーザー名と個人用アクセストークンを使用して構成しました
  • 新しいビルド定義を追加
  • 選択された外部 git と、構成されたばかりのサービス
  • 入力したリポジトリの名前 (ドロップダウンなし、完全な https://ghe.mycompany.com/myUsername/myTestRepository.gitを含むさまざまな形式を試しました)
  • 新しいビルドをトリガーしました

複製しようとするとエラーが発生します。「ソースの取得」ステップでエラーが発生する (1_Get_sources.txt)

2016-11-21T13:31:20.4836373Z Syncing repository: https://ghe.mycompany.com/********/myTestRepository.git (Git)
2016-11-21T13:31:20.5326404Z Starting clone
2016-11-21T13:31:21.0286690Z ##[error]LibGit2Sharp.LibGit2SharpException: Request failed with status code: 404
2016-11-21T13:31:21.0296729Z ##[error]   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
2016-11-21T13:31:21.0306726Z ##[error]   at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts)
2016-11-21T13:31:21.0316723Z ##[error]   at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options)
2016-11-21T13:31:21.0336678Z ##[error]   at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.CloneRepository(String repositoryPath, Uri repositoryUrl, Boolean checkoutSubmodules, String username, String password)
2016-11-21T13:31:21.0346735Z ##[error]   at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncRepository(Uri repositoryUrl, String rootPath, Boolean cleanRepository, Boolean checkoutSubmodules, String sourceVersion, String username, String password)
2016-11-21T13:31:21.0356736Z ##[error]   at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncRepository(ITaskEndpoint endpoint, String rootPath, Boolean cleanRepository, Boolean checkoutSubmodules, String sourceVersion)
2016-11-21T13:31:21.0366732Z ##[error]   at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncAndCheckout(Boolean cleanRepository, String sourceBranch, String sourceVersion, Boolean checkoutSubmodules, CancellationToken cancellationToken)
2016-11-21T13:31:21.0376729Z ##[error]   at Microsoft.TeamFoundation.DistributedTask.Plugin.Build.GitSourceProvider.<>c__DisplayClass3_0.<PrepareRepositoryAsync>b__0()

Localy (TFS サーバー上) では、powershell を使用してクローンを作成できます。ビルド ステップでスクリプトを実行すると、同じプロキシ設定が使用されていることを確認できます。

以下は、_diag フォルダーからのその他のデバッグです。

    11:35:23.072987 BaseLogger.LogConsoleMessage(scope.JobId = af970025-e4bc-4692-a708-bbe734745370, message = Syncing repository: https://ghe.mycompany.com/********/myTestRepository.git (Git))
11:35:23.076124 BaseLogger.LogConsoleMessage(scope.JobId = af970025-e4bc-4692-a708-bbe734745370, message = repository url=https://ghe.mycompany.com/api/v3)
11:35:23.078235 BaseLogger.LogConsoleMessage(scope.JobId = af970025-e4bc-4692-a708-bbe734745370, message = checkoutSubmodules=False)
11:35:23.087627 Syncing and checking out sources.
11:35:23.087627 rootPath=C:\TfsBuildAgents\Agent-smi-build01\_work\22\s
11:35:23.087627 cleanRepository=True
11:35:23.087627 sourceBranch=master
11:35:23.087627 sourceVersion=
11:35:23.088628 sourcesToBuild=refs/remotes/origin/master
11:35:23.092875 Checking if the repo on disk matches the expected repository URL.
11:35:23.092875 gitRepoFolder=C:\TfsBuildAgents\Agent-smi-build01\_work\22\s
11:35:23.092875 expectedRepositoryUrl=https://ghe.mycompany.com/api/v3
11:35:23.120701 Unable to determine whether the existing repo matches. Suppressing the exception and treating the repo as if it doesn't match. For verbose purposes only, the exception is: LibGit2Sharp.RepositoryNotFoundException: Path 'C:\TfsBuildAgents\Agent-smi-build01\_work\22\s' doesn't point at a valid Git repository or workdir.
   at LibGit2Sharp.Core.Proxy.git_repository_open(String path)
   at LibGit2Sharp.Repository..ctor(String path, RepositoryOptions options, RepositoryRequiredParameter requiredParameter)
   at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.IsExpectedRepository(String gitRepoFolder, Uri expectedRepositoryUrl)
11:35:23.127765 BaseLogger.LogConsoleMessage(scope.JobId = af970025-e4bc-4692-a708-bbe734745370, message = Starting clone)
11:35:23.133909 Process logging event with task handler.
11:35:23.613344 ---------------------------------------------------------------------------
11:35:23.615482 LibGit2Sharp.LibGit2SharpException: Request failed with status code: 404

11:35:23.615482    at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)

11:35:23.615482    at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts)

11:35:23.615482    at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options)

11:35:23.615482    at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.CloneRepository(String repositoryPath, Uri repositoryUrl, Boolean checkoutSubmodules, String username, String password)

11:35:23.615482    at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncRepository(Uri repositoryUrl, String rootPath, Boolean cleanRepository, Boolean checkoutSubmodules, String sourceVersion, String username, String password)

11:35:23.616553    at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncRepository(ITaskEndpoint endpoint, String rootPath, Boolean cleanRepository, Boolean checkoutSubmodules, String sourceVersion)

11:35:23.616553    at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncAndCheckout(Boolean cleanRepository, String sourceBranch, String sourceVersion, Boolean checkoutSubmodules, CancellationToken cancellationToken)

11:35:23.616553    at Microsoft.TeamFoundation.DistributedTask.Plugin.Build.GitSourceProvider.<>c__DisplayClass3_0.<PrepareRepositoryAsync>b__0()
11:35:23.616553    at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)

11:35:23.616553    at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts)

11:35:23.616553    at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options)

11:35:23.616553    at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.CloneRepository(String repositoryPath, Uri repositoryUrl, Boolean checkoutSubmodules, String username, String password)

11:35:23.616553    at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncRepository(Uri repositoryUrl, String rootPath, Boolean cleanRepository, Boolean checkoutSubmodules, String sourceVersion, String username, String password)

11:35:23.616553    at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncRepository(ITaskEndpoint endpoint, String rootPath, Boolean cleanRepository, Boolean checkoutSubmodules, String sourceVersion)

11:35:23.616553    at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncAndCheckout(Boolean cleanRepository, String sourceBranch, String sourceVersion, Boolean checkoutSubmodules, CancellationToken cancellationToken)

11:35:23.616553    at Microsoft.TeamFoundation.DistributedTask.Plugin.Build.GitSourceProvider.<>c__DisplayClass3_0.<PrepareRepositoryAsync>b__0()
11:35:23.617555 ---------------------------------------------------------------------------
11:35:23.618654 Process logging event with task handler.
11:35:23.623821 BaseLogger.LogConsoleMessage(scope.JobId = af970025-e4bc-4692-a708-bbe734745370, message = ##[error]LibGit2Sharp.LibGit2SharpException: Request failed with status code: 404)
11:35:23.624910 BaseLogger.LogConsoleMessage(scope.JobId = af970025-e4bc-4692-a708-bbe734745370, message = ##[error]   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result))
11:35:23.625909 BaseLogger.LogConsoleMessage(scope.JobId = af970025-e4bc-4692-a708-bbe734745370, message = ##[error]   at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts))
11:35:23.626974 BaseLogger.LogConsoleMessage(scope.JobId = af970025-e4bc-4692-a708-bbe734745370, message = ##[error]   at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options))
11:35:23.627973 BaseLogger.LogConsoleMessage(scope.JobId = af970025-e4bc-4692-a708-bbe734745370, message = ##[error]   at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.CloneRepository(String repositoryPath, Uri repositoryUrl, Boolean checkoutSubmodules, String username, String password))
11:35:23.629042 BaseLogger.LogConsoleMessage(scope.JobId = af970025-e4bc-4692-a708-bbe734745370, message = ##[error]   at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncRepository(Uri repositoryUrl, String rootPath, Boolean cleanRepository, Boolean checkoutSubmodules, String sourceVersion, String username, String password))
11:35:23.630112 BaseLogger.LogConsoleMessage(scope.JobId = af970025-e4bc-4692-a708-bbe734745370, message = ##[error]   at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncRepository(ITaskEndpoint endpoint, String rootPath, Boolean cleanRepository, Boolean checkoutSubmodules, String sourceVersion))
11:35:23.631180 BaseLogger.LogConsoleMessage(scope.JobId = af970025-e4bc-4692-a708-bbe734745370, message = ##[error]   at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncAndCheckout(Boolean cleanRepository, String sourceBranch, String sourceVersion, Boolean checkoutSubmodules, CancellationToken cancellationToken))
11:35:23.632188 BaseLogger.LogConsoleMessage(scope.JobId = af970025-e4bc-4692-a708-bbe734745370, message = ##[error]   at Microsoft.TeamFoundation.DistributedTask.Plugin.Build.GitSourceProvider.<>c__DisplayClass3_0.<PrepareRepositoryAsync>b__0())
11:35:23.634183 Process logging event with task handler.
11:35:23.638350 BaseLogger.LogStatus(scope.JobId = af970025-e4bc-4692-a708-bbe734745370, scope.TimelineRecordId = 2fd7ca75-f01d-4906-bf39-7c8d66a1df7f, record.Name = )
11:35:23.649716 BaseLogger.LogAttachment(scope.JobId = af970025-e4bc-4692-a708-bbe734745370, type = DistributedTask.Core.Log, name = Get sources, path = C:\TfsBuildAgents\Agent-smi-build01\_diag\w7ac045c8-3285-4be2-b993-b542da560c11.log)
11:35:23.658368 ---------------------------------------------------------------------------
11:35:23.660442 System.AggregateException: One or more errors occurred. ---> Microsoft.TeamFoundation.DistributedTask.Agent.Common.AgentExecutionTerminationException: Prepare repository failed with exception. ---> LibGit2Sharp.LibGit2SharpException: Request failed with status code: 404

これをデバッグする方法、または何を試すことができるか考えていますか?

4

1 に答える 1