Azure-pipelines-agent: Prevent agents automatically updating

Created on 16 Sep 2019  路  7Comments  路  Source: microsoft/azure-pipelines-agent

Our on-prem self-hosted Azure DevOps server just tried to update the agents and broke our CI/CD pipeline.

Could this "feature" please be made optional - e.g. by a command line switch to opt-out.

no-stale stale

Most helpful comment

I'm also having problems with this.

Our build agents are unable to receive jobs because despite setting agent.disableupdate=true the server sends the update request and awaits the agent to update before considering the agent available.

As the agents are running inside k8s pods this is unwanted. I'd rather use the agent as a stateless deployment.

All 7 comments

This issue is the same as https://github.com/microsoft/azure-pipelines-agent/issues/446 which wasn't resolved.

The agent only updates itself when it must

Agents never have to update themselves. Best practice dictates immutable infrastructure which this clearly breaks. This causes the exact sort of problems experienced by us and in #446

Updating in-place is fragile and too magical - if a build requires a feature from a newer agent I'd expect the build to fail with a meaningful error message which would prompt me to deploy a new agent pool with the updated version - I definitely don't want my existing agents broken.

I'm also having problems with this.

Our build agents are unable to receive jobs because despite setting agent.disableupdate=true the server sends the update request and awaits the agent to update before considering the agent available.

As the agents are running inside k8s pods this is unwanted. I'd rather use the agent as a stateless deployment.

I was going to mention I found agent.disableupdate by grepping the source:
https://github.com/microsoft/azure-pipelines-agent/blob/d9a8b0774e8b6b9d997c0a77ca9686fe849c4584/src/Agent.Listener/Agent.cs#L296

...but we're observing the same behaviour - the server just waits for the agent to update :/

(We're also running agents in containers so if Azure DevOps Server needs updated agents we want to just publish a new image)

We have the same problem.

Update: we 'got around' it by using the script recommended here - https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops - however this process brings in the pre-release agent 2.158.0, when the stable build is showing as 2.155.1. I suspect as our instance just got sprint 158 there was a need to update the agent and maybe the git labels are out of date, so maybe 2.158 is actually the blessed stable version? If not, it would be good to have the process use stable and not preview.

We got around it ("it" being a stalled update) by removing any junctions and re-creating them. In our case bin was deleted by the updater and then it hung/crashed so it's:

mklink /j bin .\bin.2.159.2
rmdir extensions
mklink /j externals externals.2.159.2

Next, restart the agent.

This issue has had no activity in 180 days. Please comment if it is not actually stale

Automatic agent updates can now be disabled in the organization pool settings.

Was this page helpful?
0 / 5 - 0 ratings