Key/Module not available when deploying to DAML Hub

I get this error when deploying to DAML Hub while using daml-finance, other daml-finance modules are completely fine without having to do anything extra. Unpacking the dar that I’ve uploaded to DAML Hub shows that the DALF file for the missing module is there.

Exception in thread "main" com.daml.lf.engine.script.ScriptF$FailedCmd: Command submit failed: key not found: 4b5bf7a6465e5e11800a03c131a5759565edd3ff9cfc43f41d1f7fbc72255587:Daml.Finance.Interface.Settlement.Instruction:Instruction

Hi @dylan_obsidian ,

Is this a custom script you’ve written or one found with the daml-finance or reference app?

Can you confirm that the script runs correctly against a locally running ledger?


Hi @alex.graham, This is a custom script I’ve written. The script works fine when I run daml script against a local running ledger (via daml sandbox)

@dylan_obsidian -

Interesting. Do you mind sharing the script, or at least the section of the script where you believe the error is occurring? If you don’t feel comfortable sharing code, can you let us know which daml-finance templates and interfaces you’re using, and what choice/how you’re exercising it to help you debug this?


@alex.graham ~
The relevant code is

  instructionViews <- forA instructionCids $ \icid -> do
    iv <- submit borrower_alice $ exerciseCmd icid Instruction.GetView with viewer = user
    pure (icid, iv)

and Instruction is Daml.Finance.Interface.Settlement.Instruction
This is surrounded by debug and this is the exact spot where where it fails

Hi @dylan_obsidian,

There seems to be an incompatibility with interfaces and the JSON API that we’re looking into.

In the meantime, you can run daml script through the GRPC API instead by:

  1. Removing the https:// in the "host" fields of the participants.json file
  2. Removing --json-api and adding --tls to the daml script command

Let me know if that doesn’t work.

1 Like