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

bloop fail to execute the command bsp --protocol tcp --port XXX #1763

Open
hajlaoui-nader opened this issue Jul 20, 2022 · 4 comments
Open

Comments

@hajlaoui-nader
Copy link

After a fresh install of windows 10 and wsl2 ubuntu 20.04, I can't get bloop to work correctly.
I tried using bloop with metals and installed the cli and I couldn't make it work either ways.

  • OS: WSL2 Ubuntu 20.04 on Windows 10
  • IDE: Visual Studio Code
  • metals version: 0.11.7

1- bloop with metals

2022.07.20 17:39:45 INFO  Bloop uses /home/nhajlaoui/.sdkman/candidates/java/11.0.15.9.1-amzn defined at /home/nhajlaoui/.bloop/bloop.json
2022.07.20 17:39:49 ERROR Starting the bsp launcher for bloop...
2022.07.20 17:39:49 ERROR Opening a bsp server connection with 'bsp --protocol local --socket /tmp/bsp-launcher13910958259287607416/bsp.socket'...
2022.07.20 17:39:49 ERROR Waiting for the bsp connection to come up...
2022.07.20 17:39:49 ERROR Waiting for the bsp connection to come up...
2022.07.20 17:39:49 ERROR Waiting for the bsp connection to come up...
2022.07.20 17:39:49 ERROR Waiting for the bsp connection to come up...
2022.07.20 17:39:49 ERROR Waiting for the bsp connection to come up...
2022.07.20 17:39:49 ERROR error: The command bsp --protocol local --socket /tmp/bsp-launcher13910958259287607416/bsp.socket returned with an error
2022.07.20 17:39:49 ERROR > No server running at 127.0.0.1:8212, let's fire one...
2022.07.20 17:39:49 ERROR > Resolving ch.epfl.scala:bloop-frontend_2.12:1.5.2...
2022.07.20 17:39:49 ERROR > Starting bloop server at 127.0.0.1:8212...
2022.07.20 17:39:49 ERROR > Attempting a connection to the server...
2022.07.20 17:39:49 ERROR > Attempting a connection to the server...
2022.07.20 17:39:49 ERROR > Attempting a connection to the server...
2022.07.20 17:39:49 ERROR error: Trying a tcp-based connection to the server instead...
2022.07.20 17:39:49 ERROR Opening a bsp server connection with 'bsp --protocol tcp --port 36062'...
2022.07.20 17:39:49 ERROR Waiting for the bsp connection to come up...
2022.07.20 17:39:49 ERROR error: The command bsp --protocol tcp --port 36062 returned with an error
2022.07.20 17:39:49 ERROR > 
2022.07.20 17:39:49 ERROR error: The launcher failed to establish a bsp connection, aborting...
2022.07.20 17:39:49 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:92)
	at bloop.launcher.LauncherMain.runLauncher(Launcher.scala:119)
	at scala.meta.internal.metals.BloopServers$$anon$2.run(BloopServers.scala:496)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.lang.Thread.run(Thread.java:833)

I use sdkman and JAVA_HOME is correctly set.

2- bloop stand alone
I installed bloop cli using coursier, and use a quickstart scala project

 ❯ bloop about                                                                                                                                                              18:19:37
bloop v1.5.2

Using Scala v2.12.15 and Zinc v1.6.0
Running on Java JDK v11.0.15 (/home/nhajlaoui/.sdkman/candidates/java/11.0.15.9.1-amzn)
  -> Supports debugging user code, Java Debug Interface (JDI) is available.
Maintained by the Scala Center and the community.
 ❯ bloop projects --verbose # this command and all bloop commands returns nothing (bash status code 131 "ENOTRECOVERABLE" = "State not recoverable")
@tgodzik
Copy link
Contributor

tgodzik commented Jul 20, 2022

Thanks for reporting! Did you try running Bloop with a different JDK? We test it on https://adoptium.net/en-GB/

Looks like nailgun is not able to run and all the commands just break.

@hajlaoui-nader
Copy link
Author

Tried with openjdk 11.0.12 and got the same behavior.

@tgodzik
Copy link
Contributor

tgodzik commented Jul 25, 2022

Is the Bloop process actually able to start up? Maybe ~/.bloop/bloop.json contains Java Home that is not accessible from within WSL2 or the premissions might be wrong.

If you change the string in metals.javaHome to an invalid one it should suggest to download the Java JDK itself. I wonder if that wouldn't work 🤔

Can't think of anything else currently. I would need to try and reproduce this.

@hajlaoui-nader
Copy link
Author

yes bloop process starts correctly, ~/.bloop/bloop.json contains a valid and accessible java home. I tried changing metals.javaHome and still having the same error.

Thank you @tgodzik !

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

2 participants