Description
New issue checklist
- I searched for existing GitHub issues
- I read pipeline troubleshooting guide
- I checked how to collect logs
Task name
PublishCodeCoverageResults@2
Task version
2.252.1
Issue Description
When using a container with Alpine this task fails with a non-descriptive error message and I have not been able to determine what is missing. In the logs it does find the coverage file but then fails to run with the below error:
##[error]Unhandled: There was an error when attempting to execute the process '/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console'. This may indicate the process failed to start. Error: spawn /__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/
I tested the same pipeline without a container on Microsoft-Hosted agents with vmimage ubuntu-latest
which is currently ubuntu-22.04
, and UseDotNet@2
version 9.x
and it was able to publish code coverage results. I have provided the log output of the relevant steps as well as debug logs.
Here are the following docs I referenced, maybe I am missing something:
Example dockerfile:
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine
RUN apk update
# Dependencies for AzDO
RUN apk add --no-cache bash jo shadow sudo yq nodejs npm
# Labels for AzDO
LABEL com.azure.dev.pipelines.agent.handler.node.path=/usr/bin/node
The documentation for the PublishCodeCoverageResults@2 also does not mention what versions are supported for the task, so I assume latest will work and confirmed 9.x worked with Microsoft-Hosted agents.
Please let me know if any additional information is needed.
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)
No response
Operation system
Alpine
Relevant log output
==============================================================================
Task : Use .NET Core
Description : Acquires a specific version of the .NET Core SDK from the internet or the local cache and adds it to the PATH. Use this task to change the version of .NET Core used in subsequent tasks. Additionally provides proxy support.
Version : 2.251.1
Author : Microsoft Corporation
Help : https://aka.ms/AA4xgy0
==============================================================================
Tool to install: .NET Core sdk version 9.x.
Found version 9.0.202 in channel 9.0 for user specified version spec: 9.x
get-os-distro: Error: Distribution specific OS name and version could not be detected: UName = Linux
Version 9.0.202 was not found in cache.
Getting URL to download .NET Core sdk version: 9.0.202.
Detecting OS platform to find correct download package for the OS.
/__w/_tasks/UseDotNet_b0ce7256-7898-45d3-9cb5-176b752bfea6/2.251.1/externals/get-os-distro.sh
Primary:linux-musl-x64
Legacy:-x64
Detected platform (Primary): linux-musl-x64
Detected platform (Legacy): -x64
Downloading: https://download.visualstudio.microsoft.com/download/pr/c99de83d-6caa-4ec0-ae22-b542cef5833a/90ef16f45a552623155d86732478f958/dotnet-sdk-9.0.202-linux-musl-x64.tar.gz
Extracting downloaded package /__w/_temp/37a15d51-ca4e-4ada-879a-ec74aba80c03.
Extracting archive
/bin/tar xC /__w/_temp/5a1948f5-f1a4-4f80-913f-8cc3dd716e36 -f /__w/_temp/37a15d51-ca4e-4ada-879a-ec74aba80c03
Successfully installed .NET Core sdk version 9.0.202.
Creating global tool path and pre-pending to PATH.
Starting: Publish Code Coverage Results
==============================================================================
Task : Publish code coverage results v2
Description : Publish any of the code coverage results from a build
Version : 2.252.1
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/publish-code-coverage-results
==============================================================================
Found 1 result(s) matching pattern: libraries/an-tools/coverage/clover.xml
/__w/26/s/libraries/an-tools/coverage/clover.xml
/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console /__w/26/s/libraries/an-tools/coverage/clover.xml --reportDirectory /__w/_temp/2480649a-4bd2-4936-a65a-064061f8b38c
##[error]Unhandled: There was an error when attempting to execute the process '/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console'. This may indicate the process failed to start. Error: spawn /__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console ENOENT
##[error]Error: There was an error when attempting to execute the process '/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console'. This may indicate the process failed to start. Error: spawn /__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console ENOENT
at ExecState._setResult (/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/azure-pipelines-task-lib/toolrunner.js:940:25)
at ExecState.CheckComplete (/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/azure-pipelines-task-lib/toolrunner.js:926:18)
at ChildProcess.<anonymous> (/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/azure-pipelines-task-lib/toolrunner.js:826:19)
at ChildProcess.emit (node:events:519:28)
at ChildProcess._handle.onexit (node:internal/child_process:292:12)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Finishing: Publish Code Coverage Results
Full task logs with system.debug enabled
##[debug]Evaluating condition for step: 'Publish Code Coverage Results' ##[debug]Evaluating: SucceededNode() ##[debug]Evaluating SucceededNode: ##[debug]=> True ##[debug]pattern: 'libraries/an-tools/coverage/clover.xml' ##[debug]findPath: '/__w/4/s/libraries/an-tools/coverage/clover.xml' ##[debug]statOnly: 'true' ##[debug]found 1 paths ##[debug]applying include pattern ##[debug]adjustedPattern: '/__w/4/s/libraries/an-tools/coverage/clover.xml' ##[debug]1 matches ##[debug]1 final results Found 1 result(s) matching pattern: libraries/an-tools/coverage/clover.xml /__w/4/s/libraries/an-tools/coverage/clover.xml ##[debug]Agent.Version=4.252.0 ##[debug]Agent.TempDirectory=/__w/_temp ##[debug]which 'dotnet' ##[debug]found: '/__t/dotnet/dotnet' ##[debug]which '/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console' ##[debug]found: '/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console' ##[debug]/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console arg: /__w/4/s/libraries/an-tools/coverage/clover.xml ##[debug]/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console arg: --reportDirectory ##[debug]/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console arg: /__w/_temp/3c9b9feb-0ce3-4e60-9734-59f2c714fe0d ##[debug]SystemVssConnection auth param AccessToken = *** ##[debug]System.TeamFoundationCollectionUri=https://******.visualstudio.com/ ##[debug]Build.BuildId=808904 ##[debug]Build.ContainerId=1591144 ##[debug]Agent.TempPath=undefined ##[debug]System.TeamProjectId=******** ##[debug]PIPELINES_COVERAGEPUBLISHER_DEBUG=undefined ##[debug]DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=undefined ##[debug]exec tool: /__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console ##[debug]arguments: ##[debug] /__w/4/s/libraries/an-tools/coverage/clover.xml ##[debug] --reportDirectory ##[debug] /__w/_temp/3c9b9feb-0ce3-4e60-9734-59f2c714fe0d /__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console /__w/4/s/libraries/an-tools/coverage/clover.xml --reportDirectory /__w/_temp/3c9b9feb-0ce3-4e60-9734-59f2c714fe0d ##[debug]task result: Failed ##[error]Unhandled: There was an error when attempting to execute the process '/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console'. This may indicate the process failed to start. Error: spawn /__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console ENOENT ##[debug]Processed: ##vso[task.issue type=error;]Unhandled: There was an error when attempting to execute the process '/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console'. This may indicate the process failed to start. Error: spawn /__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console ENOENT ##[debug]Processed: ##vso[task.complete result=Failed;]Unhandled: There was an error when attempting to execute the process '/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console'. This may indicate the process failed to start. Error: spawn /__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console ENOENT ##[error]Error: There was an error when attempting to execute the process '/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console'. This may indicate the process failed to start. Error: spawn /__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console ENOENT at ExecState._setResult (/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/azure-pipelines-task-lib/toolrunner.js:940:25) at ExecState.CheckComplete (/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/azure-pipelines-task-lib/toolrunner.js:926:18) at ChildProcess. (/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/azure-pipelines-task-lib/toolrunner.js:826:19) at ChildProcess.emit (node:events:524:28) at ChildProcess._handle.onexit (node:internal/child_process:291:12) at onErrorNT (node:internal/child_process:483:16) at process.processTicksAndRejections (node:internal/process/task_queues:90:21) ##[debug]Processed: ##vso[task.issue type=error;]Error: There was an error when attempting to execute the process '/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console'. This may indicate the process failed to start. Error: spawn /__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console ENOENT at ExecState._setResult (/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/azure-pipelines-task-lib/toolrunner.js:940:25) at ExecState.CheckComplete (/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/azure-pipelines-task-lib/toolrunner.js:926:18) at ChildProcess. (/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.252.1/node_modules/azure-pipelines-task-lib/toolrunner.js:826:19) at ChildProcess.emit (node:events:524:28) at ChildProcess._handle.onexit (node:internal/child_process:291:12) at onErrorNT (node:internal/child_process:483:16) at process.processTicksAndRejections (node:internal/process/task_queues:90:21)##[debug]Handler exit code: 0
Finishing: Publish Code Coverage Results
Repro steps
parameters:
- name: container
type: string
- name: testContainer
type: string
- name: path
type: string
- name: pool
type: string
- name: poolCredScan
type: string
jobs:
- job: RunNpmTests
pool:
name: ${{ parameters.pool }}
container:
image: ${{ parameters.testContainer }}
steps:
- task: Cache@2
displayName: Cache NPM Packages
inputs:
key: npm | "$(Agent.OS)" | ${{ parameters.path }}/package-lock.json
restoreKeys: npm | "$(Agent.OS)"
path: $(Pipeline.Workspace)/.npm
- task: Npm@1
displayName: Install Dependencies
inputs:
command: custom
customCommand: ci --cache $(Pipeline.Workspace)/.npm
workingDir: ${{ parameters.path }}
- task: Npm@1
displayName: Run Unit Tests
inputs:
command: custom
customCommand: run test
workingDir: ${{ parameters.path }}
- task: UseDotNet@2 # prereq for PublishCodeCoverageResults@2
displayName: Publish Code Coverage Requirements
inputs:
version: 9.x # tried 8.x, 7.x, 6.x
- task: PublishCodeCoverageResults@2
displayName: Publish Code Coverage Results
inputs:
summaryFileLocation: ${{ parameters.path }}/coverage/clover.xml