Skip to content

[Question]: Microsoft.Azure.DevOps.Pipelines.Agent externsion Could not create lock directory '/agent/.agent.lock' '. #5312

@Gaurdevops

Description

@Gaurdevops

Describe your question

We are using the Azure Self Hosted agents , Pool type - Azure Virtual Machine Scale set. We are observing a lot our Virtual Machines are stuck in creating(running) state. And are not getting registered with the Azure Devops Server.
This is error we are seeing -

VM has reported a failure when processing extension 'Microsoft.Azure.DevOps.Pipelines.Agent' (publisher 'Microsoft.VisualStudio.Services' and type 'TeamServicesAgentLinux'). Error message: 'The Extension failed to execute: Pipeline script execution failed with exit code 1. 2025-09-05 04:42:45 Could not create lock directory '/agent/.agent.lock' '.

Its blocking quite a bit. Does anyone know or have seen this error? Has something changed?

Versions

Azure DevOps Service - Version Dev20.M261.1 (AzureDevOps_M261_20250901.4)
OS - ubuntu2404

{
"isPipelinesAgent": true,
"agentFolder": "/agent",
"agentDownloadUrl": "https://download.agent.dev.azure.com/agent/4.260.0/vsts-agent-linux-x64-4.260.0.tar.gz",
"enableScriptDownloadUrl": "https://vstsagenttools.blob.core.windows.net/tools/ElasticPools/Linux/17/enableagent.sh"
}

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)

Operation system

Ubuntu2404

Version controll system

No response

Azure DevOps Server Version (if applicable)

No response

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