We're updating the issue view to help you get more done. 

Unclear error message when receiving state from node on higher version of signed cordapp

Description

The fix here is to cleanup the error message and make it easier to read.

After following the steps below, the state is successfully sent by PartyA (which has the v2 cordapp) but fails to be recorded in PartyB (which has the v1 cordapp) - after investigation we believe this is the correct behaviour. However, the error message could be more helpful. Also, it could b eclearer that installing the upgraded cordapp will cause the state to be processed (which happens, I tested that scenario successfully).

1. Download TestNetwork.zip (from test template) and unzip into a directory.

2. Download the network bootstrapper for the version of corda under test and copy into the directory from:
https://ci-artifactory.corda.r3cev.com/artifactory/corda-releases/net/corda/corda-tools-network-bootstrapper/
or (for Enterprise)
https://ci-artifactory.corda.r3cev.com/artifactory/r3corda-releases/net/corda/corda-tools-network-bootstrapper/

3. Download the relevant finance-workflows cordapp for the version of corda under test and copy into the directory from:
https://ci-artifactory.corda.r3cev.com/artifactory/corda-releases/net/corda/corda-finance-workflows/
or (for Enterprise)
https://ci-artifactory.corda.r3cev.com/artifactory/r3-corda-releases/net/corda/corda-finance-workflows/

4. Download v1 of the attached (signed) finance contracts cordapp and place in the directory.

5. From unzipped directory run:
java -jar corda-tools-network-bootstrapper-xxxx.jar --network-parameter-overrides=network-parameters.conf

6. Edit Notary\node.conf, PartyA\node.conf, PartyB\node.conf and set devmode = false.

7. Start up the nodes with:
Notary: java -jar corda.jar
PartyA: java -jar corda.jar --sshd --sshd-port=22244
PartyB: java -jar corda.jar --sshd --sshd-port=22245

8. SSH into PartyA on port 22244, user: user1 password: test
>>ssh -o StrictHostKeyChecking=no user1@localhost -p 22244

9. Issue 10GBP of cash to yourself:
flow start CashIssueFlow amount: "10 GBP", issuerBankPartyRef: "1234" , notary: Notary

10. Stop PartyA.
Delete the V1 finance app from the cordapps directory and replace with the V2 (signed) finance cordapp.
Re-start PartyA: java corda.jar --sshd --sshd-port=22244

11. Pay 5GBP of cash to PartyB from PartyA
flow start CashPaymentFlow amount: "5 GBP", recipient: PartyB, anonymous: false

Flow completes successfully on PartyA.

On PartyB run:
run vaultQuery contractStateType: net.corda.finance.contracts.asset.Cash$State

There are no states in the vault, and there should be 5GBP from PartyA.

Error in PartyB is:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 [INFO ] 2019-01-28T15:02:25,535Z [Node thread-1] statemachine.StaffedFlowHospital.invoke - Flow [23b35647-23e1-4d43-a2f2-9c89e3baa8e7] has error [0] {fiber-id=10000001, flow-id=23b35647-23e1-4d43-a2f2-9c89e3baa8e7, invocation_id=40aff549-919d-4c03-9ee7-0ae32839ebe8, invocation_timestamp=2019-01-28T15:02:17.872Z, origin=O=PartyA, L=London, C=GB, session_id=40aff549-919d-4c03-9ee7-0ae32839ebe8, session_timestamp=2019-01-28T15:02:17.872Z, thread-id=200, tx_id=229B72BC7CA16A8ED2AB38F62610DE2D21D8CC358F7B78E90666CB899E75950E} net.corda.core.serialization.internal.UntrustedAttachmentsException: Attempting to load untrusted Contract Attachments: [07F11FD2764AFE1D841518F3855CDAD0CD681E60757B0D589D49E8E5ECA57AEC]These may have been received over the p2p network from a remote node.Please follow the operational steps outlined in https://docs.corda.net/cordapp-build-systems.html#cordapp-contract-attachments to continue. at net.corda.core.serialization.internal.AttachmentsClassLoader.<init>(AttachmentsClassLoader.kt:39) ~[corda-core-4.0-RC03.jar:?] at net.corda.core.serialization.internal.AttachmentsClassLoader.<init>(AttachmentsClassLoader.kt:33) ~[corda-core-4.0-RC03.jar:?] at net.corda.core.serialization.internal.AttachmentsClassLoaderBuilder$withAttachmentsClassloaderContext$serializationContext$1.apply(AttachmentsClassLoader.kt:197) ~[corda-core-4.0-RC03.jar:?] at net.corda.core.serialization.internal.AttachmentsClassLoaderBuilder$withAttachmentsClassloaderContext$serializationContext$1.apply(AttachmentsClassLoader.kt:185) ~[corda-core-4.0-RC03.jar:?] at java.util.HashMap.computeIfAbsent(HashMap.java:1127) ~[?:1.8.0_181] at net.corda.core.serialization.internal.AttachmentsClassLoaderBuilder.withAttachmentsClassloaderContext(AttachmentsClassLoader.kt:195) ~[corda-core-4.0-RC03.jar:?] at net.corda.core.transactions.LedgerTransaction.internalPrepareVerify$core(LedgerTransaction.kt:129) ~[corda-core-4.0-RC03.jar:?] at net.corda.core.internal.TransactionVerifierServiceInternalKt.prepareVerify(TransactionVerifierServiceInternal.kt:25) ~[corda-core-4.0-RC03.jar:?] at net.corda.node.services.transactions.InMemoryTransactionVerifierService$verify$$inlined$apply$lambda$1.invoke(InMemoryTransactionVerifierService.kt:19) ~[corda-node-4.0-RC03.jar:?] at net.corda.node.services.transactions.InMemoryTransactionVerifierService$verify$$inlined$apply$lambda$1.invoke(InMemoryTransactionVerifierService.kt:13) ~[corda-node-4.0-RC03.jar:?] at net.corda.core.internal.concurrent.ValueOrException$DefaultImpls.capture(CordaFutureImpl.kt:130) ~[corda-core-4.0-RC03.jar:?] at net.corda.core.internal.concurrent.OpenFuture$DefaultImpls.capture(CordaFutureImpl.kt) ~[corda-core-4.0-RC03.jar:?] at net.corda.core.internal.concurrent.CordaFutureImpl.capture(CordaFutureImpl.kt:142) ~[corda-core-4.0-RC03.jar:?] at net.corda.node.services.transactions.InMemoryTransactionVerifierService.verify(InMemoryTransactionVerifierService.kt:18) ~[corda-node-4.0-RC03.jar:?] at net.corda.node.services.transactions.InMemoryTransactionVerifierService.verify(InMemoryTransactionVerifierService.kt:14) ~[corda-node-4.0-RC03.jar:?] at net.corda.core.transactions.SignedTransaction.verifyRegularTransaction(SignedTransaction.kt:208) ~[corda-core-4.0-RC03.jar:?] at net.corda.core.transactions.SignedTransaction.verify(SignedTransaction.kt:180) ~[corda-core-4.0-RC03.jar:?] at net.corda.core.flows.ReceiveTransactionFlow.call(ReceiveTransactionFlow.kt:49) ~[corda-core-4.0-RC03.jar:?] at net.corda.core.flows.ReceiveTransactionFlow.call(ReceiveTransactionFlow.kt:27) ~[corda-core-4.0-RC03.jar:?] at net.corda.node.services.statemachine.FlowStateMachineImpl.subFlow(FlowStateMachineImpl.kt:290) ~[corda-node-4.0-RC03.jar:?] at net.corda.core.flows.FlowLogic.subFlow(FlowLogic.kt:311) ~[corda-core-4.0-RC03.jar:?] at net.corda.core.flows.ReceiveFinalityFlow.call(FinalityFlow.kt:260) ~[corda-core-4.0-RC03.jar:?] at net.corda.core.flows.ReceiveFinalityFlow.call(FinalityFlow.kt:255) ~[corda-core-4.0-RC03.jar:?] at net.corda.node.services.statemachine.FlowStateMachineImpl.subFlow(FlowStateMachineImpl.kt:290) ~[corda-node-4.0-RC03.jar:?] at net.corda.core.flows.FlowLogic.subFlow(FlowLogic.kt:311) ~[corda-core-4.0-RC03.jar:?] at net.corda.finance.flows.CashPaymentReceiverFlow.call(CashPaymentFlow.kt:106) ~[?:?] at net.corda.finance.flows.CashPaymentReceiverFlow.call(CashPaymentFlow.kt:97) ~[?:?] at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:228) ~[corda-node-4.0-RC03.jar:?] at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:45) ~[corda-node-4.0-RC03.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.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_181] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_181] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_181] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.8.0_181] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_181] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_181] at net.corda.node.utilities.AffinityExecutor$ServiceAffinityExecutor$1$thread$1.run(AffinityExecutor.kt:63) ~[corda-node-4.0-RC03.jar:?]

Status

Assignee

James Higgs

Reporter

Anthony Keenan

Priority

Medium

Labels

None

Severity

Medium

Fix versions

Ported to...

None

Feature Team

Corda Core

Sprint

None

Affects versions

Corda 4 RC03