scala-cli icon indicating copy to clipboard operation
scala-cli copied to clipboard

bloop.rifle.FailedToStartServerExitCodeException (perhaps due to confusion about which JDK to run?)

Open bjornregnell opened this issue 2 years ago • 41 comments

Version(s) Scala CLI 1.0.4 Scala 3.3.0

Describe the bug When scala-cli run . it craches:

"bloop.rifle.FailedToStartServerExitCodeException: Server failed with exit code 1
  bloop.rifle.internal.Operations$.$anonfun$startServer$8(Operations.scala:263)
  bloop.rifle.BloopRifleLogger.$anonfun$runnable$1(BloopRifleLogger.scala:14)
  [email protected]/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
  [email protected]/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
  [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
  [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
  [email protected]/java.lang.Thread.run(Thread.java:833)
  com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
  com.oracle.svm.core.windows.WindowsPlatformThreads.osThreadStartRoutine(WindowsPlatformThreads.java:178)"

To Reproduce

It was reproducible on the machine of a student of mine before we fixed it with this workaround:

scala-cli clean .
scala-cli run . --jvm 17

Prior to that it did not work with --jvm system and now I'm unsure if it can be reproduced.

A lot of thing was happening on the machine to try to fix it, including cs uninstall --all, nuking caches etc. But nothing helped until --jvm 17

It seems as if perhaps scala-cli picked up the system jvm but bloop couldn't, but I'm not sure.

Expected behaviour It should not crash and bloop should use the same JDK as scala-cli (if that was the actual problem).

bjornregnell avatar Oct 06 '23 17:10 bjornregnell

Perhaps related to https://github.com/oyvindberg/bleep/issues/355

bjornregnell avatar Oct 07 '23 07:10 bjornregnell

I'm getting a similar issue on CI:

Redacted logs:

cd examples/release
ls | grep .scala | xargs scala-cli compile
[...]
shell: /usr/bin/bash -e {0}
env:
  CI: true
  JAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/8.0.382-5/x64
[...]
Error: Exception in thread "main" bloop.rifle.FailedToStartServerExitCodeException: Server failed with exit code 1
	at bloop.rifle.internal.Operations$.$anonfun$startServer$8(Operations.scala:263)
	at bloop.rifle.BloopRifleLogger.$anonfun$runnable$1(BloopRifleLogger.scala:14)
	at [email protected]/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at [email protected]/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
	at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
	at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at [email protected]/java.lang.Thread.run(Thread.java:833)
	at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
	at com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)
Error: Process completed with exit code 123.

So it seems that bloop is trying to run with Java 17, even though the Java home points to Java 8?

JD557 avatar Oct 28 '23 21:10 JD557

fwiw, this happens to me rather often on our Jenkins instance at scala-ci.typesafe.com — I have been sadly lax about reporting it or trying to troubleshoot it, sorry about that

here's an example log where it happened: https://scala-ci.typesafe.com/job/scala-2.13.x-jdk8-integrate-community-build/5801/console

our Jenkins workers routinely use different JDK versions ranging from 8 to 22, so it's quite plausible to me that it's related to running multiple JDKs on the same machine

I do not know how to force it to happen, and I wish I had some insight into conditions under which it tends to happen, but I don't

if there's some sort of troubleshooting I could do or diagnostic options I could enable to get more information about it, I'm happy to try to assist

also interested in workaround information — I guess I could try the --jvm 17 thing

SethTisue avatar Oct 28 '23 21:10 SethTisue

Oh, I've been running with --bloop-jvm 17 for a long time now and that hasn't fixed it. Not sure whether to take that out

SethTisue avatar Oct 28 '23 21:10 SethTisue

We'll take a look! The team is out until 4th though, so we will dig in then

tgodzik avatar Oct 29 '23 08:10 tgodzik

I think the issue might happen if JAVA_HOME is set to a version lower than 17. We removed the support for running Bloop on lower versions, which is why this is breaking in some CIs. Previously, it might break from time to time as it would use less reliable sockets. At least I think that's the issue.

tgodzik avatar Nov 02 '23 18:11 tgodzik

Nice that you have a lead to investigate. Even if 17 is required I still think it should not crash with a strange error msg - at least it should be detected and explained to the user. But best of course if it can work regardless of if it is 17 or 11 or 8.

bjornregnell avatar Nov 03 '23 13:11 bjornregnell

I had the same issue. Following the comment above I looked at my JAVA_HOME env variable. It was pointing to java8. I switched to java17 and it started to work.

Squaess avatar Nov 09 '23 08:11 Squaess

I have the same problem. I am using the JDK 11 and getting this error. image

In JDK 17 it works fine, but since we are still on 11 in prod, I need to continue using 11.

yadavan88 avatar Nov 09 '23 20:11 yadavan88

I have the same problem but running java 17. Has anyone found a fix that isn't updating to java 17?

holmsander avatar Nov 24 '23 08:11 holmsander

@holmsander For me the issue got resolved after upgrading scala-cli to 1.0.6. Did you try that?

yadavan88 avatar Nov 24 '23 08:11 yadavan88

@yadavan88 yes I did try that. But It just started working after restarting my computer. This might fix it for some, but it should be noted I tried everything in this thread as well as updating java to 17.0.9 before restarting. So not sure if it is a combination of all these things or just the restart.

holmsander avatar Nov 24 '23 08:11 holmsander

Well, if anyone can still reproduce this issue, could you please apply -v -v -v to the command you're using? E.g. scala-cli run MyApp.scala -v -v -v Maybe the full logs can point us in the right direction, since I can't reproduce this locally, no matter what the combination of my JVM is.

MaciejG604 avatar Dec 13 '23 09:12 MaciejG604

I have just asked my students in our Discord if anyone still can reproduce this. The original problem was solved on that machine by re-install, after cleaning all relevant dot-files also in home and then using--jvm 17. If anyone can reproduce it I'll urge to send -v -v -v output here. (But it was a while ago now that it happened, so it might not happen...)

bjornregnell avatar Dec 13 '23 10:12 bjornregnell

I am still seeing occasional FailedToStartServerExitCodeExceptions on the Scala 2 community build Jenkins, even on scala-cli 1.1.0.

I've just added -v -v -v to the script in question in the hopes of gathering some information on this in the coming days/weeks. (It seems to fail, idk, maybe 5% of the time, something like that.)

SethTisue avatar Dec 14 '23 02:12 SethTisue

Thanks! It would be awesome figure that out, though I need to work through my backlog of bloop tech debt to probably fix this

tgodzik avatar Dec 14 '23 07:12 tgodzik

I still get this issue every now and then. The last time I encountered this issue I applied the following command, as suggested:

scala-cli run MyApp.scala -v -v -v

And here's the output that I got:

PS C:\Users\ayadi\workspace\Test> scala-cli run MyApp.scala -v -v -v
Checking for a running Bloop server at C:\Users\ayadi\AppData\Local\ScalaCli\data\bloop\daemon ...
Attempting to connect to Bloop server C:\Users\ayadi\AppData\Local\ScalaCli\data\bloop\daemon ...
Connection attempt result: None
Checking for a running Bloop server at C:\Users\ayadi\AppData\Local\ScalaCli\data\bloop\daemon ...
Attempting to connect to Bloop server C:\Users\ayadi\AppData\Local\ScalaCli\data\bloop\daemon ...
Connection attempt result: None
Bloop daemon status: not running
Starting compilation server
Starting Bloop 1.5.9-sc-1 at C:\Users\ayadi\AppData\Local\ScalaCli\data\bloop\daemon using JVM C:\Program Files (x86)\Eclipse Adoptium\jdk-17.0.8.7-hotspot\bin\java.exe
Fetching List(Dependency(io.github.alexarchambault.bleep:bloop-frontend_2.12, 1.5.9-sc-1, Configuration(), Set(), Publication(, Type(), Extension(), Classifier()), false, true))
Found 113 artifacts:
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\github\alexarchambault\bleep\bloop-frontend_2.12\1.5.9-sc-1\bloop-frontend_2.12-1.5.9-sc-1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\ch\epfl\scala\bloop-config_2.12\1.5.5\bloop-config_2.12-1.5.5.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\github\alexarchambault\case-app_2.12\2.0.6\case-app_2.12-2.0.6.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\github\alexarchambault\libdaemon\libdaemon_2.12\0.0.11\libdaemon_2.12-0.0.11.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\ch\qos\logback\logback-classic\1.4.6\logback-classic-1.4.6.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\ch\epfl\scala\scala-debug-adapter_2.12\3.1.3\scala-debug-adapter_2.12-3.1.3.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-lang\scala-library\2.12.18\scala-library-2.12.18.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\github\alexarchambault\bleep\bloop-backend_2.12\1.5.9-sc-1\bloop-backend_2.12-1.5.9-sc-1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\github\plokhotnyuk\jsoniter-scala\jsoniter-scala-core_2.12\2.13.3.2\jsoniter-scala-core_2.12-2.13.3.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\github\alexarchambault\case-app-annotations_2.12\2.0.6\case-app-annotations_2.12-2.0.6.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\github\alexarchambault\case-app-util_2.12\2.0.6\case-app-util_2.12-2.0.6.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\ch\qos\logback\logback-core\1.4.6\logback-core-1.4.6.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\slf4j\slf4j-api\2.0.6\slf4j-api-2.0.6.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\ch\epfl\scala\com-microsoft-java-debug-core\0.34.0%2B19\com-microsoft-java-debug-core-0.34.0%2B19.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-lang\scala-reflect\2.12.18\scala-reflect-2.12.18.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\ow2\asm\asm\9.5\asm-9.5.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\ow2\asm\asm-util\9.5\asm-util-9.5.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\test-agent\1.9.2\test-agent-1.9.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-lang\modules\scala-collection-compat_2.12\2.10.0\scala-collection-compat_2.12-2.10.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\zipkin\brave\brave\5.16.0\brave-5.16.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\googlecode\java-diff-utils\diffutils\1.3.0\diffutils-1.3.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\ch\epfl\scala\directory-watcher\0.8.0%2B6-f651bd93\directory-watcher-0.8.0%2B6-f651bd93.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\librarymanagement-ivy_2.12\1.9.1\librarymanagement-ivy_2.12-1.9.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\monix\monix_2.12\3.2.0\monix_2.12-3.2.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\github\alexarchambault\bleep\nailgun-server\1.0.7\nailgun-server-1.0.7.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\lihaoyi\pprint_2.12\0.8.1\pprint_2.12-0.8.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scalaz\scalaz-core_2.12\7.3.7\scalaz-core_2.12-7.3.7.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\lihaoyi\sourcecode_2.12\0.3.0\sourcecode_2.12-0.3.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\zipkin\reporter2\zipkin-sender-urlconnection\2.16.4\zipkin-sender-urlconnection-2.16.4.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\zeroturnaround\zt-zip\1.15\zt-zip-1.15.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\github\alexarchambault\bleep\bloop-shared_2.12\1.5.9-sc-1\bloop-shared_2.12-1.5.9-sc-1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\chuusai\shapeless_2.12\2.3.3\shapeless_2.12-2.3.3.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\apache\commons\commons-lang3\3.12.0\commons-lang3-3.12.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\google\code\gson\gson\2.10.1\gson-2.10.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\reactivex\rxjava2\rxjava\2.2.21\rxjava-2.2.21.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\reactivestreams\reactive-streams\1.0.4\reactive-streams-1.0.4.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\commons-io\commons-io\2.12.0\commons-io-2.12.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\ow2\asm\asm-tree\9.5\asm-tree-9.5.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\ow2\asm\asm-analysis\9.5\asm-analysis-9.5.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\test-interface\1.0\test-interface-1.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\zipkin\reporter2\zipkin-reporter-brave\2.16.3\zipkin-reporter-brave-2.16.3.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\net\java\dev\jna\jna\5.13.0\jna-5.13.0.jar  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\librarymanagement-core_2.12\1.9.1\librarymanagement-core_2.12-1.9.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\eed3si9n\sjson-new-core_2.12\0.9.1\sjson-new-core_2.12-0.9.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\ivy\ivy\2.3.0-sbt-a8f9eb5bf09d0539ea3658a2c2d4e09755b5133e\ivy-2.3.0-sbt-a8f9eb5bf09d0539ea3658a2c2d4e09755b5133e.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\monix\monix-execution_2.12\3.2.0\monix-execution_2.12-3.2.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\monix\monix-catnap_2.12\3.2.0\monix-catnap_2.12-3.2.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\monix\monix-eval_2.12\3.2.0\monix-eval_2.12-3.2.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\monix\monix-tail_2.12\3.2.0\monix-tail_2.12-3.2.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\monix\monix-reactive_2.12\3.2.0\monix-reactive_2.12-3.2.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\monix\monix-java_2.12\3.2.0\monix-java_2.12-3.2.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\net\java\dev\jna\jna-platform\5.13.0\jna-platform-5.13.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\lihaoyi\fansi_2.12\0.4.0\fansi_2.12-0.4.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\zipkin\reporter2\zipkin-reporter\2.16.4\zipkin-reporter-2.16.4.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\ch\epfl\scala\bsp4s_2.12\2.1.0-M5\bsp4s_2.12-2.1.0-M5.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\get-coursier\interface\1.0.13\interface-1.0.13.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\apache\logging\log4j\log4j-core\2.20.0\log4j-core-2.20.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\net\jpountz\lz4\lz4\1.3.0\lz4-1.3.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\zinc_2.12\1.9.2\zinc_2.12-1.9.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\typelevel\macro-compat_2.12\1.1.1\macro-compat_2.12-1.1.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-lang\scala-compiler\2.12.18\scala-compiler-2.12.18.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\jcraft\jsch\0.1.54\jsch-0.1.54.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\launcher-interface\1.4.2\launcher-interface-1.4.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\eed3si9n\gigahorse-apache-http_2.12\0.7.0\gigahorse-apache-http_2.12-0.7.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-lang\modules\scala-xml_2.12\2.1.0\scala-xml_2.12-2.1.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\io_2.12\1.9.1\io_2.12-1.9.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\util-logging_2.12\1.9.1\util-logging_2.12-1.9.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\util-position_2.12\1.9.1\util-position_2.12-1.9.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\util-cache_2.12\1.9.1\util-cache_2.12-1.9.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\monix\implicitbox_2.12\0.2.0\implicitbox_2.12-0.2.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\jctools\jctools-core\2.1.2\jctools-core-2.1.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\typelevel\cats-effect_2.12\2.1.3\cats-effect_2.12-2.1.3.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\zipkin\zipkin2\zipkin\2.23.2\zipkin-2.23.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\me\vican\jorge\jsonrpc4s_2.12\0.1.0\jsonrpc4s_2.12-0.1.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\apache\logging\log4j\log4j-api\2.20.0\log4j-api-2.20.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\zinc-core_2.12\1.9.2\zinc-core_2.12-1.9.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\zinc-persist_2.12\1.9.2\zinc-persist_2.12-1.9.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\zinc-compile-core_2.12\1.9.2\zinc-compile-core_2.12-1.9.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\zinc-classfile_2.12\1.9.2\zinc-classfile_2.12-1.9.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\eed3si9n\gigahorse-core_2.12\0.7.0\gigahorse-core_2.12-0.7.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\eed3si9n\shaded-apache-httpasyncclient\0.7.0\shaded-apache-httpasyncclient-0.7.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\swoval\file-tree-views\2.1.10\file-tree-views-2.1.10.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\util-interface\1.9.1\util-interface-1.9.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\collections_2.12\1.9.1\collections_2.12-1.9.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\core-macros_2.12\1.9.1\core-macros_2.12-1.9.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\jline\jline\2.14.7-sbt-a1b0ffbb8f64bb820f4f84a0c07a0c0964507493\jline-2.14.7-sbt-a1b0ffbb8f64bb820f4f84a0c07a0c0964507493.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\jline\jline-terminal\3.19.0\jline-terminal-3.19.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\jline\jline-terminal-jna\3.19.0\jline-terminal-jna-3.19.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\jline\jline-terminal-jansi\3.19.0\jline-terminal-jansi-3.19.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\lmax\disruptor\3.4.2\disruptor-3.4.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\eed3si9n\sjson-new-scalajson_2.12\0.9.1\sjson-new-scalajson_2.12-0.9.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\eed3si9n\sjson-new-murmurhash_2.12\0.9.1\sjson-new-murmurhash_2.12-0.9.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\typelevel\cats-core_2.12\2.1.1\cats-core_2.12-2.1.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\outr\scribe_2.12\3.5.5\scribe_2.12-3.5.5.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\zinc-apiinfo_2.12\1.9.2\zinc-apiinfo_2.12-1.9.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\zinc-classpath_2.12\1.9.2\zinc-classpath_2.12-1.9.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\compiler-interface\1.9.2\compiler-interface-1.9.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\zinc-persist-core-assembly\1.9.2\zinc-persist-core-assembly-1.9.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\util-relation_2.12\1.9.1\util-relation_2.12-1.9.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\sbinary_2.12\0.5.1\sbinary_2.12-0.5.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-lang\modules\scala-parser-combinators_2.12\1.1.2\scala-parser-combinators_2.12-1.1.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\net\openhft\zero-allocation-hashing\0.10.1\zero-allocation-hashing-0.10.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\util-control_2.12\1.9.1\util-control_2.12-1.9.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\typesafe\ssl-config-core_2.12\0.6.1\ssl-config-core_2.12-0.6.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\fusesource\jansi\jansi\2.1.0\jansi-2.1.0.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\eed3si9n\shaded-jawn-parser_2.12\0.9.1\shaded-jawn-parser_2.12-0.9.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\eed3si9n\shaded-scalajson_2.12\1.0.0-M4\shaded-scalajson_2.12-1.0.0-M4.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\typelevel\cats-macros_2.12\2.1.1\cats-macros_2.12-2.1.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\typelevel\cats-kernel_2.12\2.1.1\cats-kernel_2.12-2.1.1.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\outr\perfolation_2.12\1.2.8\perfolation_2.12-1.2.8.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\outr\moduload_2.12\1.1.5\moduload_2.12-1.1.5.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-sbt\compiler-bridge_2.12\1.9.2\compiler-bridge_2.12-1.9.2.jar
  C:\Users\ayadi\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\typesafe\config\1.4.2\config-1.4.2.jar
Checking for a running Bloop server at C:\Users\ayadi\AppData\Local\ScalaCli\data\bloop\daemon ...
Attempting to connect to Bloop server C:\Users\ayadi\AppData\Local\ScalaCli\data\bloop\daemon ...
Error occurred during initialization of VM
Option -XX:+UseZGC not supported
Connection attempt result: None
Bloop server exited with code 1
Running
  C:\Program Files\scala-cli-x86_64-pc-win32\scala-cli.exe bloop output
might give more details.
Exception in thread "main" bloop.rifle.FailedToStartServerExitCodeException: Server failed with exit code 1
        at bloop.rifle.internal.Operations$.$anonfun$startServer$8(Operations.scala:263)
        at bloop.rifle.BloopRifleLogger.$anonfun$runnable$1(BloopRifleLogger.scala:14)
        at [email protected]/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at [email protected]/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at [email protected]/java.lang.Thread.run(Thread.java:833)
        at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
        at com.oracle.svm.core.windows.WindowsPlatformThreads.osThreadStartRoutine(WindowsPlatformThreads.java:178)

AyaDiy avatar Dec 17 '23 18:12 AyaDiy

That looks super weird:

Error occurred during initialization of VM
Option -XX:+UseZGC not supported

looks like we still somehow pick up the wrong version of Java, but how would that be possible :/

@yadavan88 do you even have an older Java installed? Is it in you JAVA_HOME perhaps?

Alternatively, we should retry without the gc option.

tgodzik avatar Dec 18 '23 12:12 tgodzik

Alternatively, we should retry without the gc option.

It seems reasonable to try to recover from this error by tweaking the options, if nothing else helps.

bjornregnell avatar Dec 18 '23 13:12 bjornregnell

Could it be this: https://wiki.openjdk.org/display/zgc/Main#Main-SupportedPlatforms

Requires Windows version 1803 (Windows 10 or Windows Server 2019) or later.

JD557 avatar Dec 18 '23 13:12 JD557

That looks super weird:

Error occurred during initialization of VM
Option -XX:+UseZGC not supported

looks like we still somehow pick up the wrong version of Java, but how would that be possible :/

@yadavan88 do you even have an older Java installed? Is it in you JAVA_HOME perhaps?

Alternatively, we should retry without the gc option.

For me, the issue got resolved once i upgraded to 1.1.0. My exact version info are as below:

OS - Mac 14
Java: AdoptOpenJDK-11.0.11+9
Scala-cli: 1.1.0

yadavan88 avatar Dec 18 '23 13:12 yadavan88

Ach sorry to ping you, I meant @AyaDiy . I hoped that Github would suggest the newest user and I haven't checked.

So two more questions to @AyaDiy:

What is the Java version you are using or have in JAVA_HOME ?

Requires Windows version 1803 (Windows 10 or Windows Server 2019) or later.

Could it be that you have an older Windows and that's why the particular GC option is not working?

tgodzik avatar Dec 18 '23 14:12 tgodzik

@AyaDiy I think you can see JAVA_HOME by opening the cmd terminal i Windows (press windows button and type cmd and press enter) and the type this (note the trailing %):

echo %JAVA_HOME%

What is then printed in the terminal?

bjornregnell avatar Dec 18 '23 20:12 bjornregnell

@AyaDiy And you can find your windows version with this command in cmd:

systeminfo | findstr /B /C:"OS Name" /C:"OS Version"

What does it print?

bjornregnell avatar Dec 18 '23 20:12 bjornregnell

It seems to be the right version. Skärmbild 2023-12-18 221018

AyaDiy avatar Dec 19 '23 12:12 AyaDiy

On my MacOS 14 laptop recently, bloop would not start. The problem persisted for days. Eventually I tried rm -rf ~/Library/Caches/ScalaCli and that fixed it immediately.

The verbose logging included

Caught libdaemonjvm.server.LockError$ZombieFound: Cannot connect to process 1639, trying again in 3 seconds

SethTisue avatar Jan 14 '24 19:01 SethTisue

I'm also still getting this exception repeatedly on Linux. An example log where it occurred, with -v -v -v enabled, is at https://scala-ci.typesafe.com/view/scala-2.13.x/job/scala-2.13.x-jdk22-integrate-community-build/248/console

perhaps this section of the log is the important part?

Checking for a running Bloop server at /home/jenkins/.local/share/scalacli/bloop/daemon ...
Attempting to connect to Bloop server /home/jenkins/.local/share/scalacli/bloop/daemon ...
Connection attempt result: None
Exception in thread "main" java.lang.Exception: libdaemonjvm.server.LockError$ZombieFound: Cannot connect to process 770
	at bloop.Bloop$.loop$1(Bloop.scala:102)
	at bloop.Bloop$.main(Bloop.scala:114)
	at bloop.Bloop.main(Bloop.scala)
Caused by: libdaemonjvm.server.LockError$ZombieFound: Cannot connect to process 770

Then the problem goes away on subsequent runs.

It's a Jenkins server that routinely shuts itself down, then starts itself back up again later. It's something of a guess, but perhaps the problem is limited to the first run after a restart.

SethTisue avatar Jan 14 '24 19:01 SethTisue

Hmm... this should have been fixed by https://github.com/scala-cli/bloop-core/pull/150/files

Although, I see something weird before that:

Connection attempt result: None
Bloop server PID: 975
Ignoring SIGINT

supposedly Bloop started under another PID before and was restarted, when it failed again,

tgodzik avatar Jan 14 '24 22:01 tgodzik

fwiw, I've just upgraded the Linux machines in question from scala-cli 1.1.0 to 1.1.1, I'll keep an eye it on and see if that helps

SethTisue avatar Jan 16 '24 00:01 SethTisue

(it might be nice if -v -v -v caused the Scala-CLI version to be printed)

SethTisue avatar Jan 16 '24 00:01 SethTisue