How to Manually Update Azure DevOps Services self-hosted agent?

630 views Asked by At

Trying to update with UI command from the web portal the self-hosted agent i get the following error:

[2023-01-22 08:49:33Z INFO Agent] Refresh message received, kick-off selfupdate background process. [2023-01-22 08:49:34Z INFO SelfUpdater] Version '2.214.1' of 'agent' package available in server. [2023-01-22 08:49:34Z INFO SelfUpdater] Current running agent version is 2.213.2 [2023-01-22 08:49:34Z INFO SelfUpdater] An update is available. [2023-01-22 08:49:34Z INFO Terminal] WRITE LINE: Agent update in progress, do not shutdown agent. [2023-01-22 08:49:34Z INFO Terminal] WRITE LINE: Downloading 2.214.1 agent [2023-01-22 08:49:34Z INFO HostContext] Well known directory 'Bin': 'C:\agent\bin' [2023-01-22 08:49:34Z INFO HostContext] Well known directory 'Root': 'C:\agent' [2023-01-22 08:49:34Z INFO HostContext] Well known directory 'Work': 'C:\agent_work' [2023-01-22 08:49:34Z INFO SelfUpdater] Attempt 1: save latest agent into C:\agent_work_update\agent1.zip. [2023-01-22 08:49:34Z INFO SelfUpdater] Download agent: begin download [2023-01-22 08:49:55Z WARN SelfUpdater] Failed to get package 'C:\agent_work_update\agent1.zip' from 'https://vstsagentpackage.azureedge.net/agent/2.214.1/vsts-agent-win-x64-2.214.1.zip'. Exception System.Net.Http.HttpRequestException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) End of inner exception stack trace --- at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) at System.Net.Http.HttpClient.FinishGetStreamAsync(Task1 getTask) at Microsoft.VisualStudio.Services.Agent.Listener.SelfUpdater.DownloadLatestAgent(CancellationToken token) [2023-01-22 08:49:55Z INFO SelfUpdater] Attempt 2: save latest agent into C:\agent_work_update\agent1.zip.

TRIED THE FOLLOWING

  1. trying to download manually - works.
  2. trying to put the downloaded file in the C:\agent_work_update\agent1.zip. - does not work.
  3. Testing download with powershell Invoke-WebRequest "https://vstsagentpackage.azureedge.net/agent/2.214.1/vsts-agent-win-x64-2.214.1.zip" -OutFile "C:\Windows\Temp\archive.zip" - works .
  4. Download with powershell altanate command (New-Object System.Net.WebClient).DownloadFile("https://vstsagentpackage.azureedge.net/agent/2.214.1/vsts-agent-win-x64-2.214.1.zip", "C:\Windows\Temp\archive1.zip") - works
0

There are 0 answers