Error in SonarLint for IntelliJ: Read access not allowed error on IDE start-up triggered by checkFileInSourceFolders

Saw the below error in PHPStorm when starting up. Looks similar to SLI-610 although the stack trace seems to suggest it comes from a different part of the plugin.


  • Java: JetBrains s.r.o. 11.0.13
  • OS: Windows 10 amd64
  • IDE: PhpStorm 2021.3.2
  • SonarLint:

Details: Current thread: Thread[ApplicationImpl pooled thread 10,4,main] 1942208337
Dispatch thread: false; isDispatchThread(): false
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,main] 132720580

java.lang.Throwable: Read access is allowed from inside read-action (or EDT) only (see c.ij.oa.application.Application.runReadAction())
	at c.ij.oa.diagnostic.Logger.error(
	at c.ij.oa.application.impl.ApplicationImpl.assertReadAccessAllowed(
	at c.ij.oa.roots.impl.RootIndex.<init>(
	at c.ij.oa.roots.impl.RootIndex.<init>(
	at c.ij.oa.roots.impl.DirectoryIndexImpl.getRootIndex(
	at c.ij.oa.roots.impl.DirectoryIndexImpl.getRootIndex(
	at c.ij.oa.roots.impl.DirectoryIndexImpl.getInfoForFile(
	at c.ij.oa.roots.impl.FileIndexBase.getInfoForFileOrDirectory(
	at c.ij.oa.roots.impl.ProjectFileIndexImpl.getInfoForFileOrDirectory(
	at c.ij.oa.roots.impl.ProjectFileIndexImpl.getSourceRootForFile(

Hello @Chris_Butler,

Thanks for reporting this. The result is the same as the ticket you pointed indeed, but the cause is different, so I created this other ticket. Do you face this error consistently or is it random ?