morpheus
morpheus

Reputation: 20372

Hyperledger Fabric: Error: could not assemble transaction: ProposalResponsePayloads do not match

what are the steps to troubleshoot below error when trying to invoke a chaincode?

Error: could not assemble transaction: ProposalResponsePayloads do not match - proposal response: version:1 response:<status:200 payload:"[\"00000\"]" > ...

we get this error when trying to invoke a chaincode using peer chaincode invoke

Upvotes: 2

Views: 3822

Answers (3)

Sudeep Sagar
Sudeep Sagar

Reputation: 151

@morpheus: Has answered it excellently:

So I thought I will add to the above list of possible reasons:

I had by mistake added something like getting the current timestamp, and was using this for capturing the event date. This led to the different transaction responses by the endorsers, thus leading to the Response Payload not matching. The whole point to remember is that the result of execution should be deterministic as it is going to be run on all of the selected endorsing peers.

So use ctx.GetStub().GetTxTimestamp() for capturing the event time. This is the time when the transaction began and it will be constant across the endorser executions.

Upvotes: 9

Naser Mirzaei
Naser Mirzaei

Reputation: 822

Another reason that I forgot to check is using storing randomly generated values.

I never used random "Id" until now and didn't notice that it leads to ENDORSEMENT_MISMATCH

Upvotes: 0

morpheus
morpheus

Reputation: 20372

Check that you have installed the chaincode on all the peers your peer chaincode invoke command is targetting. That is the most likely cause of this error.

Other ways this error can occur:

  • You modified your chaincode and instead of installing a new version and upgrading the chaincode, you tried to be smart and overwrite the chaincode with the new file thinking that Fabric would not notice.

  • It can also happen if there is no chaincode container running on target peer and Docker daemon cannot be found on the peer node when it tries to instantiate a container or instantiation fails for some other reason

  • Another reason why this error can happen is if some peer nodes are using LevelDB and others are using CouchDB

The error itself originates from here. The first step to debug this error is to invoke the chaincode individually one-by-one on one peer node at a time.

Upvotes: 3

Related Questions