Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 3, 2025

Agent configuration fails with ldd: ./bin/libcoreclr.so: No such file or directory when extraction is incomplete, but incorrectly reports "Dependencies is missing for .NET Core 6.0" instead of identifying the actual problem.

Root Cause

config.sh and reauth.sh run ldd without checking file existence. When files are missing, ldd outputs "No such file or directory" which matches grep -E "not found|No such", triggering the wrong error path.

# Before: misleading when file doesn't exist
ldd ./bin/libcoreclr.so | grep -E "not found|No such"
if [ $? -eq 0 ]; then
    echo "Dependencies is missing for .NET Core 6.0"  # Wrong diagnosis

Changes

Check file existence before dependency validation:

# Check runtime files exist
if [ ! -f ./bin/libcoreclr.so ]; then
    echo "Error: .NET runtime files are missing from ./bin/"
    echo "The agent installation appears to be incomplete or corrupted."
    exit 1
fi

# Only check dependencies if files exist
ldd ./bin/libcoreclr.so | grep "not found"
if [ $? -eq 0 ]; then
    echo "Dependencies are missing for .NET Core 6.0"

Applied to three critical runtime files:

  • libcoreclr.so
  • libSystem.Security.Cryptography.Native.OpenSsl.so
  • libSystem.IO.Compression.Native.so

Fixed 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

  • Agent Version: 4.261.0
  • Ubuntu Version: 22.04
  • Architecture: x64
  • Deployment: Self-hosted VMSS on Azure DevOps
  • Image Source: actions/runner-images

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.sh with 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:

ldd: ./bin/libcoreclr.so: No such file or directory

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:

"The agent software runs on .NET 6, but installs its own version of .NET so there is no .NET prerequisite."

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)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

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

Azure Pipelines Extension failed with message: The Extension failed to execute: Pipeline script execution failed with exit code 100.

2025-10-28 08:59:01 version 16
2025-10-28 08:59:01 Url is {obscured}
2025-10-28 08:59:01 Pool is {obscured}
2025-10-28 08:59:01 RunArgs is --once
2025-10-28 08:59:01 ForceUser is false
2025-10-28 08:59:01 Directory is /agent
2025-10-28 08:59:01 AzDevOps account already exists
2025-10-28 08:59:01 Zipfile is /agent/vsts-agent-linux-x64-4.261.0.tar.gz

2025-10-28 08:59:01 Installing dependencies
++ id -u
+ user_id=0
+ '[' 0 -ne 0 ']'
+ '[' -e /etc/os-release ']'
+ filepath=/etc/os-release
+ '[' -e /etc/os-release ']'
+ echo '--------OS Information--------'
+ cat /etc/os-release
+ echo ------------------------------
+ '[' -e /etc/debian_version ']'
+ echo 'The current OS is Debian based'
+ echo '--------Debian Version--------'
+ cat /etc/debian_version
+ echo ------------------------------
+ command -v apt
+ '[' 0 -eq 0 ']'

+ apt update

+ apt install -y libkrb5-3 zlib1g debsums
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

+ apt install -y liblttng-ust1
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

+ '[' 0 -ne 0 ']'
++ wget -qO- http://security.ubuntu.com/ubuntu/pool/main/o/openssl/
++ grep -oP '(libssl1.1_1.1.1f.*?_amd64.deb)'
++ head -1
+ package=libssl1.1_1.1.1f-1ubuntu2.24_amd64.deb

+ apt install -y libssl3
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

+ '[' 0 -ne 0 ']'
+ apt install -y libicu74
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
E: Package 'libicu74' has no installation candidate

+ apt install -y libicu70
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

+ '[' 0 -ne 0 ']'
+ echo -----------------------------
+ echo ' Finish Install Dependencies'
+ echo -----------------------------

2025-10-28 08:59:08 Dependencies installation succeeded
2025-10-28 08:59:08 Configuring build agent
2025-10-28 08:...

</details>

- Fixes microsoft/azure-pipelines-agent#5366

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

Copilot AI and others added 2 commits November 3, 2025 10:05
- Add file existence checks before running ldd on .NET runtime files
- Provide clear error messages when files are missing vs missing dependencies
- Remove "No such" from grep pattern as it's now redundant with file checks
- This prevents misleading error messages when agent package extraction fails

Co-authored-by: raujaiswal <205606577+raujaiswal@users.noreply.github.com>
Co-authored-by: raujaiswal <205606577+raujaiswal@users.noreply.github.com>
Copilot AI changed the title [WIP] [BUG]: ldd: ./bin/libcoreclr.so: No such file or directory Fix misleading error when .NET runtime files missing during agent configuration Nov 3, 2025
Copilot finished work on behalf of raujaiswal November 3, 2025 10:10
Copilot AI requested a review from raujaiswal November 3, 2025 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants