Steffan
Steffan

Reputation: 63

Issue updating state on re-deployed Corda Enterprise App

I have encountered an issue when re-deploying a Corda Enterprise app after changing some ledger code and trying to update a state created by the old deployment. Initially I encountered a Notary issue caused by the following TransactionBuilder constraint:

    require(notary == this.notary) { "Input state requires notary \"$notary\" which does not match the transaction notary \"${this.notary}\"."

This was solved by using the NotaryChangeFlow. An example of my usage is below:

        val inputNotary = inputState.state.notary
        if(inputNotary != newNotary) {
            subFlow(NotaryChangeFlow(inputState, newNotary))
        }

However, I am now getting the error:

java.lang.IllegalArgumentException: Don't know about O=Party, L=Sydney, C=AU
at net.corda.node.services.statemachine.FlowMessagingImpl.sendSessionMessage(FlowMessaging.kt:65) ~[corda-node-3.1.jar:?]
at net.corda.node.services.statemachine.ActionExecutorImpl.executeSendInitial(ActionExecutorImpl.kt:177) [corda-node-3.1.jar:?]
at net.corda.node.services.statemachine.ActionExecutorImpl.executeAction(ActionExecutorImpl.kt:75) [corda-node-3.1.jar:?]
at net.corda.node.services.statemachine.interceptors.MetricActionInterceptor.executeAction(MetricInterceptor.kt:31) [corda-node-3.1.jar:?]
at net.corda.node.services.statemachine.TransitionExecutorImpl.executeTransition(TransitionExecutorImpl.kt:51) [corda-node-3.1.jar:?]
at net.corda.node.services.statemachine.interceptors.HospitalisingInterceptor.executeTransition(HospitalisingInterceptor.kt:54) [corda-node-3.1.jar:?]
at net.corda.node.services.statemachine.interceptors.DumpHistoryOnErrorInterceptor.executeTransition(DumpHistoryOnErrorInterceptor.kt:46) [corda-node-3.1.jar:?]
at net.corda.node.services.statemachine.interceptors.MetricInterceptor.executeTransition(MetricInterceptor.kt:23) [corda-node-3.1.jar:?]
at net.corda.node.services.statemachine.interceptors.FiberDeserializationCheckingInterceptor.executeTransition(FiberDeserializationCheckingInterceptor.kt:50) [corda-node-3.1.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.processEvent(FlowStateMachineImpl.kt:133) [corda-node-3.1.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.processEventsUntilFlowIsResumed(FlowStateMachineImpl.kt:162) [corda-node-3.1.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.suspend(FlowStateMachineImpl.kt:396) [corda-node-3.1.jar:?]
at net.corda.node.services.statemachine.FlowSessionImpl.sendAndReceive(FlowSessionImpl.kt:64) [corda-node-3.1.jar:?]
at net.corda.node.services.statemachine.FlowSessionImpl.sendAndReceive(FlowSessionImpl.kt:71) [corda-node-3.1.jar:?]
at net.corda.core.flows.DataVendingFlow.sendPayloadAndReceiveDataRequest(SendTransactionFlow.kt:81) [corda-core-3.1.jar:?]
at net.corda.core.flows.DataVendingFlow.call(SendTransactionFlow.kt:59) [corda-core-3.1.jar:?]
at net.corda.core.flows.DataVendingFlow.call(SendTransactionFlow.kt:42) [corda-core-3.1.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.subFlow(FlowStateMachineImpl.kt:281) [corda-node-3.1.jar:?]
at net.corda.core.flows.FlowLogic.subFlow(FlowLogic.kt:312) [corda-core-3.1.jar:?]
at net.corda.core.flows.AbstractStateReplacementFlow$Instigator.getParticipantSignature(AbstractStateReplacementFlow.kt:118) [corda-core-3.1.jar:?]
at net.corda.core.flows.AbstractStateReplacementFlow$Instigator.collectSignatures(AbstractStateReplacementFlow.kt:102) [corda-core-3.1.jar:?]
at net.corda.core.flows.AbstractStateReplacementFlow$Instigator.call(AbstractStateReplacementFlow.kt:78) [corda-core-3.1.jar:?]
at net.corda.core.flows.AbstractStateReplacementFlow$Instigator.call(AbstractStateReplacementFlow.kt:60) [corda-core-3.1.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.subFlow(FlowStateMachineImpl.kt:281) [corda-node-3.1.jar:?]
at net.corda.core.flows.FlowLogic.subFlow(FlowLogic.kt:312) [corda-core-3.1.jar:?]
at com.administration.ledger.flow.MemberUpdateFlow$Initiator.call(MemberFlow.kt:104) [administration-ledger-0.1.jar:0.1]
at com.administration.ledger.flow.MemberUpdateFlow$Initiator.call(MemberFlow.kt:80) [administration-ledger-0.1.jar:0.1]
at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:225) [corda-node-3.1.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:51) [corda-node-3.1.jar:?]
at co.paralleluniverse.fibers.Fiber.run1(Fiber.java:1092) [quasar-core-0.7.10-jdk8.jar:0.7.10]
at co.paralleluniverse.fibers.Fiber.exec(Fiber.java:788) [quasar-core-0.7.10-jdk8.jar:0.7.10]
at co.paralleluniverse.fibers.RunnableFiberTask.doExec(RunnableFiberTask.java:100) [quasar-core-0.7.10-jdk8.jar:0.7.10]
at co.paralleluniverse.fibers.RunnableFiberTask.run(RunnableFiberTask.java:91) [quasar-core-0.7.10-jdk8.jar:0.7.10]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.22.Final.jar:4.1.22.Final]

I was wondering if anyone has seen this error before / knows what could be causing it. It seems related to the transaction referencing the original O=Party, L=Sydney, C=AU Party which was a participant in the initial state creation. This Flow worked fine in Corda OS but is causing problems after migrating to Enterprise.

Upvotes: 2

Views: 235

Answers (1)

Joel
Joel

Reputation: 23140

You say in your comment above:

Just confirming the ./gradlew deployNodes command is the correct one to re-deploy nodes after changes are made

This is incorrect. Re-running deployNodes will create a new set of nodes with a new set of certificates. This is why you're getting exceptions of the form java.lang.IllegalArgumentException: Don't know about O=Party, L=Sydney, C=AU.

You should update the CorDapp using the following process instead:

  • Put the node in flow-drain mode, as per the instructions here
  • Once flow-drain is complete, turn off the node
  • Build the new CorDapp JAR by following the instructions here
  • Install the new CorDapp JAR by following the instructions here
  • Restart the node

Upvotes: 1

Related Questions