Skip to content

[BUG]: Pool xxxxxx already contains an agent with name xxxxxx. #5174

Open
@aland-semperis

Description

@aland-semperis

What happened?

I can't add a vm to an agent pool. This was working fine yesterday with no changes to this since then.

[2025-04-11 18:48:13Z ERR Agent] Microsoft.TeamFoundation.DistributedTask.WebApi.TaskAgentExistsException: Pool environment-xxxxxx already contains an agent with name xxxxxx.
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, IEnumerable1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable1 queryParameters, Object userState, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.EnvironmentVMResourceConfigProvider.AddAgentAsync(AgentSettings agentSettings, TaskAgent agent, CommandSettings command) in D:\a\1\s\src\Agent.Listener\Configuration\ConfigurationProvider.cs:line 482
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.ConfigurationManager.ConfigureAsync(CommandSettings command) in D:\a\1\s\src\Agent.Listener\Configuration\ConfigurationManager.cs:line 253
at Microsoft.VisualStudio.Services.Agent.Listener.Agent.ExecuteCommand(CommandSettings command) in D:\a\1\s\src\Agent.Listener\Agent.cs:line 103
[2025-04-11 18:48:13Z ERR Terminal] WRITE ERROR: Pool xxxxxxx already contains an agent with name xxxxxxxx.

[2025-04-11 18:48:08Z INFO CommandSettings] Configure {
"AcceptTeeEula": false,
"AddDeploymentGroupTags": false,
"AddEnvironmentVirtualMachineResourceTags": true,
"AddMachineGroupTags": false,
"AlwaysExtractTask": false,
"Agent": "xxxxxxxxx",
"CollectionName": null,
"DeploymentGroup": false,
"DeploymentGroupName": null,
"DeploymentGroupTags": null,
"DeploymentPool": false,
"DeploymentPoolName": null,
"EnableServiceSidTypeUnrestricted": false,
"EnvironmentVMResource": true,
"EnvironmentName": "xxxxxx",
"EnvironmentVMResourceTags": "tags",
"GitUseSChannel": false,
"DisableLogUploads": false,
"MachineGroup": false,
"MachineGroupName": null,
"MachineGroupTags": null,
"MonitorSocketAddress": null,
"NotificationPipeName": null,
"NotificationSocketAddress": null,
"NoRestart": false,
"OverwriteAutoLogon": false,
"Pool": null,
"ProjectName": "xxxxxxxx",
"ProxyPassword": null,
"ProxyUserName": null,
"ProxyUrl": null,
"Replace": true,
"RunAsAutoLogon": false,
"RunAsService": true,
"RunOnce": false,
"PreventServiceStart": false,
"SslCACert": null,
"SslClientCert": null,
"SslClientCertArchive": null,
"SslClientCertKey": null,
"SslClientCertPassword": null,
"SslSkipCertValidation": false,
"Url": "xxxxxxx",
"WindowsLogonAccount": "xxxxxx",
"WindowsLogonPassword": null,
"Work": "_work",
"Auth": "PAT",
"LaunchBrowser": false,
"Password": null,
"Token": "***",
"Unattended": true,
"UserName": null,
"ClientId": null,
"TenantId": null,
"ClientSecret": null,
"Help": false,
"Version": false
}

Versions

When we first run the install it is 3.227.2.

Then normally it updates itself once it starts running.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

No response

Version controll system

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions