Error: Failed to look up template (Make sure your @daml/types version agrees with the used Daml SDK version.)

When playing with the CBDC UI, every await ledger.exercise calls throw similar to this:

Error: Failed to look up template c334f46f934d9633747c1ab4dc1fc3a947b74aa948a4dfc5ad0bea6639e7266d:DA.Finance.Asset:AssetDeposit. Make sure your @daml/types version agrees with the used Daml SDK version.

I tried to make sure, it agrees imho. I even tried latest SDK snapshot.
(Easy to reproduce, just start playing with it, or follow the README.)
Can anyone suggest any hint where to look?

I also see in the console that the template was registered. The template Id looks correct.

1 Like

Hi @Richard_Kapolnai,
I just tried to reproduce this and I failed to do so. Can you reproduce this on a fresh clone?

My guess would be that somehow your npm/yarn setups are out of date so try deleting node_modules and yarn.lock/npm.lock.

2 Likes

I can reproduce on a fresh clone, following the README (make build, launch 4 scripts, then launchers/populate), then issued money to myself, and bang, the exception is there.

I’m on Ubuntu 20.04, npm 6.14, node 14.17.

1 Like

I have a newer npm and node but I would be surprised if that’s the difference:

moritz@adjunction ~> npm --version
7.7.6
moritz@adjunction ~> node --version
v15.14.0
1 Like

tried those versions too, still see the beautiful exception.

1 Like

I wanted to try to reproduce, but all I got was:

$ make build
Error: unknown command "./landlord/daml.yaml" for "yq"
Run 'yq --help' for usage.
daml.mk:15: *** shell command failed.  Stop.
$

As a blind guess, given the error message, I would assume that the DAR files have not been deployed to the sandbox, but I can’t investigate myself given the project doesn’t build.

2 Likes

@Gary_Verhaegen I got the same, there are two yqs. You need the one from pypi in version 2.12.0 (or something close to that at least). There is another one from somewhere (which I got from ubuntu repos) which has version 4.x and produced the same error.

2 Likes

Homebrew seems to have two options for yq: a package called yq, and another one called python-yq. With that second one, I get a different error message:

$ yq --version
yq 2.12.0
$ make build     
daml.mk:15: *** shell command failed.  Stop.
$

I’ll just stick to my recommendation to check the packages the sandbox knows about.

1 Like

After another debugging session with @Richard_Kapolnai, we got it to work after cleaning the lock file. Specifically delete the following 3:

  1. package-lock.json
  2. node_modules
  3. The typescript code generated by the codegen.
2 Likes