0

我在代理池配置中定义了 1 个名为“ios_dockeragent”的代理:

设置/代理池/默认

在我的 Azure DevOps 组织中,我购买了 4 个并行作业和 3 个并行托管作业,因此我没有并行作业问题。

从每个构建服务器,我像这样启动自托管服务器,其中“ios_dockeragent”在devops中定义:

docker run -d --rm -t --name=ios_docker_64 -e AZP_WORK=/temp/working_dir -v =/temp/working_dir:/azp -e AZP_URL=https://dev.azure.com/xx -e AZP_TOKEN=nhxxxxxxxxxxmxhu76mlua -e AZP_AGENT_NAME=ios_dockeragent

当我在 2 个不同的服务器上并行运行 2 个作业时,我从代理日志中收到此错误:

   X-VSS-E2EID: 2e6e97b5-f604-4b50-85ad-9fdd0db544c1^M
X-Frame-Options: SAMEORIGIN^M
X-TFS-FedAuthRealm: https://tfsprodweu6.visualstudio.com/^M
X-TFS-FedAuthIssuer: https://dev.azure.com/xxxx/^M
X-VSS-AuthorizationEndpoint: https://vssps.dev.azure.com/xxxx/^M
X-VSS-ResourceTenant: 789cbce2-e568-40be-96e3-81dddf6281f8^M
X-VSS-S2STargetService: 00000002-0000-8888-8000-000000000000/visualstudio.com^M
X-TFS-FedAuthRedirect: https://spsprodweu2.vssps.visualstudio.com/_signin?realm=dev.azure.com&reply_to=https%3A%2F%2Fdev.azure.com%2Fxxxx%2F_apis%2Fdistributedtask%2Fpools%2F1%2Fsessions&redirect=1&hid=78104741-e137-429a-b184-f357f35f83cb&context=eyJodCI6MiwiaGlkIjoiY2M2ODE0M2UtNm90#ctx=eyJTaWduSW5Db29raWVEb21haW5zIjpbImh0dHBzOi8vbG9naW4ubWljcm9zb2Z0b25saW5lLmNvbSIsImh0dHBzOi^M
Request-Context: appId=cid-v1:75f7e064-d741-4620-89f0-b5624ba3fe6d^M
Access-Control-Expose-Headers: Request-Context^M
X-Content-Type-Options: nosniff^M
X-MSEdge-Ref: Ref A: 3FE913B29BEF4D0194FD70F345C6AAE6 Ref B: ASHEDGE1414 Ref C: 2020-10-12T13:28:49Z^M
Date: Mon, 12 Oct 2020 13:28:49 GMT^M

[2020-10-12 13:28:49Z INFO RSAFileKeyManager] Loading RSA key parameters from file /azp/agent/.credentials_rsaparams
[2020-10-12 13:28:49Z INFO RSAFileKeyManager] Loading RSA key parameters from file /azp/agent/.credentials_rsaparams
[2020-10-12 13:28:50Z INFO VisualStudioServices] AAD Correlation ID for this token request: Unknown
[2020-10-12 13:28:50Z ERR  VisualStudioServices] POST request to https://dev.azure.com/xxxx/_apis/distributedtask/pools/1/sessions failed. HTTP Status: Conflict, AFD Ref: Ref A: BBBA7D16EF4349E283B21690EB631FDA Ref B: ASHEDGE1414 Ref C: 2020-10-12T13:28:50Z
[2020-10-12 13:28:50Z ERR  MessageListener] Catch exception during create session.
[2020-10-12 13:28:50Z ERR  MessageListener] Microsoft.TeamFoundation.DistributedTask.WebApi.TaskAgentSessionConflictException: The task agent ios_dockeragent already has an active session for owner b192db24b4c0.
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.Agent.Listener.MessageListener.CreateSessionAsync(CancellationToken token)
[2020-10-12 13:28:50Z INFO MessageListener] The session for this agent already exists.
[2020-10-12 13:28:50Z ERR  Terminal] WRITE ERROR: A session for this agent already exists.
[2020-10-12 13:28:50Z INFO MessageListener] The session conflict exception haven't reached retry limit.
[2020-10-12 13:28:50Z ERR  Terminal] WRITE ERROR: 2020-10-12 13:28:50Z: Agent connect error: The task agent ios_dockeragent already has an active session for owner b192xx4b4c0.. Retrying until reconnected.
[2020-10-12 13:28:50Z INFO MessageListener] Sleeping for 30 seconds before retrying.
[2020-10-12 13:29:20Z INFO MessageListener] Attempt to create session.
[2020-10-12 13:29:20Z INFO MessageListener] Connecting to the Agent Server...
[2020-10-12 13:29:20Z INFO AgentServer] Establish connection with 60 seconds timeout.
[2020-10-12 13:29:20Z INFO VisualStudioServices] Starting operation Location.GetConnectionData
[2020-10-12 13:29:20Z INFO AgentServer] Establish connection with 60 seconds timeout.
[2020-10-12 13:29:20Z INFO VisualStudioServices] Starting operation Location.GetConnectionData
[2020-10-12 13:29:20Z INFO AgentServer] Establish connection with 60 seconds timeout.
[2020-10-12 13:29:20Z INFO VisualStudioServices] Starting operation Location.GetConnectionData
[2020-10-12 13:29:20Z INFO VisualStudioServices] Finished operation Location.GetConnectionData
[2020-10-12 13:29:20Z INFO VisualStudioServices] Finished operation Location.GetConnectionData
[2020-10-12 13:29:20Z INFO VisualStudioServices] Finished operation Location.GetConnectionData
[2020-10-12 13:29:20Z INFO MessageListener] VssConnection created
[2020-10-12 13:29:20Z ERR  VisualStudioServices] POST request to https://dev.azure.com/xxxx/_apis/distributedtask/pools/1/sessions failed. HTTP Status: Conflict, AFD Ref: Ref A: 00584079848E4626B042E394EC5F89B7 Ref B: BL2EDGE0921 Ref C: 2020-10-12T13:29:20Z
[2020-10-12 13:29:20Z ERR  MessageListener] Catch exception during create session.
[2020-10-12 13:29:20Z ERR  MessageListener] Microsoft.TeamFoundation.DistributedTask.WebApi.TaskAgentSessionConflictException: The task agent ios_dockeragent already has an active session for owner b192db24b4c0.
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.Agent.Listener.MessageListener.CreateSessionAsync(CancellationToken token)
[2020-10-12 13:29:20Z INFO MessageListener] The session for this agent already exists.
[2020-10-12 13:29:20Z ERR  Terminal] WRITE ERROR: A session for this agent already exists.
[2020-10-12 13:29:20Z INFO MessageListener] The session conflict exception haven't reached retry limit.
[2020-10-12 13:29:20Z INFO MessageListener] Sleeping for 30 seconds before retrying.
[2020-10-12 13:29:36Z INFO Terminal] WRITE LINE: Exiting...
[2020-10-12 13:29:36Z INFO ConfigurationStore] IsServiceConfigured()
[2020-10-12 13:29:36Z INFO ConfigurationStore] IsServiceConfigured: False
[2020-10-12 13:29:36Z INFO HostContext] Agent will be shutdown for UserCancelled
[2020-10-12 13:29:36Z INFO AgentProcess] Agent execution been cancelled.
                                                                                         
                                                                                             

我只配置了我在这里看到的 1 个代理: 在此处输入图像描述

我需要配置什么来运行超过 1 个自托管代理?

4

1 回答 1

1

代理需要一个唯一的名称。您正在尝试运行多个具有相同名称的代理:

AZP_AGENT_NAME=ios_dockeragent.

如果要运行多个代理,请为其提供唯一名称。

于 2020-10-12T19:06:29.553 回答