How do I resolve request time out for DAML Script?

Hi all!

I’m trying to run a script to set init data on our test ledger using postgres for storage, and using authentication.

The script seems to start fine, it reads the access token, it definitely allocates new parties on to the ledger, but then I get time out before any contracts are created. When using the DAML sandbox with the script added in the daml.yaml file the script works fine, so I’m not sure if it’s really script issue or an issue with the ledger configuration.

Would appreciate your advice!

1 Like

Hi @lashenhurst, could you share the full error message you receive?

1 Like
Exception in thread "main" io.grpc.StatusRuntimeException: ABORTED: Request timed out
        at io.grpc.Status.asRuntimeException(Status.java:533)
        at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:501)
        at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
        at io.grpc.internal.ClientCallImpl.access$500(ClientCallImpl.java:66)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:689)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$900(ClientCallImpl.java:577)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:751)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:740)
        at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
        at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
1 Like

Hm, afaik Daml Script does not configure any custom deadlines and gRPC does not have any deadlines enabled by default so the two cases you can get timeouts are the following:

  1. Network issues which will eventually timeout keepalive requests.
  2. Server side timeouts. Those used to exist primarily around party allocation and package management (only the former being relevant for Daml Script. On some ledgers like Fabric, those operations used to run into the fixed 30s timeout fairly frequently. The timeout has since been increased but I’m not sure if those changes have been propagated to all ledgers. If I understand you correctly you’re running the Daml Driver for PostgreSQL which should not run into those issues usually.

Do you know which operation is timing out exactly? Starting from today’s 1.12 snapshot (released in a few hours), you should get the daml source location that failed. For older versions of Daml Script, you can try to narrow it down with debug statements.

1 Like

Thanks for that info. After a bit of digging and asking around it does seem to be a network issue. Apparently our IT team has some odd notions around network security and integrity being more important than developing DAML apps.

Fortunately the script wasn’t very complicated so it’s not too tough to do manually until something smoother is sorted out.

Thanks again!