sbt thinks that server is already booting because of this exception

See original GitHub issue

steps

Using sbt 1.6.1 on Windows 10. I am also using Amazon Corretto JDK 8.312, if that makes a difference. The issue is present in both Git Bash and cmd.

  1. Open a terminal, cd to a project, and execute sbt.
  2. Open another terminal, cd to the same project, and try executing sbt in any form, including sbt --no-server. This will give an error.

problem

This is what I receive upon executing the second sbt command:

>sbt --no-server compile
sbt thinks that server is already booting because of this exception:
sbt.internal.ServerAlreadyBootingException: java.io.IOException: Could not create lock for \\.\pipe\sbt-load-8979016220299674466_lock, error 5
        at sbt.internal.BootServerSocket.newSocket(BootServerSocket.java:348)
        at sbt.internal.BootServerSocket.<init>(BootServerSocket.java:294)
        at sbt.xMain$.getSocketOrExit(Main.scala:145)
        at sbt.xMain$.bootServerSocket$lzycompute$1(Main.scala:77)
        at sbt.xMain$.bootServerSocket$1(Main.scala:77)
        at sbt.xMain$.withStreams$1(Main.scala:85)
        at sbt.xMain$.run(Main.scala:121)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at sbt.internal.XMainConfiguration.run(XMainConfiguration.java:57)
        at sbt.xMain.run(Main.scala:46)
        at xsbt.boot.Launch$.$anonfun$run$1(Launch.scala:149)
        at xsbt.boot.Launch$.withContextLoader(Launch.scala:176)
        at xsbt.boot.Launch$.run(Launch.scala:149)
        at xsbt.boot.Launch$.$anonfun$apply$1(Launch.scala:44)
        at xsbt.boot.Launch$.launch(Launch.scala:159)
        at xsbt.boot.Launch$.apply(Launch.scala:44)
        at xsbt.boot.Launch$.apply(Launch.scala:21)
        at xsbt.boot.Boot$.runImpl(Boot.scala:78)
        at xsbt.boot.Boot$.run(Boot.scala:73)
        at xsbt.boot.Boot$.main(Boot.scala:21)
        at xsbt.boot.Boot.main(Boot.scala)
Caused by: java.io.IOException: Could not create lock for \\.\pipe\sbt-load-8979016220299674466_lock, error 5
        at org.scalasbt.ipcsocket.Win32NamedPipeServerSocket.<init>(Win32NamedPipeServerSocket.java:129)
        at org.scalasbt.ipcsocket.Win32NamedPipeServerSocket.<init>(Win32NamedPipeServerSocket.java:48)
        at sbt.internal.BootServerSocket.newSocket(BootServerSocket.java:342)
        ... 23 more
Create a new server? y/n (default y)

expectation

Ideally, the server would work without my intervention. If the server absolutely can’t work, at least there should be a working way to disable it (again, without my intervention).

notes

This issue, at least in some form, was reported previously in #6101, which has been marked as closed with #6728. However, the issue is still present for me.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:9
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
AlonsoM45commented, Mar 30, 2022

I have managed to get this working with one of the suggestions in the original issue. Add the options --batch -Dsbt.server.forcestart=true when running sbt. Examples: sbt --batch -Dsbt.server.forcestart=true compile sbt --batch -Dsbt.server.forcestart=true run

However, that seems to only be a workaround instead of an actual fix for this issue.

0reactions
mikenaccommented, Apr 21, 2022

Confirmed. This is still an issue. I am running this with 1.6.2 on Alpine in docker and it fails with --no-server.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sbt wrongly prints "sbt server is already booting" #6101 - GitHub
sbt thinks that server is already booting because of this exception : java.io.IOException: Could not create lock for \\.
Read more >
wsl 2 - "sbt server is already booting." error when launching ...
After moving my project files to a directory within wsl2, problem is solved. My project files were in a Windows directory before.
Read more >
sbt/sbt - Gitter
sbt tells me server failed to start on local:sbt-server-db2293e8210ae3595027. java.io.IOException: Could not create lock for \\.
Read more >
sbt Reference Manual — sbt Server
Actually, sbt server just adds network access to sbt's shell command so, in addition to accepting ... Currently the following header fields are...
Read more >
gemnasium-maven fails on Mac OS when using sbt >= 1.4.0
sbt -no-colors dependencyDot sbt thinks that server is already booting because of this exception: sbt.internal.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found