metals icon indicating copy to clipboard operation
metals copied to clipboard

Metals won't start server

Open Polymeth opened this issue 11 months ago • 2 comments

Describe the bug

When I launch Metals on VSCode for any Scala project (projects working before!), It says 'Metals client: couldn't create connection to server.' When I clicked see outputs, here is what I have :

Java home: /usr/bin/java
Metals version: 1.2.2
Using coursier located at /usr/local/bin/coursier
[Error - 11:02:32] Metals client: couldn't create connection to server.
Error: spawn ENOTDIR
	at ChildProcess.spawn (node:internal/child_process:413:11)
	at Object.spawn (node:child_process:806:9)
	at /Users/polymeth/.vscode/extensions/scalameta.metals-1.29.0/node_modules/vscode-languageclient/lib/node/main.js:426:46
	at async LanguageClient.createConnection (/Users/polymeth/.vscode/extensions/scalameta.metals-1.29.0/node_modules/vscode-languageclient/lib/common/client.js:1094:28)
	at async LanguageClient.start (/Users/polymeth/.vscode/extensions/scalameta.metals-1.29.0/node_modules/vscode-languageclient/lib/common/client.js:634:32)
Could not launch Metals Language Server:
spawn ENOTDIR
Release notes was not shown: not showing release notes since they've already been seen for your current version

I obviously reinstalled Metals, Coursier, VSCode and even NodeJS. My only way to fix this problem was reinstalling everything AND switching to the pre-release version.

Expected behavior

Metals working as before I guess.

Operating system

macOS Ventura

Editor/Extension

VS Code

Version of Metals

v1.29.0

Extra context or search terms

No response

Polymeth avatar Feb 27 '24 10:02 Polymeth

Thanks for reporting! Is /usr/local/bin/coursier available? Would be great to see what was the problematic executable.

Otherwise, we just updated a lot of the logic that deals with starting VS Code, so this could be a bit streamlined

tgodzik avatar Feb 27 '24 10:02 tgodzik

It looks like your JAVA_HOME is a path to a java executable not a Java home directory as we expect.

kasiaMarek avatar Feb 27 '24 12:02 kasiaMarek

Does this issue persist?

kasiaMarek avatar Jul 10 '24 12:07 kasiaMarek

This issue was closed because no new information was added for the last 30 days. If you have any relevant information, feel free to add it and reopen the issue.

github-actions[bot] avatar Aug 12 '24 10:08 github-actions[bot]