Issues with generating PDF Report from the portfolio

Hi,

We are running into an issue of generating a PDF report from the Portfolio - when clicking on the Portfolio PDF Report button and selecting “Download as PDF” we get an error message “Failed - Server Problem”

I was wondering if some one has seen this issue before - we would like to provide a report to customer to assure them that the code is in good state

Thank you

Forgot to add the version: Version 8.4.0.35506
Nothing in the logs on the report failure

Hi, please look for errors in all files: sonar.log, web.log, and ce.log

Hi Pierre,

Thanks for the quick reply - I checked all the logs and I found some info on the report failing in the web.log

2020.07.23 13:27:44 ERROR web[o.s.s.p.w.RootFilter] Processing of request /api/governance_reports/download?componentKey=DongGuan_war failed
java.lang.InternalError: java.lang.reflect.InvocationTargetException
at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:86)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
at java.desktop/sun.font.SunFontManager.getInstance(SunFontManager.java:247)
at java.desktop/sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:265)
at java.desktop/java.awt.Font.getStringBounds(Font.java:2607)
at java.desktop/java.awt.Font.getStringBounds(Font.java:2517)
at org.jfree.chart.plot.SpiderWebPlot.drawLabel(SpiderWebPlot.java:1417)
at org.jfree.chart.plot.SpiderWebPlot.draw(SpiderWebPlot.java:1202)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1286)
at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1453)
at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1434)
at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1419)
at com.sonar.governance.D.B.A(Unknown Source)
at com.sonar.governance.D.B.A(Unknown Source)
at com.sonar.governance.D.B.A(Unknown Source)
at com.sonar.governance.D.A.F.handle(Unknown Source)
at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:110)
at org.sonar.server.platform.web.WebServiceFilter.doFilter(WebServiceFilter.java:88)
at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:139)
at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.UserSessionFilter.doFilter(UserSessionFilter.java:88)
at org.sonar.server.platform.web.UserSessionFilter.doFilter(UserSessionFilter.java:72)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.CacheControlFilter.doFilter(CacheControlFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.SecurityServletFilter.doHttpFilter(SecurityServletFilter.java:76)
at org.sonar.server.platform.web.SecurityServletFilter.doFilter(SecurityServletFilter.java:48)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RedirectFilter.doFilter(RedirectFilter.java:58)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RequestIdFilter.doFilter(RequestIdFilter.java:66)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:62)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:256)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:615)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1627)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:84)
… 62 common frames omitted
Caused by: java.lang.NullPointerException: null
at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262)
at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225)
at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:107)
at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719)
at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:367)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/sun.font.SunFontManager.(SunFontManager.java:312)
at java.desktop/sun.awt.FcFontManager.(FcFontManager.java:35)
at java.desktop/sun.awt.X11FontManager.(X11FontManager.java:56)
… 67 common frames omitted

Please let me know if this helps figuring the issue out

Which JDK version are you using to execute SonarQube?

Hi Pierre,

We are running the following java version

root@US3AZSonarQube01:/home/devopsadmin# java -version
java version “1.8.0_181”
Java™ SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot™ 64-Bit Server VM (build 25.181-b13, mixed mode)
root@US3AZSonarQube01:/home/devopsadmin#

Please let me know if anything else is required

Thanks

Hi, SonarQube 8.x is not comptable with jdk 8. It’s not possible that you are using this version of Java.

Sorry I checked the wrong thing - we are using JDK-11.0.2

Thanks

Hi,

Any updates on this issue? - Will it be fixed in the new version ?

Thanks

Hi @jovanon ,

what distribution are you using?

java.desktop/sun.awt.FontConfiguration.getVersion

it could be that you are missing some native packages that are needed in order to render the pdf report. something like fontconfig , ttf-dejavu and libfreetype1

Hi Tobias,

I am not sure what you mean by this - Linux dist ?

If I check under system there is a green check mark beside Official Distribution

Please clarify …

Thank you very much

Yeah i ment linux distribution

sorry for the confusion :sweat_smile:

here we go

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 17.10
Release: 17.10
Codename: artful

ehm this release is eol since 2 years… can you even install anything on this system? i think the repositorys from canonical are already down right? how did you install java 11 on this system?

We upgraded LInux OS to

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic

And we still have the same issue

Any suggestions on how to fix this ?

Thank you

Nenad

Have you tried installing the packages that i recommended?

Hi @Tobias_Trabelsi,

Is there a way to report security bugs in SonarQube, possibly getting a CVE ID for the same?

Hi @ideaengine007 ,

you can find our security disclosure policy here.
Thanks for the interest and being responsible with disclosing possible vulnerabilities, but please do not hijack threads :wink:

1 Like

I installed 2 out of the 3 packages suggested above ( could not fine libfreetype1 - seems like its an old package ) and I am still getting the same error…

Are u able to reproduce this issue on your end ?

Thanks

sadly no. i have just installed a fresh ubuntu 18.04 vm, installed unzip and openjdk-11-jre, connected the database and i could download a portfolio report.

The two last ideas i have would be to:

  • install java again including all dependencies via apt
  • start from scratch on your vm (data is stored on the database)