danielpalme / ReportGenerator

ReportGenerator converts coverage reports generated by coverlet, OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov into human readable reports in various formats.

Home Page:https://reportgenerator.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Report Generator fails on Linux build agent version 22.04

dan-hoeger opened this issue · comments

we are upgrading all of our build agents to Ubuntu 22.04 since 18.04 is going out of support.

when trying to run our builds on these new agents everything is building and the tests are executing just fine but the ReportGenerator task is failing with the following error:

"no usable version of libssl was found"

I think it is related to the following issue: https://stackoverflow.com/questions/73301049/no-usable-version-of-libssl-was-found-after-inserting-pat-in-azure-self-hosted

Is there an updated version of the ReportGenerator that supports 22.04?

I was not aware that Ubuntu 22.04 is causing problems.
Are you using Azure DevOps?

Which version of ReportGenerator are you using?

I tried to reproduce your problem with on Azure DevOps.

Here are my YAML files for:

  • Azure DevOps task
  • Global tool

Azure DevOps task (https://marketplace.visualstudio.com/items?itemName=Palmmedia.reportgenerator)

trigger:
- master

pool:
  vmImage: 'ubuntu-latest'

variables:
  disable.coverage.autogenerate: 'true'

steps:
- task: reportgenerator@5
  inputs:
    reports: 'coverage.xml'
    targetdir: '$(Build.SourcesDirectory)/coveragereport'

Global tool (https://www.nuget.org/packages/dotnet-reportgenerator-globaltool)

trigger:
- master

pool:
  vmImage: 'ubuntu-latest'

variables:
  disable.coverage.autogenerate: 'true'

- task: DotNetCoreCLI@2
  displayName: 'Install ReportGenerator'
  inputs:
    command: custom
    custom: tool
    arguments: 'install --global dotnet-reportgenerator-globaltool --version 5.1.22'

- script: reportgenerator "-reports:coverage.xml" "-targetdir:$(Build.SourcesDirectory)/coveragereport" "-reporttypes:Cobertura;HtmlInline"
  displayName: Generate code coverage report

Both versions work for me on Ubuntu 22.04

Can you share more details about your setup?
You can also sent it confidentially by email: reportgenerator@palmmedia.de

If you are using a self hosted agent, the following command should help:

sudo apt-get update && \
  sudo apt-get install -y dotnet-sdk-7.0

This installs the the .NET SDK and its dependencies (libssl3 is one of the dependencies).

OK, we have

  • task: reportgenerator@4
    displayName: 'Unit Test Report Generator'
    inputs:
    reports: 'api/DataManagerService/UnitTests/**/coverage.cobertura.xml'
    targetdir: '$(Build.SourcesDirectory)/api/DataManagerService/CodeCoverage'
    reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges'

I didn't see how to find what version to use I didn't know there was an @5 available I will try that.

FYI upgrading to @5 resolved the issue I'm not sure where we can tell what the latest version is but that resolved the issue and it is working now.

Thanks for the update!

I spoke too soon it is working for one of our pipelines but not another one.

they are both using the same build container to compile so I'm not sure why one can run the report generator and the other cannot.

here is the error we are seeing:

/__t/dotnet/dotnet /__w/_tasks/reportgenerator_be803a55-9253-4895-a525-be570d86f161/5.1.22/tools/netcoreapp3.1/ReportGenerator.dll -reports:/__w/56/s/src/ApiHost/UnitTests/**/coverage.cobertura.xml -targetdir:/_w/56/s/CodeCoverage -reporttypes:HtmlInline_AzurePipelines;Cobertura;Badges -sourcedirs: -historydir: -plugins: -assemblyfilters:+* -classfilters:+* -filefilters:+* -verbosity:Info -title: -tag:20230619.3#550737 -license:
No usable version of libssl was found
##[error]The process '/__t/dotnet/dotnet' failed with exit code null
Finishing: ReportGenerator

OK, I did see one difference between the two pipelines one was using the Install dotnet 6.0.X and the other was using 6.0.101 the Reportgenerator@5 worked with 6.0.101 but with 6.0.x it was installing 6.0.410 and reportgenerator@5 would fail with the above error.

I'm still not sure what is going on here as I just tried changing the build that is failing to use 6.0.101 and the reportgenerator task is still failing there.

I have no idea why it seems to fail randomly.

Perhaps you can try the gobal tool instead of the Azure DevOps extension:

- task: DotNetCoreCLI@2
  displayName: 'Install ReportGenerator'
  inputs:
    command: custom
    custom: tool
    arguments: 'install --global dotnet-reportgenerator-globaltool --version 5.1.22'

- script: reportgenerator "-reports:$(Build.SourcesDirectory)/src/ApiHost/UnitTests/**/coverage.cobertura.xml" "-targetdir:$(Build.SourcesDirectory)/CodeCoverage" "-reporttypes:HtmlInline_AzurePipelines;Cobertura;Badges"
  displayName: Generate code coverage report