Fix misleading error when .NET runtime files missing during agent configuration #5371
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Agent configuration fails with
ldd: ./bin/libcoreclr.so: No such file or directorywhen extraction is incomplete, but incorrectly reports "Dependencies is missing for .NET Core 6.0" instead of identifying the actual problem.Root Cause
config.shandreauth.shrunlddwithout checking file existence. When files are missing,lddoutputs "No such file or directory" which matchesgrep -E "not found|No such", triggering the wrong error path.Changes
Check file existence before dependency validation:
Applied to three critical runtime files:
libcoreclr.solibSystem.Security.Cryptography.Native.OpenSsl.solibSystem.IO.Compression.Native.soFixed grammar: "Dependencies is missing" → "Dependencies are missing"
Users now get accurate diagnostics distinguishing extraction failures from missing system dependencies, enabling faster resolution of intermittent VMSS provisioning issues.
Original prompt
This section details on the original issue you should resolve
<issue_title>[BUG]: ldd: ./bin/libcoreclr.so: No such file or directory</issue_title>
<issue_description>### What happened?
Environment Details
Problem Description
We are experiencing intermittent provisioning failures with Azure DevOps agents in our VMSS pool. The agent setup fails during the configuration phase in
config.shwith missing .NET runtime files.We are using self-hosted VMSS on Azure DevOps running Ubuntu 22.04. The images are built using runner-images.
We intermittently get issues reported in the Diagnostics tab where the agent can't provision as the set-up in config.sh fails.
The key point from the logs provided below is:
Root Cause Analysis
At first, I thought that this was an issue with the way dotnet is being installed on the OS, then I read that the Azure agent is supposed to be self-contained and include its own .NET 6 runtime as per the official documentation:
Possible Cause
I believe that, intermittently, somewhere upstream in the agent installation process (possibly enableagent.sh or config.sh) the relevant files are not being extracted properly for some reason. I believe it then relies on a fallback to look for system dotnet in /usr/share/dotnet. Here, it won't be able to find
libcoreclr.so, as multiple versions of dotnet are installed to that directory by the runner-images team, so the file won't exist in the root of that directory. So the local agent install of dotnet needs to work reliably.Impacts
This causes provisioning issues which result in queues as agents can't provision in the pool.
Versions
Agent v4.261.0
Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Azure DevOps Server Version (if applicable)
Azure DevOps SaaS
Operation system
Ubuntu 22.04
Version controll system
No response
Relevant log output