Closed sergiopacezup closed 5 years ago
Hey, thanks for reporting. Can you spot any stacktrace?
Here it is:
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to highlight file <<FILES>>
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:67)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:104)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
...
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.IllegalArgumentException: Unable to highlight file <<FILE>>
at org.sonar.api.batch.sensor.highlighting.internal.DefaultHighlighting.highlight (DefaultHighlighting.java:85)
at org.sonar.api.batch.sensor.highlighting.internal.DefaultHighlighting.highlight (DefaultHighlighting.java:37)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.highlightByType (KotlinSyntax.kt:41)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.access$highlightByType (KotlinSyntax.kt:13)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax$processFile$1.invoke (KotlinSyntax.kt:27)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax$processFile$1.invoke (KotlinSyntax.kt:13)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.visitTokens (KotlinSyntax.kt:35)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.visitTokens (KotlinSyntax.kt:36)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.visitTokens (KotlinSyntax.kt:36)
...
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.visitTokens (KotlinSyntax.kt:36)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.visitTokens (KotlinSyntax.kt:36)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.processFile (KotlinSyntax.kt:18)
at io.gitlab.arturbosch.detekt.sonar.sensor.FileProcessor.run (FileProcessor.kt:23)
at io.gitlab.arturbosch.detekt.sonar.sensor.DetektSensor.execute (DetektSensor.kt:27)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse (AbstractSensorWrapper.java:48)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:85)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1 (ModuleSensorsExecutor.java:59)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy (ModuleSensorsExecutor.java:77)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:59)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart (ModuleScanContainer.java:82)
at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
at org.sonar.scanner.scan.ProjectScanContainer.scan (ProjectScanContainer.java:400)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:395)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:392)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart (ProjectScanContainer.java:358)
at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart (GlobalContainer.java:141)
at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute (Batch.java:73)
at org.sonar.batch.bootstrapper.Batch.execute (Batch.java:67)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute (BatchIsolatedLauncher.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke (IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy25.execute (Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute (EmbeddedScanner.java:185)
at org.sonarsource.scanner.api.EmbeddedScanner.execute (EmbeddedScanner.java:137)
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:65)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:104)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.IllegalArgumentException: Start pointer [line=53, lineOffset=67] should be before end pointer [line=53, lineOffset=67]
at org.sonar.api.internal.google.common.base.Preconditions.checkArgument (Preconditions.java:145)
at org.sonar.api.batch.fs.internal.DefaultInputFile.newRangeValidPointers (DefaultInputFile.java:348)
at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange (DefaultInputFile.java:311)
at org.sonar.api.batch.sensor.highlighting.internal.DefaultHighlighting.highlight (DefaultHighlighting.java:83)
at org.sonar.api.batch.sensor.highlighting.internal.DefaultHighlighting.highlight (DefaultHighlighting.java:37)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.highlightByType (KotlinSyntax.kt:41)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.access$highlightByType (KotlinSyntax.kt:13)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax$processFile$1.invoke (KotlinSyntax.kt:27)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax$processFile$1.invoke (KotlinSyntax.kt:13)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.visitTokens (KotlinSyntax.kt:35)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.visitTokens (KotlinSyntax.kt:36)
...
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.visitTokens (KotlinSyntax.kt:36)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.visitTokens (KotlinSyntax.kt:36)
at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.processFile (KotlinSyntax.kt:18)
at io.gitlab.arturbosch.detekt.sonar.sensor.FileProcessor.run (FileProcessor.kt:23)
at io.gitlab.arturbosch.detekt.sonar.sensor.DetektSensor.execute (DetektSensor.kt:27)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse (AbstractSensorWrapper.java:48)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:85)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1 (ModuleSensorsExecutor.java:59)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy (ModuleSensorsExecutor.java:77)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:59)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart (ModuleScanContainer.java:82)
at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
at org.sonar.scanner.scan.ProjectScanContainer.scan (ProjectScanContainer.java:400)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:395)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:392)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart (ProjectScanContainer.java:358)
at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart (GlobalContainer.java:141)
at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute (Batch.java:73)
at org.sonar.batch.bootstrapper.Batch.execute (Batch.java:67)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute (BatchIsolatedLauncher.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke (IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy25.execute (Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute (EmbeddedScanner.java:185)
at org.sonarsource.scanner.api.EmbeddedScanner.execute (EmbeddedScanner.java:137)
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:65)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:104)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Same problem here. It seems the plugin does not support the unix line separator. When using the Windows line separator, it works. I just added the plugin, and the problem occured at this time, so I thing it's related. Hope this helps !
@julientard your also using the newest sonar release 7.9? Hm internally we just use the unix line separators even just calling an IntelliJ function for it. I couldn't reproduce it on my machine. It does crash on all files?
Thanbks for your keep answer.
No i'm using the 7.3 release.
I think every kotlin files are concerned, but with a slighty different problem. Actually the problem I described above was for the following message error: Unable to highlight file myfile.kt 2197 is not a valid offset for file myfile.kt Max offset is 2176 Which is the end of the file.
I "fixed" the issue by changing the line separator of the file, did this on three files, and now I have the problem described by @sergiopacezup .
I'm working on a x64 linux machine, with IntelliJ, and a SonarQube distant server. I tried previous versions of the maven plugin, with the results.
However i'm using the version 0.6.0 of the plugin, and we change our Kotlin version since. I checked also with 1.0.0 with the same results.
SonarQube 7.4 and 7.6 and 7.9.1 sonarqube scanner gradle plugin 2.7.1 Same error. "Fixed" by changing file formatting. But files with error so many.
import androidx.lifecycle.LiveData
import io.realm.Realm
import io.realm.RealmObject
import io.realm.RealmQuery
import kotlin.reflect.KClass
abstract class DbRepository {
abstract fun <T : RealmObject> save(item: T, syncMode: Boolean = false)
abstract fun <T : RealmObject> saveAll(items: List<T>, syncMode: Boolean = false)
@PublishedApi internal abstract fun <T : RealmObject> queryCount(objClass: KClass<T>): LiveData<Int>
@PublishedApi internal abstract fun <T : RealmObject> queryCount(query: Realm.() -> RealmQuery<T>): LiveData<Int>
@PublishedApi internal abstract fun <T : RealmObject> queryFind(query: Realm.() -> RealmQuery<T>): T?
@PublishedApi internal abstract fun <T : RealmObject> queryFindAll(query: Realm.() -> RealmQuery<T>): List<T>
@PublishedApi internal abstract fun <T : RealmObject> queryFindAll(objClass: KClass<T>): List<T>
@PublishedApi internal abstract fun <T : RealmObject> queryFindAsLiveData(query: Realm.() -> RealmQuery<T>): LiveData<T?>
@PublishedApi internal abstract fun <T : RealmObject> queryFindAllAsLiveData(query: Realm.() -> RealmQuery<T>): LiveData<List<T>>
@PublishedApi internal abstract fun <T : RealmObject> queryUpdate(query: Realm.() -> RealmQuery<T>, update: (T) -> Unit, syncMode: Boolean = false)
@PublishedApi internal abstract fun <T : RealmObject> queryUpdateAll(query: Realm.() -> RealmQuery<T>, update: (T) -> Unit, syncMode: Boolean = false)
@PublishedApi internal abstract fun <T : RealmObject> queryDelete(query: Realm.() -> RealmQuery<T>, syncMode: Boolean = false)
@PublishedApi internal abstract fun <T : RealmObject> queryDeleteAll(query: Realm.() -> RealmQuery<T>, syncMode: Boolean = false)
@PublishedApi internal abstract fun <T : RealmObject> queryDeleteAll(objClass: KClass<T>, syncMode: Boolean = false)
}
Same error here. Running SonarQube 7.9.1.27448, directly from docker, with sonar-kotlin 1.0.0. Sonarqube scanner gradle plugin @ 2.8.
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':sonarqube'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77) at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101) at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46) at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:277) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:262) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) Caused by: java.lang.IllegalArgumentException: Unable to highlight file src/main/kotlin/cz/humatch/rules/MultiplyPolynomRule.kt at org.sonar.api.batch.sensor.highlighting.internal.DefaultHighlighting.highlight(DefaultHighlighting.java:85) at org.sonar.api.batch.sensor.highlighting.internal.DefaultHighlighting.highlight(DefaultHighlighting.java:37) at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.highlightByType(KotlinSyntax.kt:41) at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.access$highlightByType(KotlinSyntax.kt:13) at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax$processFile$1.invoke(KotlinSyntax.kt:20) at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax$processFile$1.invoke(KotlinSyntax.kt:13) at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.visitTokens(KotlinSyntax.kt:35) at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.visitTokens(KotlinSyntax.kt:36) at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.visitTokens(KotlinSyntax.kt:36) at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.visitTokens(KotlinSyntax.kt:36) at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.visitTokens(KotlinSyntax.kt:36) at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.visitTokens(KotlinSyntax.kt:36) at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.visitTokens(KotlinSyntax.kt:36) at io.gitlab.arturbosch.detekt.sonar.foundation.KotlinSyntax.processFile(KotlinSyntax.kt:18) at io.gitlab.arturbosch.detekt.sonar.sensor.FileProcessor.run(FileProcessor.kt:23) at io.gitlab.arturbosch.detekt.sonar.sensor.DetektSensor.execute(DetektSensor.kt:27) at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48) at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85) at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59) at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77) at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59) at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122) at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:400) at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:395) at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:358) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122) at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122) at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73) at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67) at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60) at com.sun.proxy.$Proxy895.execute(Unknown Source) at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189) at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138) at org.sonarqube.gradle.SonarQubeTask.run(SonarQubeTask.java:100) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:801) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:768) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99) ... 31 more Caused by: java.lang.IllegalArgumentException: 1579 is not a valid offset for file src/main/kotlin/cz/humatch/rules/MultiplyPolynomRule.kt. Max offset is 1576 at org.sonar.api.internal.google.common.base.Preconditions.checkArgument(Preconditions.java:145) at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:317) at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:311) at org.sonar.api.batch.sensor.highlighting.internal.DefaultHighlighting.highlight(DefaultHighlighting.java:83) ... 90 more
The file in question is attached. If I remove some lines at random, it works, but fails on another file. Please advise, I would very much like to use sonar-kotlin and not the built-in kotlin plugin. Please find the relevant file attached.
sonarqube 7.9.1, faced with same issue
same here: getting the same exception message. using sonarqube 7.9.1 and detekt 1.1.1 we even tried windows line seperator but didn't work for us 😢 any chance this gets fixed soon? any possibility i can contribute in helping fixing this? this bug is known for 3 months and it would be nice to see it go away.
I've also had this issue on my project. How can we help to fix this ?
The class containing the syntax highlighting logic is sonar-kotlin/src/main/kotlin/io/gitlab/arturbosch/detekt/sonar/foundation/KotlinSyntax.kt
if someone wants to help fixing this.
Sorry for the delay on this blocker. I've rewrote some of its logic in #104. Please test this branch if it works for you.
sonar-kotlin: 1.0.0 and 0.6.0 sonar: 7.9 maven: 3.6
Build fails with the error:
Unable to highlight file <<FILE>> Start pointer [line=53, lineOffset=67] should be before end pointer [line=53, lineOffset=67]
Could not find anything unusual on the pointed location.