IntelliJ IDEA Bug Read Access Is Allowed From Inside Read-action Only

by Rajiv Sharma 70 views

What happened

Please describe what you were doing when this exception occurred.

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Version information

  • OS: Mac OS X 15.5 x86_64
  • IDE: IntelliJ IDEA 2025.1.3(IC-251.26927.53)
  • Plugin: Spring Boot Assistant 601.0.2+242

Exception

null

Stack trace
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action only (see Application.runReadAction()); If you access or modify model on EDT consider wrapping your code in WriteIntentReadAction ; see https://jb.gg/ij-platform-threading for details
Current thread: Thread[#70,AWT-EventQueue-0,6,main] 119360204 (EventQueue.isDispatchThread()=true)
SystemEventQueueThread: (same)
	at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:257)
	at com.intellij.util.concurrency.ThreadingAssertions.throwThreadAccessException(ThreadingAssertions.java:248)
	at com.intellij.util.concurrency.ThreadingAssertions.assertReadAccess(ThreadingAssertions.java:138)
	at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.ensureIsUpToDate(WorkspaceFileIndexDataImpl.kt:164)
	at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.getFileInfo(WorkspaceFileIndexDataImpl.kt:105)
	at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexImpl.getFileInfo(WorkspaceFileIndexImpl.kt:307)
	at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexImpl.findFileSetWithCustomData(WorkspaceFileIndexImpl.kt:271)
	at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.getModuleForFile(ProjectFileIndexImpl.java:109)
	at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.getModuleForFile(ProjectFileIndexImpl.java:103)
	at com.intellij.compiler.impl.OneProjectItemCompileScope.getAffectedSourceSets(OneProjectItemCompileScope.java:79)
	at com.intellij.compiler.impl.OneProjectItemCompileScope.getAffectedModules(OneProjectItemCompileScope.java:63)
	at com.intellij.compiler.impl.CompositeScope.getAffectedModules(CompositeScope.java:73)
	at dev.flikas.spring.boot.assistant.idea.plugin.metadata.service.CompilationListener.compilationFinished(CompilationListener.java:43)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:768)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:712)
	at com.intellij.util.messages.impl.MessageBusImplKt.deliverMessage(MessageBusImpl.kt:451)
	at com.intellij.util.messages.impl.MessageBusImplKt.pumpWaiting(MessageBusImpl.kt:430)
	at com.intellij.util.messages.impl.MessageBusImplKt.access$pumpWaiting(MessageBusImpl.kt:1)
	at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:493)
	at jdk.proxy5/jdk.proxy5.$Proxy127.compilationFinished(Unknown Source)
	at com.intellij.compiler.CompilerManagerImpl$ListenerNotificator.finished(CompilerManagerImpl.java:586)
	at com.intellij.compiler.impl.CompileDriver.lambda$notifyCompilationCompleted$8(CompileDriver.java:605)
	at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:102)
	at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:102)
	at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:108)
	at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:102)
	at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:585)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:482)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10$lambda$9(IdeEventQueue.kt:307)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:864)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10(IdeEventQueue.kt:306)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:958)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:109)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:958)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12(IdeEventQueue.kt:301)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:341)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

Additional context

Add any other context about the problem here.


Let's dive into this intriguing issue, guys! We're tackling a RuntimeExceptionWithAttachments in IntelliJ IDEA, specifically related to read access within the Spring Boot Assistant plugin. It sounds like a threading problem, and these can be tricky, but let's break it down and see if we can get to the bottom of it.

Understanding the Error: Read Access and Threading in IntelliJ IDEA

At its core, this error, Com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action only, is telling us that a piece of code tried to read data in a way that's not thread-safe within the IntelliJ IDEA environment. IntelliJ IDEA, like many complex applications, has strict rules about which threads can access and modify its internal data structures. This is to prevent data corruption and ensure stability. The error message itself provides some hints, suggesting the use of Application.runReadAction() or WriteIntentReadAction.

So, what does this mean in plain English?

Imagine IntelliJ IDEA's internal data as a library. Multiple people (threads) might want to read or write books (data) in this library. To prevent chaos, there are rules. Reading is generally okay for anyone, but only if it's done in a designated