canton-troubleshooting
Installation
SKILL.md
Canton Troubleshooting & Error Codes
Overview
Canton errors come from three layers: Daml compilation (dpm build), the Canton runtime (transaction submission), and the Ledger API (auth/packages/parties). Knowing the layer points you at the fix.
Compile-time (dpm build)
| Error | Cause | Fix |
|---|---|---|
Couldn't match expected type 'X' with actual type 'Y' |
Wrong type — e.g. a ContractId T where T is expected, or Text where Party is expected |
fetch a ContractId to its payload; getParty to make a Party in Script |
Fields not initialised: 'fieldName' |
Created a record/template without all fields | Supply the field; after adding a template field, update all call sites |
Upgrade check failed: field 'X' changed type from 'A' to 'B' |
SCU compatibility violation — can't remove/retype/reorder fields | Add optional fields instead; for incompatible changes, a new template + explicit migration (canton-smart-contract-upgrades) |
warning: Daml exceptions are deprecated |
exception / try-catch usage |
Use Either/Optional/explicit error-contract patterns — Daml exceptions are deprecated |