0

I am getting an error when I try to launch the sandbox for the DAML SDK Quickstart tutorial. Can anyone help? Please see the error below.

Cecils-MacBook-Pro:quickstart cezjah$ da run sandbox -- --port 7600 --scenario Main:setup target/daml/*
   ____             ____
  / __/__ ____  ___/ / /  ___ __ __
 _\ \/ _ `/ _ \/ _  / _ \/ _ \\ \ /
/___/\_,_/_//_/\_,_/_.__/\___/_\_\

Initialized sandbox version 6.0.0 with ledger-id = sandbox-e6f662a6-c492-4ca7-a3ab-5514eb897f50, port = 7600, dar file = DamlPackageContainer(List(target/daml/iou.dar),List(target/daml/ghc-prim.dalf)), time mode = Static, daml-engine = {}
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/Users/cezjah/.da/packages/sandbox/6.0.0/lib/protobuf-java-3.5.1.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Initialized Static time provider, starting from 1970-01-01T00:00:00Z
DAML LF Engine supports LF versions: 1.0, 0; Transaction versions: 1; Value versions: 1
Starting plainText server
Shutting down Sandbox application because of initialization error
Alain Merigot
  • 10,667
  • 3
  • 18
  • 31
Cezjah
  • 9
  • 1
  • What version of the SDK are you using? – dtanabe Feb 18 '19 at 22:52
  • Is there some extra output after `Shutting down Sandbox application because of initialization error`? I believe there should be a stacktrace following that line. – stefanobaghino Feb 19 '19 at 08:01
  • I am using Installed SDK Assistant version: 110-f42c34eba1 – Cezjah Feb 19 '19 at 16:36
  • Cecils-MacBook-Pro:quickstart cezjah$ da run sandbox -- --port 7600 --scenario Main:setup target/daml/* ____ ____ / __/__ ____ ___/ / / ___ __ __ _\ \/ _ `/ _ \/ _ / _ \/ _ \\ \ / /___/\_,_/_//_/\_,_/_.__/\___/_\_\ Initialized sandbox version 6.0.0 with ledger-id = sandbox-cdd3cf84-f042-4703-a4b1-a7527080e2ea, port = 7600, dar file = DamlPackageContainer(List(target/daml/iou.dar),List(target/daml/ghc-prim.dalf)), time mode = Static, daml-engine = {} WARNING: An illegal reflective access operation has occurred – Cezjah Feb 19 '19 at 16:47
  • The complete error is too long to post here..... – Cezjah Feb 19 '19 at 16:51
  • I decided to ignore the ugly error message and restarted the server using da restart. I’m able to see the Tutorial now via Navigator. – Cezjah Feb 20 '19 at 00:05
  • Can you edit the original post to include the stacktrace? That would be very useful for other readers to gain context. – stefanobaghino Feb 20 '19 at 08:03
  • Did the answer work for you? If so, accepting it will tell future reader that the solution works. Otherwise let me know, I'd be happy to help. – stefanobaghino Mar 03 '19 at 08:29

1 Answers1

0

It's probably a busy port if you happen to have experienced an error whose stack trace looks like the following

Shutting down Sandbox application because of initialization error
java.io.IOException: Failed to bind
at io.grpc.netty.NettyServer.start(NettyServer.java:231)
at io.grpc.internal.ServerImpl.start(ServerImpl.java:161)
at io.grpc.internal.ServerImpl.start(ServerImpl.java:76)
at com.digitalasset.platform.sandbox.SandboxApplication$SandboxServer.buildAndStartServer(SandboxApplication.scala:102)
at com.digitalasset.platform.sandbox.SandboxApplication$SandboxServer.start(SandboxApplication.scala:116)
at com.digitalasset.platform.sandbox.SandboxMain$.delayedEndpoint$com$digitalasset$platform$sandbox$SandboxMain$1(SandboxMain.scala:26)
at com.digitalasset.platform.sandbox.SandboxMain$delayedInit$body.apply(SandboxMain.scala:12)
at scala.Function0.apply$mcV$sp(Function0.scala:34)
at scala.Function0.apply$mcV$sp$(Function0.scala:34)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App.$anonfun$main$1$adapted(App.scala:76)
at scala.collection.immutable.List.foreach(List.scala:389)
at scala.App.main(App.scala:76)
at scala.App.main$(App.scala:74)

To diagnose and solve the issue you can find the culprit with the following command

ss -ptan | grep 7600 | awk '{print $6}'

The output should look like the following

users:(("java",pid=8686,fd=131))

The pid will point you to the process that is using the port. You can now use the following command to gain more information about it

ps -o pid,command -p 8686 # replace the pid with the one you found before

The output should look like the following

 PID COMMAND
8686 java -jar /path/to/sandbox-6.0.0.jar --port 7600 /path/to/some.dar

Based on this information you can decide whether to kill the process and start a new one or to keep this one running.

stefanobaghino
  • 11,253
  • 4
  • 35
  • 63