zielu / GitToolBox

GitToolBox IntelliJ plugin
GNU General Public License v3.0
604 stars 73 forks source link

[BUG] AlreadyDisposedException when switching projects (open in this window) #406

Closed ap-wtioit closed 2 years ago

ap-wtioit commented 2 years ago

Describe the bug Got an error in PyCharm:

com.intellij.serviceContainer.AlreadyDisposedException: Cannot create com.intellij.openapi.roots.ProjectFileIndex because container is already disposed (container=Project(name=doodba-trendvis, containerState=DISPOSE_COMPLETED, componentStore=/home/bigbear3001/path/to/redacted_project) (disposed))
    at com.intellij.serviceContainer.ContainerUtilKt.throwAlreadyDisposedError(containerUtil.kt:34)
    at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:632)
    at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:584)
    at com.intellij.openapi.client.ClientAwareComponentManager.getFromSelfOrCurrentSession(ClientAwareComponentManager.kt:37)
    at com.intellij.openapi.client.ClientAwareComponentManager.getService(ClientAwareComponentManager.kt:22)
    at com.intellij.openapi.roots.ProjectFileIndex.getInstance(ProjectFileIndex.java:31)
    at com.intellij.openapi.module.ModuleUtilCore.findModuleForFile(ModuleUtilCore.java:80)
    at com.jetbrains.python.sdk.PyVirtualEnvVcsCustomizer.findSdk(PyVirtualEnvVcsCustomizer.kt:52)
    at com.jetbrains.python.sdk.PyVirtualEnvVcsCustomizer.access$findSdk(PyVirtualEnvVcsCustomizer.kt:19)
    at com.jetbrains.python.sdk.PyVirtualEnvVcsCustomizer$customizeCommandAndEnvironment$$inlined$runReadAction$1.compute(actions.kt:60)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:920)
    at com.jetbrains.python.sdk.PyVirtualEnvVcsCustomizer.customizeCommandAndEnvironment(PyVirtualEnvVcsCustomizer.kt:83)
    at git4idea.commands.GitHandler.lambda$prepareEnvironment$0(GitHandler.java:479)
    at com.intellij.openapi.extensions.impl.ExtensionProcessingHelper.forEachExtensionSafe(ExtensionProcessingHelper.java:34)
    at com.intellij.openapi.extensions.ExtensionPointName.forEachExtensionSafe(ExtensionPointName.java:46)
    at git4idea.commands.GitHandler.prepareEnvironment(GitHandler.java:478)
    at git4idea.commands.GitHandler.start(GitHandler.java:447)
    at git4idea.commands.GitHandler.runInCurrentThread(GitHandler.java:394)
    at git4idea.commands.GitImplBase.doRun(GitImplBase.java:201)
    at git4idea.commands.GitImplBase.run(GitImplBase.java:163)
    at git4idea.commands.GitImplBase.runCommand(GitImplBase.java:63)
    at git4idea.config.GitConfigUtil.getValue(GitConfigUtil.java:80)
    at git4idea.config.GitConfigUtil.getValue(GitConfigUtil.java:73)
    at git4idea.fetch.GitFetchSupportImpl.isStoreCredentialsHelperUsed(GitFetchSupportImpl.kt:184)
    at git4idea.fetch.GitFetchSupportImpl.getMaxThreads(GitFetchSupportImpl.kt:176)
    at git4idea.fetch.GitFetchSupportImpl.fetchInParallel(GitFetchSupportImpl.kt:142)
    at git4idea.fetch.GitFetchSupportImpl.access$fetchInParallel(GitFetchSupportImpl.kt:47)
    at git4idea.fetch.GitFetchSupportImpl$fetch$1.invoke(GitFetchSupportImpl.kt:106)
    at git4idea.fetch.GitFetchSupportImpl$fetch$1.invoke(GitFetchSupportImpl.kt:47)
    at git4idea.fetch.GitFetchSupportImpl.withIndicator(GitFetchSupportImpl.kt:213)
    at git4idea.fetch.GitFetchSupportImpl.fetch(GitFetchSupportImpl.kt:103)
    at git4idea.fetch.GitFetchSupportImpl.fetchAllRemotes(GitFetchSupportImpl.kt:89)
    at zielu.gittoolbox.j.O.a(SourceFile:25)
    at zielu.gittoolbox.j.M.b(SourceFile:158)
    at com.codahale.metrics.Timer.timeSupplier(Timer.java:136)
    at zielu.a.h.a.e.a(SourceFile:14)
    at zielu.gittoolbox.j.M.a(SourceFile:158)
    at zielu.gittoolbox.j.M.b(SourceFile:144)
    at zielu.gittoolbox.j.M.a(SourceFile:132)
    at zielu.gittoolbox.j.M.b(SourceFile:230)
    at zielu.gittoolbox.j.M.run(SourceFile:215)
    at zielu.a.b.b.a(SourceFile:11)
    at zielu.a.b.e.run(SourceFile:15)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)

To Reproduce Steps to reproduce the behavior:

  1. Unsure, happened when i switched projects with open in this window

The redacted_project mentioned in the stacktrace (is redacted, obviously) was the project i had open a few hours ago. So i guess the project switching happended as following:

Expected behavior No errors should be shown

Plugin version Exact plugin version. Eg. 212.9.0

IDE version PyCharm 2022.1.3 (Professional Edition) Build #PY-221.5921.27, built on June 21, 2022 Licensed to redacted Subscription is active until redacted Runtime version: 11.0.15+10-b2043.56 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 5.4.0-121-generic GC: G1 Young Generation, G1 Old Generation Memory: 16384M Cores: 16 Non-Bundled Plugins: net.seesharpsoft.intellij.plugins.csv (2.18.2) dev.meanmail.plugin.nginx-intellij-plugin (2021.3-2022.1) com.perl5 (2022.1.1) com.intellij.ideolog (203.0.30.0) zielu.gittoolbox (212.9.0) mobi.hsz.idea.gitignore (4.4.0) at.wtioit.intellij.plugins.odoo (0.5.16) pro.bashsupport (2.1.9.221)

Current Desktop: ubuntu:GNOME

Screenshots If applicable, add screenshots to help explain your problem.

zielu commented 2 years ago

Hi, duplicate of #399. Release with fix will be out this week, you can try EAP channel for now. This issue is not critical, only annoying - nothing breaks.

zielu commented 2 years ago

Done in (211/212).9.6