NullPointerException when filtering on some properties

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Quick system description:
    Ubuntu 20.04, dist-upgraded from 18.04
    SonarQube 7.9.3.33349,
    Postgres 12 backend, migrated from Postgres 10,
    openjdk-11-jre-headless/focal 11.0.7+10-3ubuntu1 amd64.

Settings changed in sonar.properties:
sonar.jdbc.username=sonarqube
sonar.jdbc.password=secret
sonar.jdbc.url=jdbc:postgresql://localhost/sonarqube?currentSchema=public
sonar.web.javaOpts=-server
sonar.log.level=INFO

My problem is getting an exception when filtering for some criteria, but not for others:

relevant error from web.log:

java.lang.NullPointerException: null
at org.sonar.server.issue.ws.SearchResponseFormat.formatIssue(SearchResponseFormat.java:169)
at org.sonar.server.issue.ws.SearchResponseFormat.lambda$formatIssues$0(SearchResponseFormat.java:149)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
at org.sonar.server.issue.ws.SearchResponseFormat.formatIssues(SearchResponseFormat.java:147)
at org.sonar.server.issue.ws.SearchResponseFormat.formatSearch(SearchResponseFormat.java:96)
at org.sonar.server.issue.ws.SearchAction.doHandle(SearchAction.java:433)
at org.sonar.server.issue.ws.SearchAction.handle(SearchAction.java:391)
at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:110)
at org.sonar.server.ws.WebServiceFilter.doFilter(WebServiceFilter.java:88)
at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:126)
at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:95)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:87)
at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:71)
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.requestid.RequestIdFilter.doFilter(RequestIdFilter.java:63)
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:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
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:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
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)

  • what are you trying to achieve

Make it return some results instead of an error. :blush:

  • what have you tried so far to achieve this

Upgraded SonarQube from 7.9.2 -> 7.9.3
Cleaned data/es6 directory (stop SQ, clean directory, restart SQ)
Tried running trace level logging, I coulnd’t find anything useful, only some deprecated exceptions
Tried: su sonarqube; psql -U sonarqube -W (connected fine, “\dt” gave sensible output (many tables are present))
Tried: running through bin/linux/sonar.sh (maybe the systemd-style service definition on the quickstart guide missed something critical)

  • Additional info

filtering for creation date also makes this exception happen, possibly more triggers present, I didn’t tested all filter criteria.

It was a permission issue.

Resolved: created a new user, assigned all permission on the project to that user, set the project to private.

Hi,

Welcome to the community, and thanks for the follow-up!

 
Ann