scalameta / metals

Scala language server with rich IDE features 🚀

Home Page:https://scalameta.org/metals/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Metals not starting (couldn't create connection to server) Error code: Code: -32097

Maxi061204 opened this issue · comments

Describe the bug

I'm using the stable release version of scala metals in vscode but whenever i open up a project metals will try to connect to a server but always fail

How to reproduce:
open up a scala project directory and wait

My OS: Linux

i am using the official version of vscode. The open source variant code-oss from the Arch-User-Repository doesnt seem to have this problem for some reason

Here's the error output:
Metals version: 1.3.0
Using coursier located at /usr/bin/coursier
/home/maxi/.cache/coursier/arc/https/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.23%252B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.23_9.tar.gz/jdk-11.0.23+9/bin/java -version:
openjdk version "11.0.23" 2024-04-16
/home/maxi/.cache/coursier/arc/https/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.23%252B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.23_9.tar.gz/jdk-11.0.23+9/bin/java -version:
OpenJDK Runtime Environment Temurin-11.0.23+9 (build 11.0.23+9)
OpenJDK 64-Bit Server VM Temurin-11.0.23+9 (build 11.0.23+9, mixed mode)
Found java executable under /usr/bin/java that resolves to /usr/lib/jvm/java-8-openjdk/jre/bin/java
/usr/lib/jvm/java-8-openjdk/jre/bin/java -version:
openjdk version "1.8.0_412"
OpenJDK Runtime Environment (build 1.8.0_412-b08)
/usr/lib/jvm/java-8-openjdk/jre/bin/java -version:
OpenJDK 64-Bit Server VM (build 25.412-b08, mixed mode)
No installed java with version 17 found. Will fetch one using coursier.
Coursier: openjdk version "17.0.11" 2024-04-16
Coursier: OpenJDK Runtime Environment Temurin-17.0.11+9 (build 17.0.11+9)
OpenJDK 64-Bit Server VM Temurin-17.0.11+9 (build 17.0.11+9, mixed mode, sharing)
Using Java Home: /home/maxi/.cache/coursier/arc/https/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%252B9/OpenJDK17U-jdk_x64_linux_hotspot_17.0.11_9.tar.gz/jdk-17.0.11+9
Exception in thread "main" java.lang.ExceptionInInitializerError
at scala.meta.metals.Main$.main(Main.scala:45)
at scala.meta.metals.Main.main(Main.scala)
Caused by: java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /home/maxi/Documents/programmieren/??bungen/programming-2-ex-0
at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:121)
at java.base/sun.nio.fs.UnixPath.(UnixPath.java:68)
at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279)
at java.base/java.nio.file.Path.of(Path.java:147)
at java.base/java.nio.file.Paths.get(Paths.java:69)
at scala.meta.io.AbsolutePath$$anon$2.(AbsolutePath.scala:56)
at scala.meta.io.AbsolutePath$.workingDirectory(AbsolutePath.scala:56)
at scala.meta.internal.io.PathIO$.workingDirectory(PathIO.scala:10)
at scala.meta.internal.metals.Trace$.(Trace.scala:39)
... 2 more
[Error - 7:22:40 PM] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Info - 7:22:40 PM] Connection to server got closed. Server will restart.
true
[Error - 7:22:40 PM] Metals client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
Exception in thread "main" java.lang.ExceptionInInitializerError
at scala.meta.metals.Main$.main(Main.scala:45)
at scala.meta.metals.Main.main(Main.scala)
Caused by: java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /home/maxi/Documents/programmieren/??bungen/programming-2-ex-0
at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:121)
at java.base/sun.nio.fs.UnixPath.(UnixPath.java:68)
at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279)
at java.base/java.nio.file.Path.of(Path.java:147)
at java.base/java.nio.file.Paths.get(Paths.java:69)
at scala.meta.io.AbsolutePath$$anon$2.(AbsolutePath.scala:56)
at scala.meta.io.AbsolutePath$.workingDirectory(AbsolutePath.scala:56)
at scala.meta.internal.io.PathIO$.workingDirectory(PathIO.scala:10)
at scala.meta.internal.metals.Trace$.(Trace.scala:39)
... 2 more
[Error - 7:22:40 PM] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Info - 7:22:40 PM] Connection to server got closed. Server will restart.
true
[Error - 7:22:40 PM] Metals client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
Could not launch Metals Language Server:
Pending response rejected since connection got disposed
Release notes was not shown: not showing release notes since they've already been seen for your current version
Exception in thread "main" java.lang.ExceptionInInitializerError
at scala.meta.metals.Main$.main(Main.scala:45)
at scala.meta.metals.Main.main(Main.scala)
Caused by: java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /home/maxi/Documents/programmieren/??bungen/programming-2-ex-0
at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:121)
at java.base/sun.nio.fs.UnixPath.(UnixPath.java:68)
at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279)
at java.base/java.nio.file.Path.of(Path.java:147)
at java.base/java.nio.file.Paths.get(Paths.java:69)
at scala.meta.io.AbsolutePath$$anon$2.(AbsolutePath.scala:56)
at scala.meta.io.AbsolutePath$.workingDirectory(AbsolutePath.scala:56)
at scala.meta.internal.io.PathIO$.workingDirectory(PathIO.scala:10)
at scala.meta.internal.metals.Trace$.(Trace.scala:39)
... 2 more
[Error - 7:22:41 PM] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Info - 7:22:41 PM] Connection to server got closed. Server will restart.
true
[Error - 7:22:41 PM] Metals client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 7:22:41 PM] Restarting server failed
Message: Pending response rejected since connection got disposed
Code: -32097
Exception in thread "main" java.lang.ExceptionInInitializerError
at scala.meta.metals.Main$.main(Main.scala:45)
at scala.meta.metals.Main.main(Main.scala)
Caused by: java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /home/maxi/Documents/programmieren/??bungen/programming-2-ex-0
at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:121)
at java.base/sun.nio.fs.UnixPath.(UnixPath.java:68)
at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279)
at java.base/java.nio.file.Path.of(Path.java:147)
at java.base/java.nio.file.Paths.get(Paths.java:69)
at scala.meta.io.AbsolutePath$$anon$2.(AbsolutePath.scala:56)
at scala.meta.io.AbsolutePath$.workingDirectory(AbsolutePath.scala:56)
at scala.meta.internal.io.PathIO$.workingDirectory(PathIO.scala:10)
at scala.meta.internal.metals.Trace$.(Trace.scala:39)
... 2 more
[Error - 7:22:41 PM] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Info - 7:22:41 PM] Connection to server got closed. Server will restart.
true
[Error - 7:22:41 PM] Metals client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 7:22:41 PM] Restarting server failed
Message: Pending response rejected since connection got disposed
Code: -32097
Exception in thread "main" java.lang.ExceptionInInitializerError
at scala.meta.metals.Main$.main(Main.scala:45)
at scala.meta.metals.Main.main(Main.scala)
Caused by: java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /home/maxi/Documents/programmieren/??bungen/programming-2-ex-0
at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:121)
at java.base/sun.nio.fs.UnixPath.(UnixPath.java:68)
at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279)
at java.base/java.nio.file.Path.of(Path.java:147)
at java.base/java.nio.file.Paths.get(Paths.java:69)
at scala.meta.io.AbsolutePath$$anon$2.(AbsolutePath.scala:56)
at scala.meta.io.AbsolutePath$.workingDirectory(AbsolutePath.scala:56)
at scala.meta.internal.io.PathIO$.workingDirectory(PathIO.scala:10)
at scala.meta.internal.metals.Trace$.(Trace.scala:39)
... 2 more
[Error - 7:22:42 PM] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 7:22:42 PM] The Metals server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 7:22:42 PM] Metals client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 7:22:42 PM] Restarting server failed
Message: Pending response rejected since connection got disposed
Code: -32097

Expected behavior

Metals starting up normally

Operating system

Linux

Editor/Extension

VS Code

Version of Metals

v1.3.0

Extra context or search terms

I'm getting the Error Code: -32097 repeadetly as seen in the output

Thanks for reporting! It looks like we aren't able to encode your directory path /??bungen/programming-2-ex-0 Any idea why those two ?? show up? Would be good to see if we are able to fix it or whether the only workaround is to open a different workspace.

The path is taken from the user.dir property, which should be provided automatically.

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.