Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bazel Sync leads to java.lang.Throwable: TreeUI should be accessed only from EDT #7189

Open
codrin-lanterne opened this issue Dec 18, 2024 · 0 comments
Assignees
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: PyCharm PyCharm plugin type: bug

Comments

@codrin-lanterne
Copy link

Description of the bug:

When clicking Bazel -> Sync -> Sync project with BUILD files I encounter the following error:

1 of 2 Exception in plugin Bazel for IntelliJ (2024.11.19.0.2-api-version-242)

java.lang.Throwable: TreeUI should be accessed only from EDT
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
	at com.intellij.ui.tree.ui.DefaultTreeUI.isValid(DefaultTreeUI.java:234)
	at com.intellij.ui.tree.ui.DefaultTreeUI.getRowCount(DefaultTreeUI.java:890)
	at java.desktop/javax.swing.JTree.getRowCount(JTree.java:1697)
	at com.intellij.util.ui.tree.TreeUtil.collectExpandedObjects(TreeUtil.java:197)
	at com.intellij.util.ui.tree.TreeUtil.collectExpandedPaths(TreeUtil.java:180)
	at com.intellij.ide.util.treeView.TreeState.createOn(TreeState.java:387)
	at com.intellij.ide.projectView.impl.AbstractProjectViewPane.createTreeState(AbstractProjectViewPane.java:603)
	at com.intellij.ide.projectView.impl.AbstractProjectViewPane.saveExpandedPaths(AbstractProjectViewPane.java:609)
	at com.intellij.ide.scopeView.ScopeViewPane.updateFromRoot(ScopeViewPane.java:226)
	at com.intellij.ide.projectView.impl.ProjectViewImpl.refresh(ProjectViewImpl.java:1198)
	at com.google.idea.blaze.base.sync.autosync.ProjectTargetManagerImpl$TargetSyncListener.buildStarted(ProjectTargetManagerImpl.java:150)
	at com.google.idea.blaze.base.sync.BuildPhaseSyncTask.lambda$notifyBuildStarted$1(BuildPhaseSyncTask.java:151)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
	at com.google.idea.blaze.base.sync.BuildPhaseSyncTask.notifyBuildStarted(BuildPhaseSyncTask.java:151)
	at com.google.idea.blaze.base.sync.BuildPhaseSyncTask.doRun(BuildPhaseSyncTask.java:195)
	at com.google.idea.blaze.base.sync.BuildPhaseSyncTask.run(BuildPhaseSyncTask.java:142)
	at com.google.idea.blaze.base.sync.BuildPhaseSyncTask.runBuildPhase(BuildPhaseSyncTask.java:104)
	at com.google.idea.blaze.base.sync.SyncPhaseCoordinator.runSync(SyncPhaseCoordinator.java:447)
	at com.google.idea.blaze.base.sync.SyncPhaseCoordinator.lambda$syncProject$0(SyncPhaseCoordinator.java:261)
	at com.google.idea.blaze.base.scope.Scope.push(Scope.java:57)
	at com.google.idea.blaze.base.sync.SyncPhaseCoordinator.lambda$syncProject$1(SyncPhaseCoordinator.java:241)
	at com.google.idea.blaze.base.async.executor.ProgressiveTaskWithProgressIndicator.lambda$submitTask$0(ProgressiveTaskWithProgressIndicator.java:86)
	at com.google.idea.blaze.base.async.executor.ProgressiveTaskWithProgressIndicator.lambda$submitTaskWithResult$5(ProgressiveTaskWithProgressIndicator.java:138)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:98)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:221)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:49)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:220)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:98)
	at com.google.idea.blaze.base.async.executor.ProgressiveTaskWithProgressIndicator.lambda$submitTaskWithResult$6(ProgressiveTaskWithProgressIndicator.java:138)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:76)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)

2 of 2 Exception in plugin Bazel for IntelliJ (2024.11.19.0.2-api-version-242)

java.lang.Throwable: TreeUI should be accessed only from EDT
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
	at com.intellij.ui.tree.ui.DefaultTreeUI.isValid(DefaultTreeUI.java:234)
	at com.intellij.ui.tree.ui.DefaultTreeUI.getRowCount(DefaultTreeUI.java:890)
	at java.desktop/javax.swing.JTree.getRowCount(JTree.java:1697)
	at com.intellij.util.ui.tree.TreeUtil.collectExpandedObjects(TreeUtil.java:197)
	at com.intellij.util.ui.tree.TreeUtil.collectExpandedPaths(TreeUtil.java:180)
	at com.intellij.ide.util.treeView.TreeState.createOn(TreeState.java:387)
	at com.intellij.ide.projectView.impl.AbstractProjectViewPane.createTreeState(AbstractProjectViewPane.java:603)
	at com.intellij.ide.projectView.impl.AbstractProjectViewPane.saveExpandedPaths(AbstractProjectViewPane.java:609)
	at com.intellij.ide.scopeView.ScopeViewPane.updateFromRoot(ScopeViewPane.java:226)
	at com.intellij.ide.projectView.impl.ProjectViewImpl.refresh(ProjectViewImpl.java:1198)
	at com.google.idea.blaze.base.sync.autosync.ProjectTargetManagerImpl$TargetSyncListener.afterSync(ProjectTargetManagerImpl.java:165)
	at com.google.idea.blaze.base.sync.SyncPhaseCoordinator.afterSync(SyncPhaseCoordinator.java:792)
	at com.google.idea.blaze.base.sync.SyncPhaseCoordinator.finishSync(SyncPhaseCoordinator.java:668)
	at com.google.idea.blaze.base.sync.SyncPhaseCoordinator.runSync(SyncPhaseCoordinator.java:478)
	at com.google.idea.blaze.base.sync.SyncPhaseCoordinator.lambda$syncProject$0(SyncPhaseCoordinator.java:261)
	at com.google.idea.blaze.base.scope.Scope.push(Scope.java:57)
	at com.google.idea.blaze.base.sync.SyncPhaseCoordinator.lambda$syncProject$1(SyncPhaseCoordinator.java:241)
	at com.google.idea.blaze.base.async.executor.ProgressiveTaskWithProgressIndicator.lambda$submitTask$0(ProgressiveTaskWithProgressIndicator.java:86)
	at com.google.idea.blaze.base.async.executor.ProgressiveTaskWithProgressIndicator.lambda$submitTaskWithResult$5(ProgressiveTaskWithProgressIndicator.java:138)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:98)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:221)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:49)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:220)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:98)
	at com.google.idea.blaze.base.async.executor.ProgressiveTaskWithProgressIndicator.lambda$submitTaskWithResult$6(ProgressiveTaskWithProgressIndicator.java:138)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:76)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)

The errors above cause the sync to fail with the following error: Error:Querying blaze targets building project source files failed..

Which category does this issue belong to?

PyCharm

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

I'm unsure what a minimal reproduction example would be as I encounter this error in a fairly large Python monorepo.

Which Intellij IDE are you using? Please provide the specific version.

PyCharm 2024.2.5 (Community Edition)

What programming languages and tools are you using? Please provide specific versions.

Bazel 7.4.1

What Bazel plugin version are you using?

2024.11.19.0.2-api-version-242

Have you found anything relevant by searching the web?

I found a similar error in the issues of another JetBrains plugin: jonathanlermitage/intellij-extra-icons-plugin#173 but otherwise nothing Bazel specific.

Any other information, logs, or outputs that you want to share?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: PyCharm PyCharm plugin type: bug
Projects
Status: Untriaged
Development

No branches or pull requests

2 participants