Unable to run script in Canton ledger


I am trying to run a Daml script in my canton ledger and I am getting this following error. The same script works fine with other kind of ledger. Any idea?

My script tries to create 2 parties and 2 smart contracts no more… :slightly_frowning_face:


Error: User abort: Submit failed with code 3: Command interpretation error in LF-DAMLe: Interpretation error: Error: Update failed due to precondition violation when creating Roles.PlatformAdminRole:PlatformAdminRole@3348ea84 with Roles.PlatformAdminRole:PlatformAdminRole@3348ea84{ platformAdmin = 'PlatformAdmin2::122007f0881e740c775e911f01c510a43ebb74ac59a527e550e40cb941eff52912c9' }. Details: Last location: [unknown source], partial transaction: <empty transaction>.
Exception in thread "main" com.daml.lf.speedy.SError$DamlEUserError
	at com.daml.lf.speedy.SBuiltin$SBError$.executePure(SBuiltin.scala:1398)
	at com.daml.lf.speedy.SBuiltinPure.execute(SBuiltin.scala:55)
	at com.daml.lf.speedy.Speedy$Machine.enterApplication(Speedy.scala:445)
	at com.daml.lf.speedy.SExpr$SEAppAtomicGeneral.execute(SExpr.scala:140)
	at com.daml.lf.speedy.Speedy$Machine.run(Speedy.scala:328)
	at com.daml.lf.engine.script.Runner.stepToValue$1(Runner.scala:346)
	at com.daml.lf.engine.script.Runner.run$1(Runner.scala:368)
	at com.daml.lf.engine.script.Runner.$anonfun$runWithClients$17(Runner.scala:429)
	at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307)
	at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
1 Like

Welcome to the forum @pierre.filliolaud, preconditions often refer to some property that is being enforced using the ensure keyword. Do you have any ensure assertions that are not being met on the Roles.PlatformAdminRole template?

If that doesn’t resolve the issue please provide a code sample that demonstrates the issue and we can help further.