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

Did not work on Windows, JAVA problem #886

Open
milen-prg opened this issue Aug 11, 2024 · 6 comments
Open

Did not work on Windows, JAVA problem #886

milen-prg opened this issue Aug 11, 2024 · 6 comments
Labels
1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-unconfirmed Issue status: Bug that needs to be reproduced (all new bugs have this label)

Comments

@milen-prg
Copy link

When install on VSCode (Windows 11 Pro 64 bit, all updated) and open a file - error message:

Could not run ltex-ls with Java, please see the output panel 'LTeX Language Client' for details. You might want to try offline installation.

2024-08-11T16:59:05.110Z Info: Setting LTeX UI language to 'en'.
2024-08-11T16:59:05.110Z Info: Loading i18n messages...
2024-08-11T16:59:05.110Z Info: Loading default i18n messages...
2024-08-11T16:59:05.112Z Info:
2024-08-11T16:59:05.112Z Info: ltex.ltex-ls.path not set.
2024-08-11T16:59:05.112Z Info: Searching for ltex-ls in 'c:\Users\User.vscode\extensions\neo-ltex.ltex-13.1.1\lib'...
2024-08-11T16:59:05.112Z Info: ltex-ls found in 'c:\Users\User.vscode\extensions\neo-ltex.ltex-13.1.1\lib\ltex-ls-15.2.0'.
2024-08-11T16:59:05.112Z Info:
2024-08-11T16:59:05.112Z Info: Using ltex-ls from 'c:\Users\User.vscode\extensions\neo-ltex.ltex-13.1.1\lib\ltex-ls-15.2.0'.
2024-08-11T16:59:05.112Z Info: Using Java bundled with ltex-ls as ltex.java.path is not set.
2024-08-11T16:59:05.113Z Info: Testing ltex-ls...
2024-08-11T16:59:05.113Z Info: Command: "c:\Users\User\.vscode\extensions\neo-ltex.ltex-13.1.1\lib\ltex-ls-15.2.0\bin\ltex-ls.bat"
2024-08-11T16:59:05.113Z Info: Arguments: ["--version"]
2024-08-11T16:59:05.113Z Info: env['JAVA_HOME']: undefined
2024-08-11T16:59:05.113Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m"
2024-08-11T16:59:05.113Z Error: Test failed.
2024-08-11T16:59:05.113Z Error: Error details:
2024-08-11T16:59:05.119Z Error: Error: spawnSync c:\Users\User.vscode\extensions\neo-ltex.ltex-13.1.1\lib\ltex-ls-15.2.0\bin\ltex-ls.bat EINVAL
2024-08-11T16:59:05.119Z Error: at Object.spawnSync (node:internal/child_process:1124:20)
2024-08-11T16:59:05.119Z Error: at Object.spawnSync (node:child_process:914:24)
2024-08-11T16:59:05.119Z Error: at DependencyManager. (c:\Users\User.vscode\extensions\neo-ltex.ltex-13.1.1\dist\extension.js:14956:45)
2024-08-11T16:59:05.119Z Error: at Generator.next ()
2024-08-11T16:59:05.119Z Error: at fulfilled (c:\Users\User.vscode\extensions\neo-ltex.ltex-13.1.1\dist\extension.js:14587:58)
2024-08-11T16:59:05.119Z Info: ltex-ls did not print expected version information to stdout.
2024-08-11T16:59:05.119Z Info: stdout of ltex-ls:
2024-08-11T16:59:05.119Z Info:
2024-08-11T16:59:05.119Z Info: stderr of ltex-ls:
2024-08-11T16:59:05.119Z Info:
2024-08-11T16:59:05.120Z Info: You might want to try offline installation, see https://valentjn.github.io/vscode-ltex/docs/installation-and-usage.html#offline-installation.

The offline installation is successful, but nothing changes.

@milen-prg milen-prg added 1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-unconfirmed Issue status: Bug that needs to be reproduced (all new bugs have this label) labels Aug 11, 2024
@pearj
Copy link

pearj commented Aug 12, 2024

I noticed this problem too. It was working last week, so I'm guessing a recent update to VS Code broke something. I tried using the offline installation, but it didn't help either. Curiously running the --version command from cmd.exe actually works. So it's a problem with how the extension launches the command it seems.

C:\Users\joel>c:\Users\joel\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib\ltex-ls-15.2.0\bin\ltex-ls.bat --version
{
  "ltex-ls": "15.2.0",
  "java": "11.0.12"
}

@watanabe-j
Copy link

Perhaps is this a duplicate of #884? I had the same problem, but the patch solution suggested there seems to have worked for me.

@miltonra
Copy link

Same problem I guess. Tried setting ltex.java.path manually, to no avail.
Tried offline installation, which resulted in:
2024-08-12T18:32:01.480Z Info: Setting LTeX UI language to 'en'.
2024-08-12T18:32:01.481Z Info: Loading i18n messages...
2024-08-12T18:32:01.481Z Info: Loading default i18n messages...
2024-08-12T18:32:01.483Z Info:
2024-08-12T18:32:01.484Z Info: ltex.ltex-ls.path not set.
2024-08-12T18:32:01.484Z Info: Searching for ltex-ls in 'c:\Users\fc1ram.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib'...
2024-08-12T18:32:01.484Z Info: ltex-ls found in 'c:\Users\fc1ram.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib\ltex-ls-15.2.0'.
2024-08-12T18:32:01.484Z Info:
2024-08-12T18:32:01.484Z Info: Using ltex-ls from 'c:\Users\fc1ram.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib\ltex-ls-15.2.0'.
2024-08-12T18:32:01.484Z Info: Using Java bundled with ltex-ls as ltex.java.path is not set.
2024-08-12T18:32:01.484Z Info: Testing ltex-ls...
2024-08-12T18:32:01.484Z Info: Command: "c:\Users\fc1ram\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib\ltex-ls-15.2.0\bin\ltex-ls.bat"
2024-08-12T18:32:01.484Z Info: Arguments: ["--version"]
2024-08-12T18:32:01.484Z Info: env['JAVA_HOME']: undefined
2024-08-12T18:32:01.484Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m"
2024-08-12T18:32:01.485Z Error: Test failed.
2024-08-12T18:32:01.485Z Error: Error details:
2024-08-12T18:32:01.487Z Error: Error: spawnSync c:\Users\fc1ram.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib\ltex-ls-15.2.0\bin\ltex-ls.bat EINVAL
2024-08-12T18:32:01.487Z Error: at Object.spawnSync (node:internal/child_process:1124:20)
2024-08-12T18:32:01.487Z Error: at Object.spawnSync (node:child_process:914:24)
2024-08-12T18:32:01.487Z Error: at DependencyManager. (c:\Users\fc1ram.vscode\extensions\valentjn.vscode-ltex-13.1.0\dist\extension.js:13528:45)
2024-08-12T18:32:01.487Z Error: at Generator.next ()
2024-08-12T18:32:01.487Z Error: at fulfilled (c:\Users\fc1ram.vscode\extensions\valentjn.vscode-ltex-13.1.0\dist\extension.js:13159:58)
2024-08-12T18:32:01.487Z Info: ltex-ls did not print expected version information to stdout.
2024-08-12T18:32:01.487Z Info: stdout of ltex-ls:
2024-08-12T18:32:01.487Z Info:
2024-08-12T18:32:01.487Z Info: stderr of ltex-ls:
2024-08-12T18:32:01.487Z Info:
2024-08-12T18:32:01.487Z Info: You might want to try offline installation, see https://valentjn.github.io/vscode-ltex/docs/installation-and-usage.html#offline-installation.

Hope this helps.

@wellebeSICKAG
Copy link

wellebeSICKAG commented Aug 21, 2024

This issue is because VS Code updated Node.js which includes this security fix:
https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
There is some documentation on starting shell processes here:
https://nodejs.org/api/child_process.html#spawning-bat-and-cmd-files-on-windows
And some discussion about it here:
nodejs/node#52554

It can be fixed (not sure if this is a safe fix though). By replacing the executableOptions in extension.js (starting line 13618) with:

              const executableOptions = {
                encoding: 'utf-8',
                timeout: 15000,
                shell: true
              };

This is also a duplicate of issue #884

@musm
Copy link

musm commented Oct 4, 2024

Thanks @wellebeSICKAG was able to fix it using that patch

@mark1spec
Copy link

mark1spec commented Oct 12, 2024

UPDATE: I just found a working fork of this repository (VSCode plugin) which solves the issue on Windows: LTeX+

I can confirm the same problem on Windows 11 and VSCode 1.94.2. I tried:

  • offline installation
  • the above fix with the extension.js

Still no luck. Feel free to request more info.

Just in case my log file:

2024-10-12T16:59:09.708Z Info: ltex.ltex-ls.path not set. 2024-10-12T16:59:09.708Z Info: Searching for ltex-ls in 'c:\Users\Mariusz\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib'... 2024-10-12T16:59:09.708Z Info: ltex-ls found in 'c:\Users\Mariusz\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib\ltex-ls-15.2.0'. 2024-10-12T16:59:09.708Z Info: 2024-10-12T16:59:09.708Z Info: Using ltex-ls from 'c:\Users\Mariusz\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib\ltex-ls-15.2.0'. 2024-10-12T16:59:09.708Z Info: Using Java bundled with ltex-ls as ltex.java.path is not set. 2024-10-12T16:59:09.709Z Info: Testing ltex-ls... 2024-10-12T16:59:09.709Z Info: Command: "c:\\Users\\Mariusz\\.vscode\\extensions\\valentjn.vscode-ltex-13.1.0\\lib\\ltex-ls-15.2.0\\bin\\ltex-ls.bat" 2024-10-12T16:59:09.709Z Info: Arguments: ["--version"] 2024-10-12T16:59:09.709Z Info: env['JAVA_HOME']: undefined 2024-10-12T16:59:09.709Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m" 2024-10-12T16:59:09.710Z Error: Test failed. 2024-10-12T16:59:09.710Z Error: Error details: 2024-10-12T16:59:09.714Z Error: Error: spawnSync c:\Users\Mariusz\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib\ltex-ls-15.2.0\bin\ltex-ls.bat EINVAL 2024-10-12T16:59:09.714Z Error: at Object.spawnSync (node:internal/child_process:1124:20) 2024-10-12T16:59:09.714Z Error: at Object.spawnSync (node:child_process:910:24) 2024-10-12T16:59:09.714Z Error: at DependencyManager.<anonymous> (c:\Users\Mariusz\.vscode\extensions\valentjn.vscode-ltex-13.1.0\dist\extension.js:13528:45) 2024-10-12T16:59:09.714Z Error: at Generator.next (<anonymous>) 2024-10-12T16:59:09.714Z Error: at fulfilled (c:\Users\Mariusz\.vscode\extensions\valentjn.vscode-ltex-13.1.0\dist\extension.js:13159:58) 2024-10-12T16:59:09.714Z Info: ltex-ls did not print expected version information to stdout. 2024-10-12T16:59:09.714Z Info: stdout of ltex-ls: 2024-10-12T16:59:09.714Z Info: 2024-10-12T16:59:09.714Z Info: stderr of ltex-ls: 2024-10-12T16:59:09.714Z Info:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-unconfirmed Issue status: Bug that needs to be reproduced (all new bugs have this label)
Projects
None yet
Development

No branches or pull requests

7 participants