SonarQube 9.6.1 Failure - NullPointerException at ScmInfoRepositoryImpl.removeAuthorAndRevision


Reporting a bug in SonarQube 9.6.1 Enterprise Edition using the Sonar Maven plugin and BitBucket Server v7.17.10.

The instance was upgraded from 9.4 to 9.6.1 over 3 weeks ago and there have been more than 1500 analyses run since then including on new branches.

However, running an analysis on a new branch has failed 3 times in the last 24 hours on 3 different repositories.

We have:

a) Re-run the analysis on the branch multiple times - problem remains
b) Removed the local cache and restarted the server, waited till all data was loaded and run again - problem remains
c) Disabled the scm sensor on the project and run again - problem remains
d) Explicitly set git as the sensor for the project and run again - problem remains

The message displayed is:


The Background Tasks Error Details log gives:

Error Details
org.sonar.ce.task.projectanalysis.component.VisitException: Visit of Component {key=Vitality:a249ccb9:pom.xml:BRANCH:feature/fix_int_tst_and_covarage,type=FILE} failed
	at org.sonar.ce.task.projectanalysis.component.VisitException.rethrowOrWrap(
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitChildren(
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(
	at org.sonar.ce.task.projectanalysis.step.ExecuteVisitorsStep.execute(
	at org.sonar.ce.task.step.ComputationStepExecutor.executeStep(
	at org.sonar.ce.task.step.ComputationStepExecutor.executeSteps(
	at org.sonar.ce.task.step.ComputationStepExecutor.execute(
	at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(
	at org.sonar.ce.taskprocessor.CeWorkerImpl$
	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(
	at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(
	at java.base/java.util.concurrent.Executors$
	at java.base/
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.base/java.util.concurrent.ThreadPoolExecutor$
	at java.base/
Caused by: java.lang.IllegalStateException: Fail to process issues of component 'Vitality:a249ccb9:pom.xml:BRANCH:feature/fix_int_tst_and_covarage'
	at org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.visitAny(
	at org.sonar.ce.task.projectanalysis.component.TypeAwareVisitorWrapper.visitAny(
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitNode(
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(
	... 23 more
Caused by: java.lang.NullPointerException
	at org.sonar.ce.task.projectanalysis.scm.ScmInfoRepositoryImpl.removeAuthorAndRevision(
	at java.base/$3$1.accept(
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(
	at java.base/
	at java.base/
	at java.base/
	at java.base/
	at java.base/
	at org.sonar.ce.task.projectanalysis.scm.ScmInfoRepositoryImpl.removeAuthorAndRevision(
	at org.sonar.ce.task.projectanalysis.scm.ScmInfoRepositoryImpl.generateAndMergeDb(
	at org.sonar.ce.task.projectanalysis.scm.ScmInfoRepositoryImpl.getScmInfoForComponent(
	at java.base/java.util.HashMap.computeIfAbsent(
	at org.sonar.ce.task.projectanalysis.scm.ScmInfoRepositoryImpl.getScmInfo(
	at org.sonar.ce.task.projectanalysis.issue.IssueCreationDateCalculator.getScmInfo(
	at org.sonar.ce.task.projectanalysis.issue.IssueCreationDateCalculator.getDateOfLatestChange(
	at org.sonar.ce.task.projectanalysis.issue.IssueCreationDateCalculator.backdateIssue(
	at org.sonar.ce.task.projectanalysis.issue.IssueCreationDateCalculator.onIssue(
	at org.sonar.ce.task.projectanalysis.issue.IssueVisitors.onIssue(
	at org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.processIssue(
	at org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.lambda$processIssues$0(
	at java.base/java.util.ArrayList.forEach(
	at org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.processIssues(
	at org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.visitAny(
	... 27 more

Please advise if this is a bug, whether there is a workaround.



Just to update.

Once this problem starts with the branch analyses on a repository, then all future branch analyses on that repository fail.

Running this analysis for the branch on a staging instance with the same setup is successful.

Note that the same problem is also reported by Guarav Singh in his comment here:

This seems like a data problem, such as from a failed earlier process to harvest scm information. I see the comment on the file with the method that is throwing the exception in the github repo about Sonar using existing data in the database.

It would be good to understand the root cause of this and whether this can be fixed by either removing the analysis and analysing every branch again, or removing all but the main branch analysis (to retain the history).

Presently this is blocking our releases.

Any help appreciated.



Attempting to remove all branch analyses other than master and develop via the API and then reattempting analysis on this branch did not resolve it.

This was only resolved by deleting the entire project and analysing it again, losing the history.

Because the cause has not been determined, we are concerned it could happen again.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

Unfortunately the solution of clearing disk space was not the resolution for us.

The resolution for this is discussed / continued in this thread:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.