If you are a user of pipelines in Azure DevOps, you might have encountered resource limit issues in pipeline agents. Let's discuss this issue in detail and how a recently released feature will prevent this issue
Issue:
The pipelines fail from time to time due to resource limits. for example, the pipeline can fail when the disk on the agent becomes full. The error message will say something along the lines of "No space left on the device". How can this issue be prevented or we can know the resource issues in advance? Let's discuss further.
Prevent agent resource issues:
Recently the pipeline logs have been enhanced to include the resource utilisation data.
If you are often facing agent resource-related failures in the pipelines, enable the debug logging to debug the issues further.
Temporarily enable debug logs:
If you want to debug only a specific run of the pipeline, "Enable system diagnostics" when executing the pipeline.
Permanently enable debug logs:
To enable the debug logging permanently, edit the pipeline
click on variables
create a new variable called "system.debug" and set its value to true
Please see the pipeline log below which can now show CPU, Memory, and Disk usage
2023-11-28T06:52:06.0734877Z ##[section]Starting: Job
2023-11-28T06:52:06.0812898Z ##[debug]Agent running environment resource - Disk: available:24840.00MB out of 85160.00MB, Memory: used 2MB out of 6921MB, CPU: usage 94.26
2023-11-28T06:52:06.0856805Z ##[debug]Cleaning agent temp folder: /home/vsts/work/_temp
2023-11-28T06:52:06.0895478Z ##[debug]Skipping overwrite %TEMP% environment variable
2023-11-28T06:52:06.2577360Z ##[section]Starting: Initialize job
Summary:
While debugging failures or slowness in pipelines information about resource usage in logs can be very useful.
Thanks for reading, Goodbye until next week!