Error in SonarQube for IntelliJ 10.20: java.nio.file.InvalidPathException: Illegal char <*> at index

Environment:

  • Java: JetBrains s.r.o. 21.0.6
  • OS: Windows 11 amd64
  • IDE: IntelliJ IDEA 2024.3.5
  • SonarQube for IDE: 10.20.0.80985
java.nio.file.InvalidPathException: Illegal char <*> at index 0: **/target
	at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:199)
	at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:175)
	at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
	at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
	at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:231)
	at c.ij.platform.core.nio.fs.DelegatingFileSystem.getPath(DelegatingFileSystem.java:96)
	at java.base/java.nio.file.Path.of(Path.java:148)
	at java.base/java.nio.file.Paths.get(Paths.java:69)
	at o.sl.ij.analysis.LocalFileExclusions.lambda$loadProjectExclusions$2(LocalFileExclusions.java:97)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1715)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at o.sl.ij.analysis.LocalFileExclusions.loadProjectExclusions(LocalFileExclusions.java:98)
	at o.sl.ij.analysis.LocalFileExclusions.<init>(LocalFileExclusions.java:72)
	at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
	at c.ij.platform.instanceContainer.instantiation.InstantiateKt.instantiate$lambda$0(instantiate.kt:50)
	at c.ij.platform.instanceContainer.instantiation.InstantiateKt.instantiate$lambda$8$lambda$7(instantiate.kt:310)
	at c.ij.platform.instanceContainer.instantiation.InstantiateKt.withStoredTemporaryContext(instantiate.kt:328)
	at c.ij.platform.instanceContainer.instantiation.InstantiateKt.instantiate(instantiate.kt:309)
	at c.ij.platform.instanceContainer.instantiation.InstantiateKt.instantiate(instantiate.kt:43)
	at c.ij.serviceContainer.LightServiceInstanceSupport$LightServiceInstanceInitializer.createInstance(LightServiceInstanceSupport.kt:47)
	at c.ij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invokeSuspend(LazyInstanceHolder.kt:163)
	at c.ij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invoke(LazyInstanceHolder.kt)
	at c.ij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invoke(LazyInstanceHolder.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at c.ij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invokeSuspend(LazyInstanceHolder.kt:161)
	at c.ij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invoke(LazyInstanceHolder.kt)
	at c.ij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invoke(LazyInstanceHolder.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:27)

Hi @FreddySquall , looks like this issue happened because you were trying to pass a glob pattern to directory exclusion. Was this the case?

Hi @eray.felek,
it seems to be exact, but I don’t know where is it from :

But I didn’t add any specific option on sonarLint pluggin. May be I can delete the sonarlint.xml file to verify if it is created correctly ?

Can you share how this view looks like in your setting:

Hi @salva-siemens , can you share how this view looks like in your setting:

Here it is :

Hi @FreddySquall yes looks like Glob pattern was passed as directory. We have a separate section for Glob patterns here:
image

Hi @eray.felek ,
did this change recently ? We effectively use this configuration a long time ago :

When I try with your correction :

It the Exception don’t raise any more. Thanks a lot !

Hi @salva-siemens , it seems you have a similar reason for the error. Glob pattern applied in the wrong section “File”. Could you delete and apply them in here:
image

@FreddySquall We had a broken feature on Windows for File exclusions and Directory exclusions which was recently fixed with the latest release. Could you clarify what you mean by effectively. Was this feature working for you before? If so I suspect it might have appeared to be working due to different reasons and if you were the exclude different folders it wouldn’t work with the previous SonarQube for IDE version. In any case this error should not be thrown even if the exclusions are not correctly applied by the user. We have this ticket to fix that issue. Thank you for reporting this

1 Like

OK, now it works. Thank you so much.

1 Like

Hi,
I think it was configured like that in our projects for a while. I don’t know if it was working fine but it didn’t throw Exception. We’ll correct our configurations if we get the error again. May be the correction is “just” to change file/folder configuration in BOLB one instead of throwing Exception ?
Nevertheless, the issue is solved for us, we’ll correct our configurations. :+1:
(Sorry for the bad translation of “Effectively”, it was meaning “indeed” :upside_down_face:)

1 Like

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