canton-network-docs
Daml Error Codes
Daml Error Codes - Canton Network Docs
Skip to main content
Cause: A function argument or binding has the wrong type. Common cases include passing a
Cause: You created a record or template instance without supplying all required fields.
Fix: Add the missing field to your record construction. If you recently added a field to a template, update all call sites.
Cause: A Smart Contract Upgrade compatibility check failed. SCU requires that new package versions are wire-compatible with previous versions. You cannot remove fields, change field types, or reorder fields.
Fix: Add new optional fields (with defaults) instead of modifying existing ones. If you need a fundamentally different structure, create a new template and migrate contracts explicitly.
Cause: Your code uses
Cause: The submitted command is malformed or violates a precondition. Sub-causes include:
Cause: The contract has already been archived (consumed by a previous exercise), or it was never visible to the submitting party.
Fix: Query the active contract set (ACS) to confirm the contract still exists before exercising. Implement a fetch-then-exercise pattern or handle this error with a retry that re-fetches the current contract ID.
Cause: You attempted to create a contract whose key matches an already-active contract. Daml enforces key uniqueness per template within a party’s visibility.
Fix: Check for existing contracts with the same key before creating. Use
Cause: A concurrent transaction consumed the contract between your read and your exercise. This is normal in concurrent environments.
Fix: Retry the operation with exponential backoff. See Development Issues for a retry pattern.
This page lists error codes you are most likely to encounter during Canton Network application development, grouped by where they originate. Each entry includes the error message, its typical cause, and how to resolve it.Documentation Index
Fetch the complete documentation index at: https://docs.canton.network/llms.txt
Use this file to discover all available pages before exploring further.
Daml Compilation Errors
These errors appear when you rundpm build or compile Daml sources.
Type mismatch
ContractId T where T is expected (use fetch), or passing Text where Party is expected.
Fix: Check the type signatures of the function you are calling. Use fetch to convert a ContractId to its payload, or getParty to convert a Text to a Party in Daml Script.
Missing field in record
SCU compatibility violation
Deprecated exceptions warning
exception declarations or try/catch blocks.
Fix: Replace exception-based error handling with Either, Optional, or explicit error contract patterns. Daml exceptions are deprecated and will be removed in a future release.
Runtime Errors
These errors occur when transactions are submitted to a running Canton validator.INVALID_ARGUMENT
- Missing required fields in a create or exercise command
- Invalid party identifier format
- Referencing a template that does not exist in the uploaded packages
NOT_FOUND
ALREADY_EXISTS
lookupByKey in Daml or query the ACS via the Ledger API. If you want to replace the existing contract, archive it first.