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

Error running bloop-server-start-check (Cannot run program "ps") #3130

Closed
francisdb opened this issue Aug 26, 2024 · 5 comments
Closed

Error running bloop-server-start-check (Cannot run program "ps") #3130

francisdb opened this issue Aug 26, 2024 · 5 comments
Assignees
Labels
Bloop Issues tied with Bloop integration. bug Something isn't working

Comments

@francisdb
Copy link

francisdb commented Aug 26, 2024

Version(s)
Scala 3.5.0

Describe the bug
When running in the graalvm-ce-22.3.3-b1-java17 / ghcr.io/graalvm/graalvm-community:22.0.1-ol9 docker image the following error pops up

> scala test.scala
...
#6 5.682 Downloaded https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.19/scala-compiler-2.12.19.jar
#6 5.744 Downloaded https://repo1.maven.org/maven2/io/get-coursier/interface/1.0.13/interface-1.0.13.jar
#6 5.779 Starting compilation server
#6 6.402 Error: Error running bloop-server-start-check (java.io.IOException: Cannot run program "ps": error=2, No such file or directory)
#6 6.492 Error: Error running bloop-server-start-check (java.io.IOException: Cannot run program "ps": error=2, No such file or directory)
...
#6 65.79 Error: Error running bloop-server-start-check (java.io.IOException: Cannot run program "ps": error=2, No such file or directory)
#6 65.80 Error: java.io.IOException: Cannot run program "ps": error=2, No such file or directory
#6 65.80 For more details, please see '/app/.scala-build/stacktraces/1724705998-10644603136351098915.log'

see also sbt/docker-sbt#298

@francisdb francisdb added the bug Something isn't working label Aug 26, 2024
@tgodzik
Copy link
Member

tgodzik commented Aug 27, 2024

Thanks for reporting! So ps is not available on your system? In that case we should not assume it.

@tgodzik
Copy link
Member

tgodzik commented Aug 27, 2024

Also, could you add a full stack trace from /app/.scala-build/stacktraces/1724705998-10644603136351098915.log if possible?

@francisdb
Copy link
Author

the docker images for graalvm do not contain ps

docker run -it --rm ghcr.io/graalvm/jdk-community:22.0.2 bash
bash-5.1# ps
bash: ps: command not found

there are other ways to get a process list:
https://stackoverflow.com/questions/32913424/how-to-get-all-process-ids-without-ps-command-on-linux

bash-5.1# scala test.scala
Warning: Only java properties are supported in JAVA_OPTS and JDK_JAVA_OPTIONS environment variables. Other options are ignored: -XX:+UseG1GC
bash: line 1: tput: command not found
Downloading compilation server 1.5.17-sc-2
Starting compilation server
Error: Error running bloop-server-start-check (java.io.IOException: Cannot run program "ps": error=2, No such file or directory)
...
Error: java.io.IOException: Cannot run program "ps": error=2, No such file or directory
For more details, please see '/app/.scala-build/stacktraces/1724763123-17675652493906783173.log'

bash-5.1# cat /app/.scala-build/stacktraces/1724763123-17675652493906783173.log
java.io.IOException: Cannot run program "ps": error=2, No such file or directory
  java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
  java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
  scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:85)
  scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang(ProcessBuilderImpl.scala:145)
  scala.sys.process.ProcessBuilderImpl$AbstractBuilder.slurp(ProcessBuilderImpl.scala:161)
  scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang$bang(ProcessBuilderImpl.scala:121)
  libdaemonjvm.internal.Processes$.isRunning(Processes.scala:20)
  libdaemonjvm.internal.LockProcess$Default.$anonfun$isRunning$2(LockProcess.scala:16)
  scala.runtime.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.scala:17)
  scala.Option.getOrElse(Option.scala:201)
  libdaemonjvm.internal.LockProcess$Default.isRunning(LockProcess.scala:16)
  libdaemonjvm.client.Connect$.$anonfun$tryConnect$3(Connect.scala:34)
  libdaemonjvm.client.Connect$.$anonfun$tryConnect$3$adapted(Connect.scala:33)
  scala.Option.flatMap(Option.scala:283)
  libdaemonjvm.client.Connect$.ifFiles$1(Connect.scala:33)
  libdaemonjvm.client.Connect$.tryConnect(Connect.scala:44)
  libdaemonjvm.client.Connect$.tryConnect(Connect.scala:13)
  bloop.rifle.internal.Operations$.check(Operations.scala:82)
  bloop.rifle.internal.Operations$.$anonfun$startServer$8(Operations.scala:265)
  bloop.rifle.BloopRifleLogger.$anonfun$runnable$1(BloopRifleLogger.scala:14)
  java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
  java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
  java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
  java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
  java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
  java.base/java.lang.Thread.run(Thread.java:1570)
java.io.IOException: error=2, No such file or directory
  java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
  java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
  java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
  java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
  java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
  scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:85)
  scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang(ProcessBuilderImpl.scala:145)
  scala.sys.process.ProcessBuilderImpl$AbstractBuilder.slurp(ProcessBuilderImpl.scala:161)
  scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang$bang(ProcessBuilderImpl.scala:121)
  libdaemonjvm.internal.Processes$.isRunning(Processes.scala:20)
  libdaemonjvm.internal.LockProcess$Default.$anonfun$isRunning$2(LockProcess.scala:16)
  scala.runtime.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.scala:17)
  scala.Option.getOrElse(Option.scala:201)
  libdaemonjvm.internal.LockProcess$Default.isRunning(LockProcess.scala:16)
  libdaemonjvm.client.Connect$.$anonfun$tryConnect$3(Connect.scala:34)
  libdaemonjvm.client.Connect$.$anonfun$tryConnect$3$adapted(Connect.scala:33)
  scala.Option.flatMap(Option.scala:283)
  libdaemonjvm.client.Connect$.ifFiles$1(Connect.scala:33)
  libdaemonjvm.client.Connect$.tryConnect(Connect.scala:44)
  libdaemonjvm.client.Connect$.tryConnect(Connect.scala:13)
  bloop.rifle.internal.Operations$.check(Operations.scala:82)
  bloop.rifle.internal.Operations$.$anonfun$startServer$8(Operations.scala:265)
  bloop.rifle.BloopRifleLogger.$anonfun$runnable$1(BloopRifleLogger.scala:14)
  java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
  java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
  java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
  java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
  java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
  java.base/java.lang.Thread.run(Thread.java:1570)

@Gedochao Gedochao added the Bloop Issues tied with Bloop integration. label Sep 2, 2024
@tgodzik
Copy link
Member

tgodzik commented Sep 6, 2024

I just checked and this should actually be already fixed under the newest Scala CLI, which uses Bloop 2.0.0. It no longer uses ps.

@tgodzik tgodzik closed this as not planned Won't fix, can't repro, duplicate, stale Sep 6, 2024
@github-project-automation github-project-automation bot moved this from To do to Done in Issue Board Sep 6, 2024
@francisdb
Copy link
Author

Any idea if this will make it to new Scala 3 releases? 3.5.2 is still affected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bloop Issues tied with Bloop integration. bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

7 participants
@francisdb @tgodzik @Gedochao and others