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

Metals fails to load project #1312

Open
ghost opened this issue Jan 23, 2023 · 3 comments
Open

Metals fails to load project #1312

ghost opened this issue Jan 23, 2023 · 3 comments

Comments

@ghost
Copy link

ghost commented Jan 23, 2023

Describe the bug

Fails to load with a bunch of repeating errors about tring to parse a filesystem path.

2023.01.23 05:37:11 INFO  tracing is disabled for protocol LSP, to enable tracing of incoming and outgoing JSON messages create an empty file at \\wsl$\OracleLinux_9\home\user\p\tdc\.metals\lsp.trace.json or C:\Users\user\AppData\Local\scalameta\metals\cache\lsp.trace.json
Jan 23, 2023 5:37:12 AM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
SEVERE: Internal error: java.lang.IllegalArgumentException: URI authority component has undefined host
java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: URI authority component has undefined host
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292)
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308)
	at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:661)
	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:646)
	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488)
	at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1990)
	at scala.concurrent.java8.FuturesConvertersImpl$CF.apply(FutureConvertersImpl.scala:29)
	at scala.concurrent.java8.FuturesConvertersImpl$CF.apply(FutureConvertersImpl.scala:26)
	at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:484)
	at scala.concurrent.ExecutionContext$parasitic$.execute(ExecutionContext.scala:222)
	at scala.concurrent.impl.Promise$Transformation.submitWithValue(Promise.scala:429)
	at scala.concurrent.impl.Promise$DefaultPromise.submitWithValue(Promise.scala:338)
	at scala.concurrent.impl.Promise$DefaultPromise.tryComplete0(Promise.scala:285)
	at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:504)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.IllegalArgumentException: URI authority component has undefined host
	at sun.nio.fs.WindowsUriSupport.fromUri(WindowsUriSupport.java:140)
	at sun.nio.fs.WindowsFileSystemProvider.getPath(WindowsFileSystemProvider.java:96)
	at java.nio.file.Paths.get(Paths.java:138)
	at scala.meta.internal.mtags.MtagsEnrichments$XtensionURIMtags.toAbsolutePath(MtagsEnrichments.scala:119)
	at scala.meta.internal.mtags.MtagsEnrichments$XtensionStringMtags.toAbsolutePath(MtagsEnrichments.scala:158)
	at scala.meta.internal.metals.MetalsEnrichments$XtensionString.toAbsolutePath(MetalsEnrichments.scala:609)
	at scala.meta.internal.metals.MetalsEnrichments$XtensionString.toAbsolutePath(MetalsEnrichments.scala:606)
	at scala.meta.internal.metals.MetalsLanguageServer.updateWorkspaceDirectory(MetalsLanguageServer.scala:365)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$initialize$2(MetalsLanguageServer.scala:879)
	at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:678)
	at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467)
	... 3 more

To Reproduce Steps to reproduce the behavior:

Try to load a project on a WSL UNC path (\\wsl$\...).

Expected behavior

Metals loads the project.

Screenshots

Installation:

  • Operating system: Windows 11, WSL2
  • VSCode version: 1.74.3
  • VSCode extension version: 1.21.0
  • Metals version: 0.11.10

Additional context

To be fair, VSCode itself is kind of freaking out saying its file watcher stopped unexpectedly.

Search terms

@tgodzik
Copy link
Contributor

tgodzik commented Jan 23, 2023

Thanks for reporting! Is the project working indeed within the WSL workspace? The stack trace seems to point out that the project is started withing Windows and maybe trying to access the files on WSL? Though I must admit I am not too familiar with how WSL2 works exactly.

Caused by: java.lang.IllegalArgumentException: URI authority component has undefined host
	at sun.nio.fs.WindowsUriSupport.fromUri(WindowsUriSupport.java:140)
	at sun.nio.fs.WindowsFileSystemProvider.getPath(WindowsFileSystemProvider.java:96)
	at java.nio.file.Paths.get(Paths.java:138)

@ghost
Copy link
Author

ghost commented Jan 23, 2023

VSCode is running on Windows, and the project files are on Linux.

@tgodzik
Copy link
Contributor

tgodzik commented Feb 6, 2023

I would suggest using WSL plugin within VS Code in that case. I am not sure if we can sensibly make it work with pure Windows + WSL filesystem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant