microsoft / vsts-azurevm-extension

MIT License
13 stars 6 forks source link

Add download retry attempt to pipeline agent #190

Closed simonasaitta closed 2 years ago

simonasaitta commented 2 years ago

This PR adds retry attempts to the agent and enableagent script downloads. (1830266) There are 3 retry attempts and the log will look like this:

2021/07/14 13:25:53 [Test.Microsoft.VisualStudio.Services.TeamServicesAgentLinux-1.141.0.0] Download Pipelines Zip
2021/07/14 13:25:53 [Test.Microsoft.VisualStudio.Services.TeamServicesAgentLinux-1.141.0.0] https://vstsagentpackage.azureedge.net/agent/2.188.3/vsts-agent-linux-x64-2.188.3.tar.gz
2021/07/14 13:25:55 [Test.Microsoft.VisualStudio.Services.TeamServicesAgentLinux-1.141.0.0] Download Pipelines Script
2021/07/14 13:25:55 [Test.Microsoft.VisualStudio.Services.TeamServicesAgentLinux-1.141.0.0] https://raw.githubusercontent.com/simonasaitta/agent-pool-scripts/main/enableagent.sh1
2021/07/14 13:25:55 [Test.Microsoft.VisualStudio.Services.TeamServicesAgentLinux-1.141.0.0] Attempt 1 to download the pipeline script failed
2021/07/14 13:25:55 [Test.Microsoft.VisualStudio.Services.TeamServicesAgentLinux-1.141.0.0] HTTP Error 404: Not Found
2021/07/14 13:25:55 [Test.Microsoft.VisualStudio.Services.TeamServicesAgentLinux-1.141.0.0] Attempt 2 to download the pipeline script failed
2021/07/14 13:25:55 [Test.Microsoft.VisualStudio.Services.TeamServicesAgentLinux-1.141.0.0] HTTP Error 404: Not Found
2021/07/14 13:25:55 [Test.Microsoft.VisualStudio.Services.TeamServicesAgentLinux-1.141.0.0] Attempt 3 to download the pipeline script failed
2021/07/14 13:25:55 [Test.Microsoft.VisualStudio.Services.TeamServicesAgentLinux-1.141.0.0] HTTP Error 404: Not Found
2021/07/14 13:25:55 [Test.Microsoft.VisualStudio.Services.TeamServicesAgentLinux-1.141.0.0] Max retries attempt reached
2021/07/14 13:25:55 ERROR:[Test.Microsoft.VisualStudio.Services.TeamServicesAgentLinux-1.141.0.0] HTTP Error 404: Not Found
2021/07/14 13:25:55 [Test.Microsoft.VisualStudio.Services.TeamServicesAgentLinux-1.141.0.0] Setting handler status, code and message as 'error', '1000' and 'The Extension failed to execute: HTTP Error 404: Not Found' respectively

Bump of production version is still missing in the PR

ghost commented 2 years ago

CLA assistant check
All CLA requirements met.