runner-images icon indicating copy to clipboard operation
runner-images copied to clipboard

Azure DevOps agent issue: Microsoft.Azure.DevOps.Pipelines.Agent externsion Could not create lock directory '/agent/.agent.lock

Open samjack7th-sys opened this issue 4 weeks ago • 1 comments

Description

Getting this issue reported here after updating image to 22.04 -> https://github.com/microsoft/azure-pipelines-agent/issues/5312

Reverting image back to 20.04 fixed the issue.

Platforms affected

  • [x] Azure DevOps
  • [x] GitHub Actions - Standard Runners
  • [x] GitHub Actions - Larger Runners

Runner images affected

  • [x] Ubuntu 22.04
  • [x] Ubuntu 24.04
  • [ ] Ubuntu Slim
  • [ ] macOS 14
  • [ ] macOS 14 Arm64
  • [ ] macOS 15
  • [ ] macOS 15 Arm64
  • [ ] macOS 26 Arm64
  • [ ] Windows Server 2019
  • [ ] Windows Server 2022
  • [ ] Windows Server 2025

Image version and build link

https://github.com/actions/runner-images

Is it regression?

No

Expected behavior

Should not get an issue

Actual behavior

VMSS agent and not getting deployed and having scale issues

Repro steps

Updated image to 20.04 and ran Devops jobs and the instances (Agents) never come up for their job

samjack7th-sys avatar Dec 16 '25 19:12 samjack7th-sys

Description

Getting this issue reported here after updating image to 22.04 -> microsoft/azure-pipelines-agent#5312

Also happens with ubuntu 24.04 ?

ghost avatar Dec 16 '25 20:12 ghost

Yes, as per the OP -> https://github.com/microsoft/azure-pipelines-agent/issues/5312

samjack7th-sys avatar Dec 16 '25 20:12 samjack7th-sys

Yes, as per the OP -> microsoft/azure-pipelines-agent#5312

Ok.

ghost avatar Dec 16 '25 20:12 ghost

Hey @samjack7th-sys! :wave

Thanks for the report.

Unfortunately, this is not an issue in runner-images and does not require changes on our side.

The failure happens inside the Azure DevOps VMSS agent extension (Microsoft.Azure.DevOps.Pipelines.Agent) before the agent is registered. The error

Could not create lock directory '/agent/.agent.lock'

means the extension cannot create the agent lock directory at the path defined by:

"agentFolder": "/agent"

This path is absolute and resolves to /agent at the root filesystem, not a user home directory. If /agent does not exist or is not writable for the user running the extension, the agent setup fails and the VM remains stuck in creating/running.

The agentFolder value is fully user-controlled, and runner-images does not create or manage \agent directorie. The issue is therefore related to Azure DevOps agent extension behavior and its configuration, not the base image.

Recommended actions: • Use a writable, non-root path for agentFolder (e.g. /home//agent), or • Pre-create /agent with correct ownership and permissions before the extension runs.

For further investigation, please contact Azure DevOps Pipelines / Agent support.


NOTE: Our Ubuntu images already include the acl package. Reinstalling acl is not required and does not address this failure.

erik-bershel avatar Dec 17 '25 09:12 erik-bershel