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.

Environment:

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

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(Logger.java:200)
	at c.ij.oa.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:980)
	at c.ij.oa.roots.impl.RootIndex.<init>(RootIndex.java:63)
	at c.ij.oa.roots.impl.RootIndex.<init>(RootIndex.java:56)
	at c.ij.oa.roots.impl.DirectoryIndexImpl.getRootIndex(DirectoryIndexImpl.java:172)
	at c.ij.oa.roots.impl.DirectoryIndexImpl.getRootIndex(DirectoryIndexImpl.java:155)
	at c.ij.oa.roots.impl.DirectoryIndexImpl.getInfoForFile(DirectoryIndexImpl.java:182)
	at c.ij.oa.roots.impl.FileIndexBase.getInfoForFileOrDirectory(FileIndexBase.java:96)
	at c.ij.oa.roots.impl.ProjectFileIndexImpl.getInfoForFileOrDirectory(ProjectFileIndexImpl.java:27)
	at c.ij.oa.roots.impl.ProjectFileIndexImpl.getSourceRootForFile(ProjectFileIndexImpl.java:125)
	at o.sl.ij.analysis.LocalFileExclusions.checkFileInSourceFolders(LocalFileExclusions.java:137)
	at o.sl.ij.analysis.LocalFileExclusions.lambda$onTheFlyExclusionCheckers$3(LocalFileExclusions.java:197)
	at o.sl.ij.analysis.LocalFileExclusions.checkExclusionsFileByFile(LocalFileExclusions.java:183)

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 ?