1

Getting error while fetching data from a peer in fabric and unable to resolve the issue.

Tried to insert new records in one of the peers which I have created and has entered the code, where I didn't receive any response and cursor is moved to next point and when I am fetching details of that new record I am getting error

Error: endorsement failure during query. response: status:500 message:"transaction returned with failure: Error: CAR10 does not exist"

I used following query to fetch the row details

peer chaincode query -c $channel NAME -n mycc -c '{"args":["querycar","CAR10"]}'

My task is to insert a new record into the peer and to fetch the record details and also the data should be inserted in all the peers which I have created.

James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

0

The error simply says that there is not cars with id CAR10.

1.If you have just initialized the chaincode and directly queried it then the total no. of cars added to the ledger are 9 query with CAR9 as the key.

2.if not then add the CAR10 to the ledger using the createCar function in chaincode. and then query it.

Risabh Sharma
  • 634
  • 5
  • 15