Needs help on Error: Invalid dar file: CdmSwaps-1.0.0.dar

Hello all,

Implement what I understand is now an outdated ex-cdm-swaps module but getting errors that the dar file is
Error: Invalid dar file: CdmSwaps-1.0.0.dar

Running on Centos 7 Google Cloud VM Instance

The repository example is here

It is for my financial engineering and I need the platform running in hours. I will appreciate any help

Could the conflict be with the newer sdk installed against the one the example references.

How can i roll the sdk back to the appropriate one.

Thanks

Best Regards,

1 Like

As long as you haven’t change the sdk-version in the daml.yaml things should still work.

At which step are you getting the error? The readme tells you to run daml sandbox .daml/dist/CdmSwaps-1.0.0.dar. It looks like you might be running daml sandbox CdmSwaps-1.0.0.dar without the proper path or you have forgotten the daml build step before that.

Thanks Moritz for coming in.

I did the daml build and the sbt compile before that.

I did the right path.

I got the error at the daml sandbox .daml/dist/CdmSwaps-1.0.0.dar step

Thanks

Best Regards,

Olusegun

I’ve just cloned the repository and tried daml build followed by daml sandbox .daml/dist/CdmSwaps-1.0.0.dar and it seems to work for me. Are you sure you did not modify the daml.yaml file?

What output do you get from daml build? You should be getting something like

Compiling CdmSwaps to a DAR.
Created .daml/dist/CdmSwaps-1.0.0.dar.

Hello Moritz,

I did not change the yaml file

Could i run the build commands again.

I remember i had a warning with sbt compile stage .Here…

[olusegun_oluwajebe_wqu@group22 app]$ sbt compile
[info] Loading project definition from /home/olusegun_oluwajebe_wqu/wqu/ex-cdm-swaps/app/project
[info] Loading settings for project app from build.sbt ...
[info] Set current project to CdmSwaps (in build file:/home/olusegun_oluwajebe_wqu/wqu/ex-cdm-swaps/app/)
[info] Executing in batch mode. For better performance use sbt's shell
[warn] Credentials file /home/olusegun_oluwajebe_wqu/.sbt/.credentials.bintray does not exist
[success] Total time: 2 s, completed May 12, 2020 6:09:24 PM
1 Like

The sbt compile step doesn’t matter. If sandbox is throwing an error I need to see the full output of the daml build step and of the daml sandbox .daml/dist/CdmSwaps-1.0.0.dar step.

Here is it Moritz,

[olusegun_oluwajebe_wqu@group22 app]$ daml sandbox .daml/dist/CdmSwaps-1.0.0.dar
DAML SDK 1.0.1 has been released!
See https://github.com/digital-asset/daml/releases/tag/v1.0.1 for details.
Error: Invalid dar file: CdmSwaps-1.0.0.dar
Try --help for more information.
daml-helper: Received ExitFailure 1 when running
Raw command: java -jar /home/olusegun_oluwajebe_wqu/.daml/sdk/0.13.22/sandbox/sandbox.jar .daml/dist/CdmSwaps-1.
0.0.dar

Can you please also show us the output of daml build.

Here Moritz,

[olusegun_oluwajebe_wqu@group22 ex-cdm-swaps]$ daml build
DAML SDK 1.0.1 has been released!
See https://github.com/digital-asset/daml/releases/tag/v1.0.1 for details.
Compiling CdmSwaps to a DAR.
Created .daml/dist/CdmSwaps-1.0.0.dar.

Hm that looks fine. Can you run ls -l .daml/dist from the same directory where you are running daml sandbox from?

I got this,

[olusegun_oluwajebe_wqu@group22 app]$ ls -l .daml/dist
ls: cannot access .daml/dist: No such file or directory

Are you sure you are running daml build and daml sandbox frm the same directory? daml build will create .daml/dist. If you cannot find it with ls it sounds like you might be in a different directory. You should run both commands from the root directory of the project.

1 Like

am i supposed to run the saml build from the app folder?

No you should run daml build as well as daml sandbox from the root directory, i.e., the one with the daml.yaml in it. The only command that you should run from app is sbt compile.

I just ran it from the project folder:

olusegun_oluwajebe_wqu@group22 ex-cdm-swaps]$ daml sandbox .daml/dist/CdmSwaps-1.0.0.dar
DAML SDK 1.0.1 has been released!
See https://github.com/digital-asset/daml/releases/tag/v1.0.1 for details.
Sandbox verbosity changed to INFO
/DAML LF Engine supports LF versions: 0, 0.dev, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.dev; Transaction versions: 
1, 2, 3, 4, 5, 6, 7, 8; Value versions: 1, 2, 3, 4, 5
Starting plainText server
listening on localhost:6865
   ____             ____
  / __/__ ____  ___/ / /  ___ __ __
 _\ \/ _ `/ _ \/ _  / _ \/ _ \\ \ /
/___/\_,_/_//_/\_,_/_.__/\___/_\_\
Initialized sandbox version 100.13.22 with ledger-id = sandbox-88d09319-cd73-4bbd-a4d9-53317ab1425b, port = 6865
, dar file = List(.daml/dist/CdmSwaps-1.0.0.dar), time mode = Static, ledger = in-memory, daml-engine = {}

That looks right! So is everything working properly now or do you have other issues?

Thanks.

I need to follow the other steps. I will get back.

This is wonderful support.

I really appreciate your kindness

Hello Moritz,

Got this when I ran the Navigator command

ince 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[da-ui-backend]
java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOfRange(Arrays.java:3664)
        at java.lang.String.<init>(String.java:207)
        at com.google.protobuf.Utf8$UnsafeProcessor.decodeUtf8(Utf8.java:1439)
        at com.google.protobuf.Utf8.decodeUtf8(Utf8.java:340)
        at com.google.protobuf.CodedInputStream$StreamDecoder.readStringRequireUtf8(CodedInputStream.java:2296)
        at com.digitalasset.daml_lf.DamlLf1$DottedName.<init>(DamlLf1.java:3394)
        at com.digitalasset.daml_lf.DamlLf1$DottedName.<init>(DamlLf1.java:3349)
        at com.digitalasset.daml_lf.DamlLf1$DottedName$1.parsePartialFrom(DamlLf1.java:3969)
        at com.digitalasset.daml_lf.DamlLf1$DottedName$1.parsePartialFrom(DamlLf1.java:3963)
        at com.google.protobuf.CodedInputStream$StreamDecoder.readMessage(CodedInputStream.java:2364)
        at com.digitalasset.daml_lf.DamlLf1$TypeConName.<init>(DamlLf1.java:5044)
        at com.digitalasset.daml_lf.DamlLf1$TypeConName.<init>(DamlLf1.java:4984)
        at com.digitalasset.daml_lf.DamlLf1$TypeConName$1.parsePartialFrom(DamlLf1.java:5837)
        at com.digitalasset.daml_lf.DamlLf1$TypeConName$1.parsePartialFrom(DamlLf1.java:5831)
        at com.google.protobuf.CodedInputStream$StreamDecoder.readMessage(CodedInputStream.java:2364)
        at com.digitalasset.daml_lf.DamlLf1$Type$Con.<init>(DamlLf1.java:15145)
        at com.digitalasset.daml_lf.DamlLf1$Type$Con.<init>(DamlLf1.java:15096)
        at com.digitalasset.daml_lf.DamlLf1$Type$Con$1.parsePartialFrom(DamlLf1.java:16158)
        at com.digitalasset.daml_lf.DamlLf1$Type$Con$1.parsePartialFrom(DamlLf1.java:16152)
        at com.google.protobuf.CodedInputStream$StreamDecoder.readMessage(CodedInputStream.java:2364)
        at com.digitalasset.daml_lf.DamlLf1$Type.<init>(DamlLf1.java:13825)
        at com.digitalasset.daml_lf.DamlLf1$Type.<init>(DamlLf1.java:13763)
        at com.digitalasset.daml_lf.DamlLf1$Type$1.parsePartialFrom(DamlLf1.java:22182)
        at com.digitalasset.daml_lf.DamlLf1$Type$1.parsePartialFrom(DamlLf1.java:22176)
        at com.google.protobuf.CodedInputStream$StreamDecoder.readMessage(CodedInputStream.java:2364)
        at com.digitalasset.daml_lf.DamlLf1$Type$Prim.<init>(DamlLf1.java:16309)
        at com.digitalasset.daml_lf.DamlLf1$Type$Prim.<init>(DamlLf1.java:16252)
        at com.digitalasset.daml_lf.DamlLf1$Type$Prim$1.parsePartialFrom(DamlLf1.java:17205)
        at com.digitalasset.daml_lf.DamlLf1$Type$Prim$1.parsePartialFrom(DamlLf1.java:17199)
        at com.google.protobuf.CodedInputStream$StreamDecoder.readMessage(CodedInputStream.java:2364)
        at com.digitalasset.daml_lf.DamlLf1$Type.<init>(DamlLf1.java:13839)
        at com.digitalasset.daml_lf.DamlLf1$Type.<init>(DamlLf1.java:13763)
daml-helper: Received ExitFailure 255 when running
Raw command: java -jar /home/olusegun_oluwajebe_wqu/.daml/sdk/0.13.22/navigator/navigator.jar server

I mean this:

Frontend running at [http://localhost:4000.](http://localhost:4000./)Uncaught error from thread [da-ui-backend-akka.actor.default-dispatcher-4]: Java heap space, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[da-ui-backend]
java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOfRange(Arrays.java:3664)
        at java.lang.String.<init>(String.java:207)
        at com.google.protobuf.Utf8$UnsafeProcessor.decodeUtf8(Utf8.java:1439)
        at com.google.protobuf.Utf8.decodeUtf8(Utf8.java:340)
        at com.google.protobuf.CodedInputStream$StreamDecoder.readStringRequireUtf8(CodedInputStream.java:2296)
        at com.digitalasset.daml_lf.DamlLf1$DottedName.<init>(DamlLf1.java:3394)
        at com.digitalasset.daml_lf.DamlLf1$DottedName.<init>(DamlLf1.java:3349)
        at com.digitalasset.daml_lf.DamlLf1$DottedName$1.parsePartialFrom(DamlLf1.java:3969)
        at com.digitalasset.daml_lf.DamlLf1$DottedName$1.parsePartialFrom(DamlLf1.java:3963)
        at com.google.protobuf.CodedInputStream$StreamDecoder.readMessage(CodedInputStream.java:2364)
        at com.digitalasset.daml_lf.DamlLf1$TypeConName.<init>(DamlLf1.java:5044)
        at com.digitalasset.daml_lf.DamlLf1$TypeConName.<init>(DamlLf1.java:4984)
        at com.digitalasset.daml_lf.DamlLf1$TypeConName$1.parsePartialFrom(DamlLf1.java:5837)
        at com.digitalasset.daml_lf.DamlLf1$TypeConName$1.parsePartialFrom(DamlLf1.java:5831)
        at com.google.protobuf.CodedInputStream$StreamDecoder.readMessage(CodedInputStream.java:2364)
        at com.digitalasset.daml_lf.DamlLf1$Type$Con.<init>(DamlLf1.java:15145)
        at com.digitalasset.daml_lf.DamlLf1$Type$Con.<init>(DamlLf1.java:15096)
        at com.digitalasset.daml_lf.DamlLf1$Type$Con$1.parsePartialFrom(DamlLf1.java:16158)
        at com.digitalasset.daml_lf.DamlLf1$Type$Con$1.parsePartialFrom(DamlLf1.java:16152)
        at com.google.protobuf.CodedInputStream$StreamDecoder.readMessage(CodedInputStream.java:2364)
        at com.digitalasset.daml_lf.DamlLf1$Type.<init>(DamlLf1.java:13825)
        at com.digitalasset.daml_lf.DamlLf1$Type.<init>(DamlLf1.java:13763)
        at com.digitalasset.daml_lf.DamlLf1$Type$1.parsePartialFrom(DamlLf1.java:22182)
        at com.digitalasset.daml_lf.DamlLf1$Type$1.parsePartialFrom(DamlLf1.java:22176)
        at com.google.protobuf.CodedInputStream$StreamDecoder.readMessage(CodedInputStream.java:2364)
        at com.digitalasset.daml_lf.DamlLf1$Type$Prim.<init>(DamlLf1.java:16309)
        at com.digitalasset.daml_lf.DamlLf1$Type$Prim.<init>(DamlLf1.java:16252)
        at com.digitalasset.daml_lf.DamlLf1$Type$Prim$1.parsePartialFrom(DamlLf1.java:17205)
        at com.digitalasset.daml_lf.DamlLf1$Type$Prim$1.parsePartialFrom(DamlLf1.java:17199)
        at com.google.protobuf.CodedInputStream$StreamDecoder.readMessage(CodedInputStream.java:2364)
        at com.digitalasset.daml_lf.DamlLf1$Type.<init>(DamlLf1.java:13839)
        at com.digitalasset.daml_lf.DamlLf1$Type.<init>(DamlLf1.java:13763)
daml-helper: Received ExitFailure 255 when running
Raw command: java -jar /home/olusegun_oluwajebe_wqu/.daml/sdk/0.13.22/navigator/navigator.jar server

That looks like you are just running out of memory. How much RAM do you have?