Getting more info out of `LOCAL_VERDICT` errors
Canton 2.6.0-rc2 (2.6.0-snapshot.20230222.11471.0.d1a33784) logs LOCAL_VERDICT_LOCKED_KEYS errors. The problem is, error message doesn’t reveal the key being locked:
2023-03-09 21:04:59.365 [input-mapping-pool-11] INFO c.d.p.i.p.ParallelIndexerSubscription - Storing Reject command 97ad7210-5d1d-4a50-a07f-046c56f3f1b2(): LOCAL_VERDICT_LOCKED_KEYS(2,3fc8dd8b): Rejected transaction is referring to locked keys , context: {participant: "myparticipant", offset: "0000000000000053ca", update: {rejectionReason: {code: 10, message: "LOCAL_VERDICT_LOCKED_KEYS(2,3fc8dd8b): Rejected transaction is referring to locked keys ", definiteAnswer: false}, deduplicationPeriod: {offset: "000000000000000001"}, recordTime: "2023-03-09T21:04:57.955461Z", applicationId: "example", submitter: ["Alice::(somelongpartyhash)"], commandId: "97ad7210-5d1d-4a50-a07f-046c56f3f1b2"}}
Is revealing the locked key a matter of some Canton logback configuration I’m not aware of?
How to manage this is described here:
- Troubleshooting Guide — Daml SDK 2.6.0 documentation (contention)
Specifically, the information at:
- Troubleshooting Guide — Daml SDK 2.6.0 documentation (how to find contention)
will help locate the command ID (using this you can then identify the template and choice) and the contract ID (in the ResourceInfo block that is also logged).
Thank you, Carl. Indeed, increasing log level to debug helped to find the locked contract key. It’s just a bit inconvenient to follow cross references. It seems as if LockedKeys.Reject already has knowledge about the locked contract key:
digital-asset/canton/blob/3d64f68770e5f3fbb9ccf8c198cd07f7a4c18bf0/community/common/src/main/scala/com/digitalasset/canton/protocol/messages/LocalVerdict.scala#L337-L354
- @Explanation(
- """The transaction is referring to locked keys which are in the process of being
- modified by another transaction."""
- )
- @Resolution("Retry the transaction")
- object LockedKeys
- extends LocalRejectErrorCode(
- id = "LOCAL_VERDICT_LOCKED_KEYS",
- ErrorCategory.ContentionOnSharedResources,
- v0.LocalReject.Code.LockedKeys,
- ) {
- case class Reject(override val _resources: Seq[String])(
- override val representativeProtocolVersion: RepresentativeProtocolVersion[LocalVerdict]
- ) extends LocalRejectImpl(
- _causePrefix = "Rejected transaction is referring to locked keys ",
- _resourcesType = Some(CantonErrorResource.ContractKey),
- )
- }
Makes me think if the log line in my original question is just incomplete and result of some small issue in canton logging code.
Hey!
We could probably include the global key: https://github.com/digital-asset/daml/blob/b5441712aa0b91b7f63b23dc51b40b9cd08914a2/daml-lf/transaction/src/main/scala/com/digitalasset/daml/lf/transaction/GlobalKey.scala#L13-L26
Would that help?
Raf
Hey Rafael,
GlobalKey would be perfect.
Thank you!
I created the issue. Should be shipped as part of 2.7
Hi sir, is this consider a bug fix ?