[BUG] WSL path to git not found (Outdated branches calculation failed)
Describe the bug When running a JetBrains IDE in Windows with a project in a WSL, GitToolBox causes an IDE exception when calculating outdated branches due to an incorrect path to git.
To Reproduce Steps to reproduce the behavior:
- Install a JetBrains IDE in Windows and add GitToolBox.
- Install WSL2 in Windows and create a git repository in WSL.
- Open a new project in Jetbrains IDE by specifying the WSL path, for example,
\\wsl.localhost\Ubuntu-22.04\home\henry\dev\github.com\org\repo - Commit a change to the repo using GitToolBox.
- See the exception in "IDE Internal Errors".
Expected behavior Expected not to see the exception error.
Plugin version
zielu.gittoolbox (500.2.10+233)
IDE version
WebStorm 2024.1.5
Build #WS-241.18034.50, built on June 19, 2024
IDE Internal Errors entry
Outdated branches calculation failed
java.lang.RuntimeException: com.intellij.execution.process.ProcessNotCreatedException: Cannot run program "\usr\bin\git" (in directory "\\wsl.localhost\Ubuntu-22.04\home\henry\dev\github.com\org\repo"): CreateProcess error=2, The system cannot find the file specified
at zielu.gittoolbox.V.J.v(J.java:59)
at zielu.gittoolbox.V.g.M(g.java:2)
at zielu.gittoolbox.V.t.t(t.java:4)
at zielu.gittoolbox.O.q.B(q.java:3)
at zielu.gittoolbox.O.e.a(e.java:21)
at zielu.gittoolbox.O.y.x(y.java:6)
at zielu.gittoolbox.O.y.O(y.java:39)
at zielu.gittoolbox.O.P.run(P.java:20)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:477)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:133)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:528)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:250)
at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:100)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:221)
at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:46)
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:100)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:250)
at com.intellij.openapi.progress.impl.ProgressRunner$ProgressRunnable.run(ProgressRunner.java:500)
at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:81)
at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:81)
at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:86)
at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:81)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:466)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: com.intellij.execution.process.ProcessNotCreatedException: Cannot run program "\usr\bin\git" (in directory "\\wsl.localhost\Ubuntu-22.04\home\henry\dev\github.com\org\repo"): CreateProcess error=2, The system cannot find the file specified
at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:367)
at com.intellij.execution.process.OSProcessHandler.startProcess(OSProcessHandler.java:86)
at com.intellij.execution.process.OSProcessHandler.<init>(OSProcessHandler.java:46)
at com.intellij.execution.process.KillableProcessHandler.<init>(KillableProcessHandler.java:41)
at zielu.gittoolbox.V.z.<init>(z.java:1)
at zielu.gittoolbox.V.J.p(J.java:34)
at zielu.gittoolbox.V.J.l(J.java:65)
at zielu.gittoolbox.V.J.s(J.java:11)
at zielu.gittoolbox.V.J.v(J.java:55)
... 36 more
Caused by: java.io.IOException: Cannot run program "\usr\bin\git" (in directory "\\wsl.localhost\Ubuntu-22.04\home\henry\dev\github.com\org\repo"): CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:491)
at com.intellij.execution.configurations.GeneralCommandLine.startProcess(GeneralCommandLine.java:464)
at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:357)
... 44 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:499)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:158)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
... 48 more
Hi, while I investigate and fix it, as a workaround to avoid the error, you can disable squashed-merged branch cleanup in Settings > Version Control > GitToolBox > Branches > Detect squashed-merged branches
Hi, a small update - I was missing wsl support for process of finding squashed branches. Fix is on the way, I hope it will ready tomorrow.
Fix is taking longer than expected but it's close to ready.
I created a test build and uploaded it to Test update channel https://plugins.jetbrains.com/plugin/7499-gittoolbox/versions/test
You can download it and install manually: Settings > Plugins > [cog icon] > Install Plugin from Disk... and select downloaded zip file.
Then re-enable Settings > Version Control > GitToolBox > Branches > Detect squashed-merged branches and let me know if all is fine. I'll then prepare a regular release and it will update normally.
@zielu I installed the test build and made a couple of commits and pushes to a repo. The error has not shown up, so I believe it is fixed. Thank you.
Thanks for info !
@zielu Sorry, the error just occurred again, with the test build.
@HenryGessau could you share new error log please ?
@zielu
[removed]
@HenryGessau could you double check if you have 500.2.11+233 (test build) installed ? That stacktrace is not possible in test build.
I might have a clue - test channel link had a . at the end and it redirected to just stable update channel. This is the correct link https://plugins.jetbrains.com/plugin/7499-gittoolbox/versions/test
There should be only a single version there 500.2.11+233
@zielu Yes, the test version was not installed. I have now installed it and checked that WebStorm is using the test build. I will report back in a day or so.
@zielu I have used the test build for a couple of days now with no errors.
@zielu An internal error happened today with the test build.
com.intellij.util.IncorrectOperationException: Sorry but parent: services of ProjectImpl@951021223 (class com.intellij.openapi.util.Disposer$2) has already been disposed (see the cause for stacktrace) so the child: zielu.gittoolbox.m.p@8a02cd5 (class zielu.gittoolbox.m.p) will never be disposed
at com.intellij.openapi.util.ObjectTree.register(ObjectTree.java:43)
at com.intellij.openapi.util.Disposer.register(Disposer.java:156)
at com.intellij.serviceContainer.LightServiceInstanceSupport$LightServiceInstanceInitializer.createInstance(LightServiceInstanceSupport.kt:54)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invokeSuspend(LazyInstanceHolder.kt:162)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invoke(LazyInstanceHolder.kt)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invoke(LazyInstanceHolder.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invokeSuspend(LazyInstanceHolder.kt:160)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invoke(LazyInstanceHolder.kt)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invoke(LazyInstanceHolder.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:44)
at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:112)
at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:126)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.initialize(LazyInstanceHolder.kt:145)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.access$initialize(LazyInstanceHolder.kt:13)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.tryInitialize(LazyInstanceHolder.kt:135)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.getInstance(LazyInstanceHolder.kt:95)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.getInstanceInCallerContext$suspendImpl(LazyInstanceHolder.kt:87)
at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.getInstanceInCallerContext(LazyInstanceHolder.kt)
at com.intellij.serviceContainer.ComponentManagerImplKt$getOrCreateInstanceBlocking$3.invokeSuspend(ComponentManagerImpl.kt:1548)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at com.intellij.serviceContainer.ComponentManagerImplKt$runBlockingInitialization$1.invoke(ComponentManagerImpl.kt:1636)
at com.intellij.serviceContainer.ComponentManagerImplKt$runBlockingInitialization$1.invoke(ComponentManagerImpl.kt:1627)
at com.intellij.openapi.progress.ContextKt.prepareIndicatorThreadContext$lambda$5(context.kt:107)
at com.intellij.openapi.progress.impl.CoreProgressManager.silenceGlobalIndicator(CoreProgressManager.java:1022)
at com.intellij.openapi.progress.ContextKt.prepareIndicatorThreadContext(context.kt:105)
at com.intellij.openapi.progress.ContextKt.prepareThreadContext(context.kt:75)
at com.intellij.serviceContainer.ComponentManagerImplKt.runBlockingInitialization(ComponentManagerImpl.kt:1627)
at com.intellij.serviceContainer.ComponentManagerImplKt.getOrCreateInstanceBlocking(ComponentManagerImpl.kt:1547)
at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:754)
at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:698)
at zielu.gittoolbox.K.z.y(z.java:6)
at zielu.gittoolbox.K.z.U(z.java:23)
at zielu.gittoolbox.m.j.g(j.java:1)
at zielu.gittoolbox.A.d.X(d.java:7)
at zielu.gittoolbox.A.H.Q(H.java:26)
at zielu.intellij.F.v.D(v.java:7)
at zielu.gittoolbox.A.H.A(H.java:9)
at zielu.gittoolbox.A.F.y(F.java:18)
at zielu.gittoolbox.A.F.T(F.java:1)
at zielu.intellij.B.U.x.K(x.java:5)
at com.codahale.metrics.Timer.timeSupplier(Timer.java:136)
at zielu.intellij.B.U.x.y(x.java:3)
at zielu.gittoolbox.A.v.P(v.java:3)
at zielu.gittoolbox.A.F.n(F.java:13)
at zielu.intellij.V.T.run(T.java:11)
at zielu.intellij.C.A.run(A.java:10)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.lambda$runUnderDisposeAwareIndicator$15(BackgroundTaskUtil.java:371)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:217)
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.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:366)
at zielu.gittoolbox.a.f.Q(f.java:81)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at com.intellij.util.concurrency.ContextCallable.call(ContextCallable.java:32)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:272)
at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:244)
at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:30)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:222)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:218)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:210)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
at java.base/java.lang.Thread.run(Thread.java:840)
Looking into it
Done in 500.2.12