njpipeorgan / wolfram-language-notebook

Notebook support for Wolfram Language in VS Code
Apache License 2.0
159 stars 11 forks source link

LinkObject::linkd: Unable to communicate with closed link #27

Open dylanede opened 2 years ago

dylanede commented 2 years ago

I've installed version 0.0.10 in VSCode 1.68, and I am using Wolfram Engine 13.0.1 on Windows 10. Attempting to connect to a kernel, using the default wolframscript configuration, fails with the following log output:

[Sun, 12 Jun 2022 16:19:28 GMT] kernelIsRemote = false, kernelPort = 59322
[Sun, 12 Jun 2022 16:19:28 GMT] kernelInitPath = c:\Users\dylan\.vscode\extensions\njpipeorgan.wolfram-language-notebook-0.0.10\resources\init-compressed.txt
[Sun, 12 Jun 2022 16:19:28 GMT] kernelRenderInitPath = c:\Users\dylan\.vscode\extensions\njpipeorgan.wolfram-language-notebook-0.0.10\resources\render-html.wl
[Sun, 12 Jun 2022 16:19:28 GMT] launchCommand = wolframscript
[Sun, 12 Jun 2022 16:19:28 GMT] launchArguments = -code,ToExpression["zmqPort=59322;"<>Uncompress["1:eJy9PA1X27iy96e4gsMBrkJJ+7bvHSB54fOWu0ApSXfvWdcLJhHEi2OnttNCQ/afvf/2ZvRhS7IdUtpddimJJY1Go9F8yy+u44vu/7n/+MfqurO1de737/xbtrXlrK993Gy+wl/e0GX9LIijvGF1/
[Sun, 12 Jun 2022 16:19:30 GMT] Received the following data from kernel:
[Sun, 12 Jun 2022 16:19:30 GMT] <INITIALIZATION STARTS>
[Sun, 12 Jun 2022 16:19:33 GMT] Received the following data from kernel:
[Sun, 12 Jun 2022 16:19:33 GMT] $CommandLine={C:/Program Files/Wolfram Research/Wolfram Engine/13.0/wolfram.exe, -runfirst, Unprotect[$EvaluationEnvironment];$EvaluationEnvironment="Script";Protect[$EvaluationEnvironment];, -linkmode, Connect, -
[Sun, 12 Jun 2022 16:19:33 GMT] Received the following data from kernel:
[Sun, 12 Jun 2022 16:19:33 GMT] $ScriptCommandLine={wolframscript, -code, ToExpression["zmqPort=59322;"<>Uncompress["1:eJy9PA1X27iy96e4gsMBrkJJ+7bvHSB54fOWu0ApSXfvWdcLJhHEi2OnttNCQ/afvf/2ZvRhS7IdUtpddimJJY1Go9F8yy+u44vu/7n/+MfqurO1de737/xbtrXlrK993Gy+
[Sun, 12 Jun 2022 16:19:33 GMT] Received the following data from kernel:
[Sun, 12 Jun 2022 16:19:33 GMT] Using the following command to launch the subkernel process:
[Sun, 12 Jun 2022 16:19:33 GMT] Received the following data from kernel:
[Sun, 12 Jun 2022 16:19:33 GMT] C:/Program Files/Wolfram Research/Wolfram Engine/13.0/wolfram.exe -noicon -wstp -linkprotocol SharedMemory -linkmode connect -linkname qnuuu1jsqc0r55ie
[Sun, 12 Jun 2022 16:19:35 GMT] Received the following data from kernel:
[Sun, 12 Jun 2022 16:19:35 GMT] 
LinkObject::linkd: Unable to communicate with closed link LinkObject[qnuuu1jsqc0r55ie, 192, 2].

[Sun, 12 Jun 2022 16:19:35 GMT] Killing kernel process, pid = 27420
[Sun, 12 Jun 2022 16:19:35 GMT] Process exited with code 0 and signal null.

Note that I have put C:\Program Files\Wolfram Research\Wolfram Engine\13.0 and C:\Program Files\Wolfram Research\WolframScript on PATH.

dylanede commented 2 years ago

Is there anything more I can do to help diagnose this problem?

njpipeorgan commented 2 years ago

Sorry for the late reply. The problem was that the subkernel for the computation was not launched successfully. It happens more with Wolfram Engine or when used in WSL.

There is no reliable solution to this problem. You can try restart VS Code and kill all Wolfram related processes (like WolframKernel), and try installing a different version of Wolfram Engine.

Sun-ZhenXing commented 10 months ago

This problem is still occurring. And it occurs in container development in VS Code.

$Version
13.3.0 for Linux x86 (64-bit) (June 12, 2023)

Would like to support container development so that Docker can be used.