Skip to content

Turning on networkingMode=mirrored does not run code with PyCharm #10695

@LH667371

Description

@LH667371

Windows Version
10.0.22621.2506

WSL Version
2.0.7.0

Kernel Version
5.15.133.1-1

Distro Version
Ubuntu 20.04

Other Software
PyCharm 2023.2.3 (Professional Edition)

Repro Steps
Turn on networkingMode=mirrored; can't use PyCharm to invoke WSL's Python environment to run code.

Expected Behavior
The code runs normally and there is an output log.

Actual Behavior
1698718162101_042E21A0-6E0E-4b3f-B425-A72F6A8C80B0

A look at idea.log reveals the following error
2023-10-31 10:03:42,862 [1040478] INFO - #c.i.e.wsl - WSL mount root for Ubuntu-20.04 is /mnt/ (done in 162 ms)
2023-10-31 10:03:43,171 [1040787] INFO - #c.i.e.r.ExecutionUtil - Error running '1017':
wslproxy closed stream unexpectedly. See idea.log for errors
java.lang.Exception: wslproxy closed stream unexpectedly. See idea.log for errors
at com.intellij.execution.wsl.WslProxy.readToBuffer(WslProxy.kt:107)
at com.intellij.execution.wsl.WslProxy.access$readToBuffer(WslProxy.kt:37)
at com.intellij.execution.wsl.WslProxy$readToBuffer$1.invokeSuspend(WslProxy.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
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 kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
at com.intellij.execution.wsl.WslProxy.(WslProxy.kt:129)
at com.intellij.execution.wsl.target.WslTargetEnvironment.getWslPort(WslTargetEnvironment.kt:96)
at com.intellij.execution.wsl.target.WslTargetEnvironment.(WslTargetEnvironment.kt:83)
at com.intellij.execution.wsl.target.WslTargetEnvironmentRequest.prepareEnvironment(WslTargetEnvironmentRequest.kt:51)
at com.jetbrains.python.run.PythonCommandLineState.startProcess(PythonCommandLineState.java:342)
at com.jetbrains.python.run.PythonCommandLineState.execute(PythonCommandLineState.java:234)
at com.jetbrains.python.run.PythonScriptCommandLineState.execute(PythonScriptCommandLineState.java:147)
at com.jetbrains.python.run.PythonCommandLineState.execute(PythonCommandLineState.java:180)
at com.jetbrains.python.run.PythonRunner.lambda$execute$2(PythonRunner.java:67)
at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:24)
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:833)
Caused by: kotlinx.coroutines.channels.ClosedReceiveChannelException: Unexpected EOF: expected 4 more bytes
at io.ktor.utils.io.ByteBufferChannel.readFullySuspend(ByteBufferChannel.kt:580)
at io.ktor.utils.io.ByteBufferChannel.access$readFullySuspend(ByteBufferChannel.kt:24)
at io.ktor.utils.io.ByteBufferChannel$readFullySuspend$1.invokeSuspend(ByteBufferChannel.kt)
... 25 more
2023-10-31 10:03:44,171 [1041787] WARN - #c.i.e.w.WslProxy - Exit code was 255
2023-10-31 10:03:44,514 [1042130] INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities to files
2023-10-31 10:04:46,465 [1104081] INFO - #c.j.p.PyToolWindowLayoutProvider - Python default layout applied
2023-10-31 10:04:56,343 [1113959] INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities to files

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugexternalIssue exists outside of WSL components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions