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.
https://reportgenerator.io
Apache License 2.0
2.65k stars 283 forks source link

Report Generator fails on Linux build agent version 22.04 #609

Closed dan-hoeger closed 1 year ago

dan-hoeger commented 1 year ago

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?

danielpalme commented 1 year ago

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

Which version of ReportGenerator are you using?

danielpalme commented 1 year ago

I tried to reproduce your problem with on Azure DevOps.

Here are my YAML files for:

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

danielpalme commented 1 year ago

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).

dan-hoeger commented 1 year ago

OK, we have

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

dan-hoeger commented 1 year ago

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.

danielpalme commented 1 year ago

Thanks for the update!

dan-hoeger commented 1 year ago

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:HtmlInlineAzurePipelines;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

dan-hoeger commented 1 year ago

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.

dan-hoeger commented 1 year ago

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.

danielpalme commented 1 year ago

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