Open Meowcolm024 opened 2 years ago
It is strange that it may not always fail. Restart the build server may fix the problem, but then clicking import build
will bring out this problem again.
Bu things like code navigation still works (but always jump to front), which is quite confusing...
It may be a duplicate of #3532, but the metals version is slightly different.
Thanks for reporting! What version of Java Zulu 17 do you have exactly? Does it help if you switch to a different version?
Thanks for reporting! What version of Java Zulu 17 do you have exactly? Does it help if you switch to a different version?
I'm using:
openjdk 17.0.1 2021-10-19 LTS
OpenJDK Runtime Environment Zulu17.30+15-CA (build 17.0.1+12-LTS)
OpenJDK 64-Bit Server VM Zulu17.30+15-CA (build 17.0.1+12-LTS, mixed mode, sharing)
I currently change to bsp instead.
I haven't managed to reproduce, but it what is curious is what you wrote previously:
It is strange that it may not always fail. Restart the build server may fix the problem, but then clicking import build will bring out this problem again.
Looks like maybe it's connected to Java support and the additional export flags that we use to generate semanticdb indexes for Java files. Although that should fail when compiling and not when connecting.
Could try setting Bloop to the newest snapshot see if it helps? in Bloop version
setting you can set it to 1.4.12-8-50cc7dc0
?
It doesn't seem working. (importing or restarting also don't work)
We could probably try running Bloop CLI with verbose on, but you would need to install that separately via coursier cs install bloop
and run bloop compile -verbose <project-name>
. That might give us more information.
Last thing you can try is if Open JDK from https://adoptium.net/ is working for you.
Thanks, but I think I would use bsp for now :(
Sure! If anyone bumps into this problem and can try running Bloop, do let me know!
I had similar issues. Killing hanging java processes seemed to help. It is probably another instance of bloop hanging.
I think that I run into the same issue. On metals 0.11.1 I am no able to get things working.
2022.01.19 09:39:06 INFO Attempting to connect to the build server... 2022.01.19 09:39:06 ERROR Failed to connect with build server, no functionality will work. java.util.concurrent.ExecutionException: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Failed to load project from .../.bloop/app-build-build.json at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395) at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2022) at scala.meta.internal.metals.BuildServerConnection$.initialize(BuildServerConnection.scala:419) at scala.meta.internal.metals.BuildServerConnection$.$anonfun$fromSockets$1(BuildServerConnection.scala:329) at scala.util.Success.$anonfun$map$1(Try.scala:255) at scala.util.Success.map(Try.scala:213) at scala.concurrent.Future.$anonfun$map$1(Future.scala:292) at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33) at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.lang.Thread.run(Thread.java:829)
Operating system
Ubuntu 20.04
Editor/Extension
VS Code Version of Metals
v0.11.1 Extra context or search terms
Java:
openjdk 11.0.11 2021-04-20 LTS OpenJDK Runtime Environment Zulu11.48+21-CA (build 11.0.11+9-LTS) OpenJDK 64-Bit Server VM Zulu11.48+21-CA (build 11.0.11+9-LTS, mixed mode)
I will try to install bloop separately in a minute
Running bloop compile --verbose <project-name>
finished successfully
Does it work for you on a non-zulu JDK? Does it always fail on the same project? app-build-build.json
is an sbt project, so I wonder whether this is connected to sbt classpath.
You can also try using older/newer Bloop version (can be set in the metals settings) to see if that helps.
What does bloop about
return?
Ok, I guess that it was strange coincidence. Yesterday I changed project sbt.version up to 1.6.1 and locally was 1.5.5. After local update it started to work again.
Sorry for the problems !
Just ran into this exact problem. After I killed the running java process, everything is now working.
Following @ironfish comment, I also killed the running Java process, restarted VS Code and re-imported by build and everything seemed to go back to normal.
macOS 12.1 (M1) Editor/Extension
Version of Metals
v1.12.16
Java: OpenJDK v1.8.0_292
2022.02.02 01:52:35 ERROR Starting the bsp launcher for bloop...[0m
2022.02.02 01:52:35 ERROR Opening a bsp server connection with 'bsp --protocol local --socket /var/folders/2r/p3w98vqd2rg67697ym0bww600000gn/T/bsp-launcher2360262949825378170/bsp.socket'...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR error: Giving up on waiting for a connection, printing embedded bloop logs:[0m
2022.02.02 01:52:35 ERROR > [0m[32m[D][0m Loading workspace settings from bloop.settings.json[0m
2022.02.02 01:52:35 ERROR error: Trying a tcp-based connection to the server instead...[0m
2022.02.02 01:52:35 ERROR Opening a bsp server connection with 'bsp --protocol tcp --port 31468'...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR Waiting for the bsp connection to come up...[0m
2022.02.02 01:52:35 ERROR error: Giving up on waiting for a connection, printing embedded bloop logs:[0m
2022.02.02 01:52:35 ERROR > [0m[32m[D][0m Loading workspace settings from bloop.settings.json[0m
2022.02.02 01:52:35 ERROR error: The launcher failed to establish a bsp connection, aborting...[0m
2022.02.02 01:52:35 ERROR Failed to connect with build server, no functionality will work.
java.lang.RuntimeException: The server did not start, got FailedToOpenBspConnection
at bloop.launcher.LauncherMain.failPromise$1(Launcher.scala:95)
at bloop.launcher.LauncherMain.runLauncher(Launcher.scala:122)
at scala.meta.internal.metals.BloopServers$$anon$2.run(BloopServers.scala:169)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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:748)
[0m
Mine was for nvim metals instead of VSCode, but under the covers they both are using the same idea with bloop.
I think we should be able to invoke coursier to manually kill Bloop (using bloopgun) in this case when restarting and if the BSP server is disconencted.
Describe the bug
The server can successfully start yesterday but, it does not work today. When checking the log, the Metals version used yesterday is 0.11.0, but today is 0.11.1.
It keeps
Waiting for the bsp connection to come up...
Expected behavior
Server should start.
Operating system
macOS 12 (M1)
Editor/Extension
VS Code
Version of Metals
v0.11.1
Extra context or search terms
Java: Zulu 17
Log: