SonarQube 6/Java 4 crashes when 2 similar files are moved

188 views
Skip to first unread message

hilb...@h72.nl

unread,
Sep 20, 2016, 4:00:00 AM9/20/16
to SonarQube
When 2 java source files are  moved in the codebase that are the same to SonarQube. The analysis crashes. The files are not exactly the same but SonarQube seems to think they are the same (calculates some hash I guess) and then crashes with an IllegalStateException. This will result in a failed analysis.

The work around is to change the content of the file enough so SonarQube thinks it's a different file. But with a nightly run this can take some time.

It also happens when you remove 2 files that are the same, but on a different location, and move the result to 1 new file.

I've not seen this problem before, and we're running SonarQube for some years, so my guess is it's a recently introduced bug.

Here is the complete stacktrace (I've replaced the original filenames):

..
sonar.core.id=20160915161120
sonar.core.version=6.0
...
2016.09.20 06:21:20 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVdF048KOIX5sH8_aF6K
java.lang.IllegalStateException: Original file OriginalFile{id=2069, uuid='1be12d94-1133-4ae3-ae15-a0b2e668e15b', key='[group id]:[artifact id]:src/main/java/[package]/File1.java'} already registered for file ComponentImpl{key='[group id]:[artifact id]:src/main/java/[package]/File1.java', type=FILE, uuid='AVdF053KzuSnaYnS_RoE', name='', description='null', fileAttributes=FileAttributes{languageKey='java', unitTest=false}, reportAttributes=ReportAttributes{ref=1040, version='null', path='src/main/java/[package]/File1.java'}}. Unable to register OriginalFile{id=5370, uuid='06c8160b-762a-464a-8b41-701f87fe175a', key='[group id]:[artifact id]:src/main/java/[package]/File2.java'}.
	at com.google.common.base.Preconditions.checkState(Preconditions.java:197) ~[guava-18.0.jar:na]
	at org.sonar.server.computation.filemove.MutableMovedFilesRepositoryImpl.setOriginalFile(MutableMovedFilesRepositoryImpl.java:41) ~[sonar-server-6.0.jar:na]
	at org.sonar.server.computation.filemove.FileMoveDetectionStep.registerMatches(FileMoveDetectionStep.java:144) ~[sonar-server-6.0.jar:na]
	at org.sonar.server.computation.filemove.FileMoveDetectionStep.execute(FileMoveDetectionStep.java:139) ~[sonar-server-6.0.jar:na]
	at org.sonar.server.computation.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:64) ~[sonar-server-6.0.jar:na]
	at org.sonar.server.computation.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:52) ~[sonar-server-6.0.jar:na]
	at org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor.process(ReportTaskProcessor.java:75) ~[sonar-server-6.0.jar:na]
	at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:81) [sonar-server-6.0.jar:na]
	at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:56) [sonar-server-6.0.jar:na]
	at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:35) [sonar-server-6.0.jar:na]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_102]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_102]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_102]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_102]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_102]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_102]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_102]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_102]

Sebastien Lesaint

unread,
Sep 20, 2016, 5:03:31 AM9/20/16
to SonarQube
Hello,

You've hit SONAR-8013, which is fixed in 6.1.

6.1RC will be out this week.

Cheers,

Sébastien LESAINT | SonarSource
Platform Developer

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/533035ee-0316-4d05-a62b-fe348a3de56d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages