Error while trying to run the Daml Finance app

This is the error message. The dar size is under 4 MB. Am I doing something wrong?

gyorgybalazsi@BGY daml-finance-app % daml start

2022-10-28 07:54:58.25 [INFO]  [build] 
Compiling daml-finance-app to a DAR.
File:     src/daml/Daml/Finance/Setup/Scenario/BondIssuance.daml
Hidden:   no
Range:    33:1-33:4
Source:   Core to Daml-LF
Severity: DsWarning
Message:  Used tuple of size > 5! Daml only has Show, Eq, Ord instances for tuples of size <= 5.
File:     src/daml/Daml/Finance/Setup/Scenario/CorporateActions.daml
Hidden:   no
Range:    25:1-25:4
Source:   Core to Daml-LF
Severity: DsWarning
Message:  Used tuple of size > 5! Daml only has Show, Eq, Ord instances for tuples of size <= 5.
File:     src/daml/Daml/Finance/Setup/Scenario/Default.daml
Hidden:   no
Range:    24:1-24:4
Source:   Core to Daml-LF
Severity: DsWarning
Message:  Used tuple of size > 5! Daml only has Show, Eq, Ord instances for tuples of size <= 5.
File:     src/daml/Daml/Finance/Setup/Scenario/NaturalGas.daml
Hidden:   no
Range:    24:1-24:4
Source:   Core to Daml-LF
Severity: DsWarning
Message:  Used tuple of size > 5! Daml only has Show, Eq, Ord instances for tuples of size <= 5.
File:     src/daml/Daml/Finance/Setup/Scenario/SecuritiesLending.daml
Hidden:   no
Range:    25:1-25:4
Source:   Core to Daml-LF
Severity: DsWarning
Message:  Used tuple of size > 5! Daml only has Show, Eq, Ord instances for tuples of size <= 5.
File:     src/daml/Daml/Finance/Setup/Scenario/StructuredNotes.daml
Hidden:   no
Range:    27:1-27:4
Source:   Core to Daml-LF
Severity: DsWarning
Message:  Used tuple of size > 5! Daml only has Show, Eq, Ord instances for tuples of size <= 5.
File:     src/daml/Daml/Finance/Setup/Scenario/OtcSwaps.daml
Hidden:   no
Range:    24:1-24:4
Source:   Core to Daml-LF
Severity: DsWarning
Message:  Used tuple of size > 5! Daml only has Show, Eq, Ord instances for tuples of size <= 5.

2022-10-28 07:55:20.25 [INFO]  [build] 
Created .daml/dist/daml-finance-app-0.1.5.dar
Generating 057eed1fd48c238491b8ea06b9b5bf85a5d4c9275dd3f6183e0e6b01730cc2ba
Generating 0ff9f4c2940ffdd68b2a69853ba1fd7bf9869c9f31668a61f70d47a59dd3c750
Generating 1ffc484f012553b89cdbe4b809d95451340d83d3ccdab9761acfc7d0c8d80b49
Generating 2479213b3c10995a94c95d1dcbdcbb037040bca6a647ed9df9e598e6f1de9cb5
Generating 2b3c8d6d268e0397af000a50cd7736dd2f2ab4ab67b42ab85545921a0ae97013
Generating 38e6274601b21d7202bb995bc5ec147decda5a01b68d57dda422425038772af7
Generating 39fbac362936020fd255e17ca7caa1d13405840c6815c29c7d02a2401e2d908b
Generating 3e1b25762def28ff092e05e35e15d50e62fe444ce4bda7c59c3bce70019e25a9
Generating 3ec6b2817bc7245082f40b607ca426560ee9a3aa171eee60e57e412c97008193
Generating 3f4deaf145a15cdcfa762c058005e2edb9baa75bb7f95a4f8f6f937378e86415
Generating 40f452260bef3f29dede136108fc08a88d5a5250310281067087da6f0baddff7
Generating 412c6a4b9f09b267e8c19c7191c5d3a2823e46c35b2b261c9f993d7c377f7723
Generating 43766a6db23a1a25428994d0b7b628c921e951e18186265b776639a642846e73
Generating 4ad76bc137d2a40a27af1631f7f4db4710e7b961619d2ab737acd8f471a4d822
Generating 4d56eb0ec62d2c3c1f5604c30eb4cdd07ede184053d5d3c4ca3eade58d7ffbc9
Generating 518032f41fd0175461b35ae0c9691e08b4aea55e62915f8360af2cc7a1f2ba6c
Generating 640abf5ad8b207da02873d5b75308ea6cf21226906a4a4c7cb7439cbbcf0b148
Generating 6839a6d3d430c569b2425e9391717b44ca324b88ba621d597778811b2d05031d
Generating 6aeda87b065fb3858691f37979ca982a879082d6cd66a49cb6c96f1c908b231f
Generating 6c2c0667393c5f92f1885163068cd31800d2264eb088eb6fc740e11241b2bf06
Generating 717fb8b9bf56f806b9f48212481608d8239faf90c023fb4df5f4960ef1bc0bfb
Generating 733e38d36a2759688a4b2c4cec69d48e7b55ecc8dedc8067b815926c917a182a
Generating 76bf0fd12bd945762a01f8fc5bbcdfa4d0ff20f8762af490f8f41d6237c6524f
Generating 83760e1459a5dbba4a4c913d0c8319926434ce51c630936cbf441d552341729c
Generating 86828b9843465f419db1ef8a8ee741d1eef645df02375ebf509cdc8c3ddd16cb
Generating 8a7806365bbd98d88b4c13832ebfa305f6abaeaf32cfa2b7dd25c4fa489b79fb
Generating 8c0760bb7d7542ff32700f6faecbcb132258b192662d3b378248087e1f79bbe3
Generating 97b883cd8a2b7f49f90d5d39c981cf6e110cf1f1c64427a28a6d58ec88c43657
Generating 99a2705ed38c1c26cbb8fe7acf36bbf626668e167a33335de932599219e0a235
Generating 9b8afb7ea143f2c440cdc5d3e5c8e8093f7861c2f7284c784b2393013bb99430
Generating 9e601027463038ed3146ac103b118d7a6ade8c67d3f618e764011d3a85bd46f7
Generating a029347f8b59a3dad2ac901def9767a608c88ede4fce7bcd67da406784f50975
Generating a389340273a0dee2ebfbd64e15446add5d87719f910da325a2d9c6c537dceb41
Generating a54ec161ba3a433ae6c6db57a0b32a367c1c418a642eb8109e858dd1740cb615
Generating b2510971b84513b195bd1c0c1c2795de02f9617502f34f51a2134e6b4fec7dc9
Generating b76c39513d2b3214a4c507c55c719e36a35b88a33be9d36b884dda147c8e6618
Generating b8f94a59c7b050ef54616142e434b742e5bbc64af8112fef3459ca2dbcd7b92f
Generating bd27295b88fcfe7f437fc36b0dfd636ff071cbcb259f564d11803241642af979
Generating bfcd37bd6b84768e86e432f5f6c33e25d9e7724a9d42e33875ff74f6348e733f
Generating c1f1f00558799eec139fb4f4c76f95fb52fa1837a5dd29600baa1c8ed1bdccfd
Generating cb0552debf219cc909f51cbb5c3b41e9981d39f8f645b1f35e2ef5be2e0b858a
Generating cc348d369011362a5190fe96dd1f0dfbc697fdfd10e382b9e9666f0da05961b7
Generating d14e08374fc7197d6a0de468c968ae8ba3aadbf9315476fd39071831f5923662
Generating d58cf9939847921b2aab78eaa7b427dc4c649d25e6bee3c749ace4c3f52f5c97
Generating e22bce619ae24ca3b8e6519281cb5a33b64b3190cc763248b4c3f9ad5087a92c
Generating e491352788e56ca4603acc411ffe1a49fefd76ed8b163af86cf5ee5f4c38645b
Generating daml-finance-app-0.1.5 (hash: e53c14679c7c89367a684cb27da300f17b8562ab7ba0eeba470ac56ca86302e0)
Generating e56aa55b074e9725dac26d56ef3c459e900bfb1899edbade77a309c9ea105529
Generating e859603e3efb92088690f3dec49cb32dc178b8c6afe7429701fd4d7de7888091
Generating ec452403d539fc8a7144d2e62f21ef2122ddaec8bcaa170ff28501d481e82837
Generating f0789e1fc62ba42365e93f7a7a048ec5c3009a0c42c9d7a7716e1c29674c8ad3
Generating f0f1110b48416e0b68277578d8a9adbd04a3dc838a9fb94d9309763e845d9c2a
Generating f20de1e4e37b92280264c08bf15eca0be0bc5babd7a7b5e574997f154c00cb78
Generating f2c210ae63ad3506fb49e71f244f3a1309064a318e1e391d4df21f6f460ce411
Generating f2f29dcb345ac64031dcf0c5eba474899b27cf2334dd21e7cb246be350072e4b
Generating f97419d8040e23e85384cc129e954a3fe7244f14b883e12d776fce487001545b
Waiting for canton sandbox to start.
Uploading .daml/dist/daml-finance-app-0.1.5.dar to localhost:6865
An exception was thrown during the upload-dar command
- GRPCIOBadStatusCode StatusDeadlineExceeded (StatusDetails {unStatusDetails = "Deadline Exceeded"})
One reason for this to occur is if the size of DAR file being uploaded exceeds the gRPC maximum message size. The default value for this is 4Mb, but it may be increased when the ledger is (re)started. Please check with your ledger operator.

2022-10-28 09:56:03,965 [canton-env-execution-context-91] WARN  c.d.l.c.s.c.CommandTrackerFlow$ - Completion Stream failed with an error. Trying to recover in 1 second...
2022-10-28 09:56:03,967 [canton-env-execution-context-19] WARN  c.d.l.c.s.c.CommandTrackerFlow$ - Completion Stream failed with an error. Trying to recover in 1 second...
2022-10-28 09:56:03,973 [canton-env-execution-context-22] WARN  c.d.c.p.a.AdminWorkflowServices:participant=sandbox - ledger subscription for admin service [com.digitalasset.canton.participant.admin.PingService@2644a8bb] has completed with error
io.grpc.StatusRuntimeException: UNAVAILABLE: Channel shutdownNow invoked
        at io.grpc.Status.asRuntimeException(Status.java:535)
        at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:479)
        at io.opentelemetry.instrumentation.grpc.v1_6.TracingClientInterceptor$TracingClientCall$TracingClientCallListener.onClose(TracingClientInterceptor.java:161)
        at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:562)
        at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:743)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:722)
        at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
        at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
gyorgybalazsi@BGY daml-finance-app % 
2 Likes

It’s probably not a size issue; the error message just says that’s a frequent one.

I’m unable to reproduce at the moment (i.e. daml start works as expected for me); can you share your OS and JVM versions?

If you have Nix available, can you try running the project using its nix-shell definition?

It would be great if you could share the log file from log/canton.log.

OS is macOS Monterey. Java version:

openjdk 11.0.9 2020-10-20

OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.9+11)

OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.9+11, mixed mode)

Here is the Canton log: canton.log.zip - Google Drive
The Canton error log file is empty.

Hm I don’t see anything off in there. Can you reproduce that when you start Sandbox manually and then run daml ledger upload-dar?

Yes, in this way it seems to be clear what the error is, it’s related to the experimental DALF version, but I don’t know how to resolve this and why other people don’t have this problem.

gyorgybalazsi@BGY daml-finance-app % daml ledger upload-dar .daml/dist/daml-finance-app-0.1.5.dar
Uploading .daml/dist/daml-finance-app-0.1.5.dar to localhost:6865
upload-dar did not succeed: "\"ALLOWED_LANGUAGE_VERSIONS(8,f1bf84c9): Disallowed language version in package bd27295b88fcfe7f437fc36b0dfd636ff071cbcb259f564d11803241642af979: Expected version between 1.14 and 1.14 but got 1.15\""

The daml.yaml file contains this option:

build-options:
  - --target=1.15

build-options only means the compiler will target that LF version. It does not change the allowed LF versions on the ledger (Sandbox in your example). Take a look at the daml-finance example app for how they configure it:

Ok, I’m trying to run exactly this app, with exactly those configs which are in the code downloaded from Github.

Are you running it via daml start or daml sandbox? Daml start should work. For daml sandbox you need to specify the config when starting up, it does not look at sandbox-options. So in this example:

daml sandbox -c canton.conf
1 Like

Originally I ran it with daml start and got the error mentioned at the start of this thread.

Now that I have separated the steps as you recommended, so far it seems to work:

gyorgybalazsi@BGY daml-finance-app % daml sandbox -c canton.conf
Starting Canton sandbox.
Listening at port 6865
Canton sandbox is ready.
2022-11-02 10:58:23,874 [canton-env-scheduler-0] WARN  c.d.c.c.ExecutionContextMonitor - Task runner canton-env-execution-context is stuck or overloaded. My scheduled task has not been processed for at least 3 seconds (queue-size=7).
ForkJoinIdlenessExecutorService-canton-env-execution-context: java.util.concurrent.ForkJoinPool@35b9ac33[Running, parallelism = 8, size = 13, active = 10, running = 10, steals = 5054, tasks = 221, submissions = 7]
2022-11-02 10:58:27,790 [canton-env-execution-context-26] WARN  c.d.c.c.ExecutionContextMonitor - Task runner canton-env-execution-context is just overloaded, but operating correctly. Task got executed in the meantime.
2022-11-02 10:58:28,949 [timer-utils] WARN  c.d.p.i.InMemoryStateUpdaterFlow - Package Metadata View live update did not finish in 1000ms, context: {participant: "sandbox"}
gyorgybalazsi@BGY daml-finance-app % daml ledger upload-dar .daml/dist/daml-finance-app-0.1.5.dar
Uploading .daml/dist/daml-finance-app-0.1.5.dar to localhost:6865
DAR upload succeeded.

Now the question remains why it didn’t work with daml start.

Can you still reproduce with daml start?

The only thing that I can imagine here is that it’s resource constraints, in that daml start requires eg. more memory and therefore the Canton sandbox takes too long or isn’t able to upload the DAR. What specs are you running this on?

This is my setup. Your application seems to be very resource-hungry, when I managed to start it by separating the steps, th UI was practically unresponsive.