Search code examples
cordaproduction

How to reset the attachments store?


I replaced a signed contracts.jar on my production node with another signed contracts.jar containing 1 additional contract and states. Now I get the following error:

Failed net.corda.core.transactions.MissingContractAttachments: Cannot find contract attachments for com.cordacodeclub.contracts.LockableTokenContractnull. See https://docs.corda.net/api-contract-constraints.html#debugging

You can see it live by going to http://54.216.255.188:8080 and pressing "Reset". The LockableTokenContract mentioned in the error message is an old contract that was present in the previous signed jar.

I am ok to lose all the production data as this is still a test arrangement. So I hid the persistence.mv.db and persistence.trace.db, to no avail.

So my question is how can I start afresh by:

  • resetting my vault and the attachment store
  • keeping my testnet certificates

EDIT: Here is the start log of the node:

Sep 27 18:48:17 ip-172-31-6-121 corda[86960]: --- Corda Open Source 4.4 (21e8c4f) -------------------------------------------------------------
Sep 27 18:48:17 ip-172-31-6-121 corda[86960]: Logs can be found in                    : /opt/corda/logs
Sep 27 18:48:34 ip-172-31-6-121 corda[86960]: Advertised P2P messaging addresses      : 54.216.255.188:10002
Sep 27 18:48:34 ip-172-31-6-121 corda[86960]: RPC connection address                  : 0.0.0.0:10003
Sep 27 18:48:34 ip-172-31-6-121 corda[86960]: RPC admin connection address            : 0.0.0.0:10004
`Sep 27 18:48:41 ip-172-31-6-121 corda[86960]: Loaded 12 CorDapp(s)                    : CorDapp corda-updates-core version 1.0 by com.r3 with licence Unknown, Workflow CorDapp: Slot Machine Flows version 1 by vendor Corda Code Club with licence Apache License, Version 2.0, Workflow CorDapp: Confidential Identities Workflows version 1 by vendor Corda Open Source with licence Apache License, Version 2.0, CorDapp bn-onboarder-app version 2.0 by net.corda.businessnetworks with licence Unknown, CorDapp corda-updates-app-states version 1.0 by com.r3 with licence Unknown, CorDapp business-network-membership-service-states version 1.0 by com.r3 with licence Unknown, Contract CorDapp: Accounts SDK - States and Contracts version 1 by vendor R3 with licence Apache 2, CorDapp corda-updates-transport version 1.0 by com.r3 with licence Unknown, Contract CorDapp: Slot Machine contracts version 1 by vendor Corda Code Club with licence Apache License, Version 2.0, CorDapp business-network-membership-service version 1.0 by com.r3 with licence Unknown, Contract CorDapp: Accounts - Flows version 1 by vendor R3 with licence Apache 2, CorDapp corda-updates-app version 1.0 by com.r3 with licence Unknown
Sep 27 18:48:41 ip-172-31-6-121 corda[86960]: Node for "TESTNET_B9lab" started up and registered in 25.45 sec
Sep 27 18:48:41 ip-172-31-6-121 corda[86960]: SSH server listening on port            : 2222
Sep 27 18:48:41 ip-172-31-6-121 corda[86960]: Running P2PMessaging loop

Solution

  • Big oof! I had different versions of contracts.jar on my 2 nodes. Both signed apparently... Putting the same one on both ends solved it for me.