NullPointerException: null during PR analysis

sonarqube

(Stoyan Kanev) #1

Hi sonarqube support,

When we try to do a PR analysis the following error can be seen (we updated to sonarqube 6.7.5 (from 6.7.4 some days ago))
[Pipeline] sh

  • sonar-scanner -Dsonar.projectVersion=0.6.0-SNAPSHOT -Dsonar.analysis.mode=preview -Dsonar.github.oauth=**** -Dsonar.github.pullRequest=1155 -Dsonar.github.repository=BPM/opint2 -Dsonar.github.endpoint=https://xxxxxxxxxxxxxx/api/v3
    INFO: Scanner configuration file: /home/piper/sonar-scanner/conf/sonar-scanner.properties
    INFO: Project root configuration file: /home/jenkins/workspace/CF_opint2_PR-1155/sonar-project.properties
    INFO: SonarQube Scanner 3.0.3.778
    INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
    INFO: Linux 4.14.32-coreos amd64
    INFO: User cache: /home/piper/.sonar/cache
    INFO: Issues mode
    WARN: The use of the issues mode (sonar.analysis.mode=issues) is deprecated. This mode will be dropped in the future.
    INFO: Load global settings
    INFO: Load global settings (done) | time=230ms
    INFO: Server id: 49B321BC-AVfdUHLStGK31JvJxpK4
    INFO: User cache: /home/piper/.sonar/cache
    INFO: Exclude plugins: devcockpit, ldap, authgithub, authbitbucket, pdfreport, authaad, googleanalytics, governance
    INFO: Load plugins index
    INFO: Load plugins index (done) | time=78ms
    INFO: Download sonar-go-plugin-1.1.0.1612.jar
    INFO: SonarQube server 6.7.5
    INFO: Default locale: “en”, source code encoding: “UTF-8”
    INFO: Process project properties
    INFO: Load project repositories
    INFO: Load project repositories (done) | time=404ms
    INFO: Scanning only changed files
    INFO: Execute project builders
    INFO: Starting analysis of pull request: https://xxxxxxxxxxxxx/BPM/opint2/pull/1155
    INFO: Execute project builders (done) | time=1605ms
    INFO: Load quality profiles
    INFO: Load quality profiles (done) | time=55ms
    INFO: Load active rules
    INFO: Load active rules (done) | time=708ms
    INFO: Load metrics repository
    INFO: Load metrics repository (done) | time=35ms
    INFO: Project key: xxx.bpm.pvs

ERROR: Error during SonarQube Scanner execution
org.sonarqube.ws.client.HttpException: Error 500 on http://xxxxxxxxx/sonar/batch/issues.protobuf?key=xxx.bpm.pvs : {“errors”:[{“msg”:“An error has occurred. Please contact your administrator”}]}
at org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:36)
at org.sonar.scanner.bootstrap.ScannerWsClient.failIfUnauthorized(ScannerWsClient.java:106)
at org.sonar.scanner.bootstrap.ScannerWsClient.call(ScannerWsClient.java:75)
at org.sonar.scanner.repository.DefaultServerIssuesLoader.load(DefaultServerIssuesLoader.java:42)
at org.sonar.scanner.issue.tracking.ServerIssueRepository.load(ServerIssueRepository.java:61)
at org.sonar.scanner.issue.tracking.LocalIssueTracking.init(LocalIssueTracking.java:75)
at org.sonar.scanner.issue.tracking.IssueTransition.execute(IssueTransition.java:65)
at org.sonar.scanner.phases.IssuesPhaseExecutor.localIssueTracking(IssuesPhaseExecutor.java:64)
at org.sonar.scanner.phases.IssuesPhaseExecutor.executeOnRoot(IssuesPhaseExecutor.java:56)
at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:93)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:177)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:291)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:286)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:264)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:121)
at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:111)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)

On the server side the raised error is:
2018.12.19 08:08:04 ERROR web[AWeoAGBMzoPUt0DIEFsC][o.s.s.w.WebServiceEngine] Fail to process request http://xxxxxxxxx/sonar/batch/issues.protobuf?key=xxx.bpm.pvs
org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: java.lang.NullPointerException

The error may exist in org.sonar.db.issue.IssueMapper

The error may involve org.sonar.db.issue.IssueMapper.scrollNonClosedByModuleOrProject

The error occurred while handling results

SQL: select i.id, i.kee as kee, i.rule_id as ruleId, i.severity as severity, i.manual_severity as manualSeverity, i.message as message, i.line as line, i.locations as locations, i.gap as gap, i.effort as effort, i.status as status, i.resolution as resolution, i.checksum as checksum, i.assignee as assignee, i.author_login as authorLogin, i.tags as tagsString, i.issue_attributes as issueAttributes, i.issue_creation_date as issueCreationTime, i.issue_update_date as issueUpdateTime, i.issue_close_date as issueCloseTime, i.created_at as createdAt, i.updated_at as updatedAt, r.plugin_rule_key as ruleKey, r.plugin_name as ruleRepo, r.language as language, p.kee as componentKey, i.component_uuid as componentUuid, p.module_uuid as moduleUuid, p.module_uuid_path as moduleUuidPath, p.path as filePath, root.kee as projectKey, i.project_uuid as projectUuid, i.issue_type as type from issues i inner join rules r on r.id = i.rule_id inner join projects p on p.uuid = i.component_uuid inner join projects root on root.uuid = i.project_uuid where i.project_uuid = ? and p.module_uuid_path like ? escape ‘/’ and i.status <> ‘CLOSED’

Cause: java.lang.NullPointerException

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.select(DefaultSqlSession.java:172)
at org.apache.ibatis.session.defaults.DefaultSqlSession.select(DefaultSqlSession.java:158)
at org.apache.ibatis.binding.MapperMethod.executeWithResultHandler(MapperMethod.java:126)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:72)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
at com.sun.proxy.$Proxy58.scrollNonClosedByModuleOrProject(Unknown Source)
at org.sonar.db.issue.IssueDao.scrollNonClosedByModuleOrProject(IssueDao.java:103)
at org.sonar.server.batch.IssuesAction.handle(IssuesAction.java:105)
at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:103)
at org.sonar.server.ws.WebServiceFilter.doFilter(WebServiceFilter.java:86)
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)

……
Caused by: java.lang.NullPointerException: null
at org.sonar.scanner.protocol.input.ScannerInput$ServerIssue$Builder.setModuleKey(ScannerInput.java:1475)
at org.sonar.server.batch.IssuesAction.handleIssue(IssuesAction.java:121)
at org.sonar.server.batch.IssuesAction.lambda$handle$0(IssuesAction.java:101)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.callResultHandler(DefaultResultSetHandler.java:363)
Thanks,
Stoyan