Port file was not written to '/tmp/extra-dir-781939682115/sandbox-portfile' in time

I am following the Daml Official documentation to setup Daml in my Linux VM.
got an issue with daml start command.

Port file was not written to ‘/tmp/extra-dir-781939682115/sandbox-portfile’ in time.
Please help me in resolving this issue.

Hi @Teja_Satyanarayana thank you for this question.

Looking at the screenshot, you have stated that your Node --version is v17.6.0.

Referring to the Daml prerequisites documents, you will see that the required Node --version is to have at least v14.8.3 and beyond. However there have been multiple counts of Node v17 causing issues on GNU/Linux, myself included.

I have rolled back to v16.18.1 with no issues, just to be safe.

Re your direct question, refer to this reply from @stefanobaghino-da

This should not be a node issue. It sounds like Canon is not starting up. Can you share log/canton.log?

I am experiencing the exact same issue.
I’m on a MacBook Pro M1, trying to run “daml start” inside a VS Code devcontainer, running Ubuntu 22.04 (jammy) under Rosetta with x64 architecture

Dockerfile
FROM --platform=linux/amd64 Microsoft Artifact Registry

If I change Docker engine to QEMU it fails installing the SDK. Rosetta does install it sucesfully, but cannot run sandbox.
The command

daml sandbox --dar Main.dar --static-time

fails in the exact same manner:

“Port file was not written to ‘/tmp/extra-dir-73174037815187/sandbox-portfile’ before process exit with ExitFailure 127”

No extra-dir folder exists on /tmp/.
Mentioned post mentions the warning, but this is a hard crash. The process does not proceed. Running locally on my Mac does work, but I’d like to standardize our coding environment to devcontainers.
There are no log folder created, only my working local project creates a log folder.
Changing Node version to 16.20.2 gets the same result.
Thank you.

@HelenaBenji, do you have a JDK installed in your dev container?

The following worked for me with Daml SDK 2.9.5:

  1. Create the following files:

    Dockerfile

    FROM --platform=linux/amd64 ubuntu:jammy
    

    .devcontainer.json

     {
       "build": { "dockerfile": "Dockerfile" },
       "customizations": {
         "vscode": {
           "extensions": [
             "ms-vscode-remote.remote-containers"
           ]
         }
       }
     }
    
  2. In VS Code, run “Dev Containers: Reopen in Container”.

  3. Install the Daml SDK.

    apt-get update
    apt-get install curl
    curl https://get.daml.com | sh
    export PATH=$PATH:/root/.daml/bin/
    daml version
    
  4. Install Open JDK version 17.

     apt-get install openjdk-17-jdk
     java --version
    
  5. Start the Sandbox.

    daml new testing
    cd testing
    daml start
    
    Results
    Running single package build of testing as no multi-package.yaml was found.
    
    2025-01-23 22:46:32.78 [INFO]  [build] 
    Compiling testing to a DAR.
    
    2025-01-23 22:46:33.78 [INFO]  [build] 
    Created .daml/dist/testing-0.0.1.dar
    Waiting for canton sandbox to start.
    Uploading .daml/dist/testing-0.0.1.dar to localhost:6865
    DAR upload succeeded.
    Running the initialization script.
    Slf4jLogger started
    Running CoordinatedShutdown with reason [ActorSystemTerminateReason]
    Waiting for navigator to start: 
    22:47:14,393 |-INFO in ch.qos.logback.classic.LoggerContext[default] - This is logback-classic version ?
    22:47:14,396 |-INFO in ch.qos.logback.classic.util.ContextInitializer@663c9e7a - No custom configurators were discovered as a service.
    22:47:14,397 |-INFO in ch.qos.logback.classic.util.ContextInitializer@663c9e7a - Trying to configure with ch.qos.logback.classic.joran.SerializedModelConfigurator
    22:47:14,398 |-INFO in ch.qos.logback.classic.util.ContextInitializer@663c9e7a - Constructed configurator of type class ch.qos.logback.classic.joran.SerializedModelConfigurator
    22:47:14,419 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.scmo]
    22:47:14,422 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.scmo]
    22:47:14,444 |-INFO in ch.qos.logback.classic.util.ContextInitializer@663c9e7a - ch.qos.logback.classic.joran.SerializedModelConfigurator.configure() call lasted 25 milliseconds. ExecutionStatus=INVOKE_NEXT_IF_ANY
    22:47:14,444 |-INFO in ch.qos.logback.classic.util.ContextInitializer@663c9e7a - Trying to configure with ch.qos.logback.classic.util.DefaultJoranConfigurator
    22:47:14,446 |-INFO in ch.qos.logback.classic.util.ContextInitializer@663c9e7a - Constructed configurator of type class ch.qos.logback.classic.util.DefaultJoranConfigurator
    22:47:14,454 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [/root/.daml/sdk/2.9.5/daml-sdk/navigator-logback.xml] at [file:/root/.daml/sdk/2.9.5/daml-sdk/navigator-logback.xml]
    22:47:14,535 |-WARN in ch.qos.logback.core.joran.action.ParamAction - <param> element is deprecated in favor of a more direct syntax.At line 18
    22:47:14,535 |-WARN in ch.qos.logback.core.joran.action.ParamAction - For details see http://logback.qos.ch/codes.html#param
    22:47:14,597 |-WARN in ch.qos.logback.core.model.processor.AppenderModelHandler - Appender named [STDOUT] not referenced. Skipping further processing.
    22:47:14,597 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - Processing appender named [STDERR]
    22:47:14,597 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
    22:47:14,605 |-INFO in ch.qos.logback.core.model.processor.ImplicitModelHandler - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
    22:47:14,613 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - Processing appender named [FILE]
    22:47:14,613 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
    22:47:14,615 |-INFO in ch.qos.logback.core.model.processor.ImplicitModelHandler - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
    22:47:14,624 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is set to [navigator.log]
    22:47:14,625 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - Processing appender named [ASYNC]
    22:47:14,625 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - About to instantiate appender of type [ch.qos.logback.classic.AsyncAppender]
    22:47:14,627 |-INFO in ch.qos.logback.core.model.processor.AppenderRefModelHandler - Attaching appender named [FILE] to ch.qos.logback.classic.AsyncAppender[ASYNC]
    22:47:14,627 |-INFO in ch.qos.logback.classic.AsyncAppender[ASYNC] - Attaching appender named [FILE] to AsyncAppender.
    22:47:14,627 |-INFO in ch.qos.logback.classic.AsyncAppender[ASYNC] - Setting discardingThreshold to 51
    22:47:14,629 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [user-facing-logs] to INFO
    22:47:14,632 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting additivity of logger [user-facing-logs] to true
    22:47:14,632 |-INFO in ch.qos.logback.core.model.processor.AppenderRefModelHandler - Attaching appender named [STDERR] to Logger[user-facing-logs]
    22:47:14,632 |-INFO in ch.qos.logback.classic.model.processor.RootLoggerModelHandler - Setting level of ROOT logger to INFO
    22:47:14,632 |-INFO in ch.qos.logback.core.model.processor.AppenderRefModelHandler - Attaching appender named [ASYNC] to Logger[ROOT]
    22:47:14,632 |-INFO in ch.qos.logback.core.model.processor.DefaultProcessor@19e4653c - End of configuration.
    22:47:14,633 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@795509d9 - Registering current configuration as safe fallback point
    22:47:14,633 |-INFO in ch.qos.logback.classic.util.ContextInitializer@663c9e7a - ch.qos.logback.classic.util.DefaultJoranConfigurator.configure() call lasted 187 milliseconds. ExecutionStatus=DO_NOT_INVOKE_NEXT_IF_ANY
    
       _  __          _           __
      / |/ /__ __  __(_)__ ____ _/ /____  ____
     /    / _ `/ |/ / / _ `/ _ `/ __/ _ \/ __/
    /_/|_/\_,_/|___/_/\_, /\_,_/\__/\___/_/
                   /___/
    Version 2.9.5
    
    Warning: 'daml navigator' is deprecated and will be removed in Daml 3.0.
    Frontend running at http://localhost:7500.
    http://localhost:7500: 1: xdg-open: not found
    .....Waiting for JSON API to start: 
    2025-01-23 22:47:19.468 [main] INFO  com.daml.http.Main - Config(ledgerHost=localhost, ledgerPort=6865, address=127.0.0.1, httpPort=7575, https=None, portFile=None, packageReloadInterval=5 seconds, packageMaxInboundMessageSize=None, maxInboundMessageSize=4194304, tlsConfig=TlsConfiguration(false,None,None,None,None,REQUIRE,false,None), jdbcConfig=None, staticContentConfig=None, authConfig=None, allowNonHttps=true, wsConfig=None, nonRepudiationCertificateFile=None, nonRepudiationPrivateKeyFile=None, nonRepudiationPrivateKeyAlgorithm=None, surrogateTpIdCacheMaxEntries=None), context: {instance_uuid: "262efb2f-c2df-4e45-85ea-b135ec6612f9"} 
    2025-01-23 22:47:20.006 [http-json-ledger-api-pekko.actor.default-dispatcher-5] INFO  o.a.pekko.event.slf4j.Slf4jLogger - Slf4jLogger started 
    2025-01-23 22:47:20.647 [http-json-ledger-api-pekko.actor.default-dispatcher-6] INFO  com.daml.http.HttpService - HTTP Server pre-startup, context: {instance_uuid: "262efb2f-c2df-4e45-85ea-b135ec6612f9"} 
    2025-01-23 22:47:20.852 [http-json-ledger-api-pekko.actor.default-dispatcher-6] INFO  com.daml.http.LedgerClient - Attempting to connect to the ledger localhost:6865 (600 attempts), context: {instance_uuid: "262efb2f-c2df-4e45-85ea-b135ec6612f9"} 
    2025-01-23 22:47:21.217 [http-json-ledger-api-pekko.actor.default-dispatcher-6] INFO  com.daml.http.LedgerClient - Attempt 1/600 succeeded!, context: {instance_uuid: "262efb2f-c2df-4e45-85ea-b135ec6612f9"} 
    2025-01-23 22:47:21.220 [http-json-ledger-api-pekko.actor.default-dispatcher-6] INFO  com.daml.http.LedgerClient - Attempting to connect to the ledger localhost:6865 (600 attempts), context: {instance_uuid: "262efb2f-c2df-4e45-85ea-b135ec6612f9"} 
    2025-01-23 22:47:21.224 [http-json-ledger-api-pekko.actor.default-dispatcher-6] INFO  com.daml.http.LedgerClient - Attempt 1/600 succeeded!, context: {instance_uuid: "262efb2f-c2df-4e45-85ea-b135ec6612f9"} 
    2025-01-23 22:47:21.225 [http-json-ledger-api-pekko.actor.default-dispatcher-6] INFO  com.daml.http.HttpService - contractDao: None, context: {instance_uuid: "262efb2f-c2df-4e45-85ea-b135ec6612f9"} 
    2025-01-23 22:47:22.065 [http-json-ledger-api-pekko.actor.default-dispatcher-7] INFO  com.daml.http.Main - Started server: (ServerBinding(/127.0.0.1:7575),None), context: {instance_uuid: "262efb2f-c2df-4e45-85ea-b135ec6612f9"} 
    2025-01-23 22:47:22.798 [http-json-ledger-api-pekko.actor.default-dispatcher-6] INFO  com.daml.http.Endpoints - Incoming GET request on http://localhost:7575/readyz from unknown, context: {instance_uuid: "262efb2f-c2df-4e45-85ea-b135ec6612f9", request_id: "3aa39c43-9cfe-48a2-8115-3f87b75c1e63"} 
    2025-01-23 22:47:22.811 [http-json-ledger-api-pekko.actor.default-dispatcher-6] INFO  com.daml.http.Endpoints - Responding to client with HTTP 200 OK, context: {instance_uuid: "262efb2f-c2df-4e45-85ea-b135ec6612f9", request_id: "3aa39c43-9cfe-48a2-8115-3f87b75c1e63"} 
    .......
    Press 'r' to re-build and upload the package to the sandbox.
    Press 'Ctrl-C' to quit.
    

Before installing the Java JDK I was getting the same error, “Port file was not written to ‘/tmp/extra-dir-xxxxxxxxx/sandbox-portfile’”

2 Likes

That did work! Thanks for the support!