{"record":{"id":"6edf1708839b294c","repo":"hyperledger/fabric","slug":"s-fabric-side-handler-cannot-handle-message-s-6edf17","errorCode":null,"errorMessage":"[%s] Fabric side handler cannot handle message (%s) while in ready state","messagePattern":"\\[(.+?)\\] Fabric side handler cannot handle message \\((.+?)\\) while in ready state","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/handler.go","lineNumber":231,"sourceCode":"\t\tgo h.HandleTransaction(msg, h.HandleGetHistoryForKey)\n\tcase pb.ChaincodeMessage_QUERY_STATE_NEXT:\n\t\tgo h.HandleTransaction(msg, h.HandleQueryStateNext)\n\tcase pb.ChaincodeMessage_QUERY_STATE_CLOSE:\n\t\tgo h.HandleTransaction(msg, h.HandleQueryStateClose)\n\tcase pb.ChaincodeMessage_GET_PRIVATE_DATA_HASH:\n\t\tgo h.HandleTransaction(msg, h.HandleGetPrivateDataHash)\n\tcase pb.ChaincodeMessage_GET_STATE_METADATA:\n\t\tgo h.HandleTransaction(msg, h.HandleGetStateMetadata)\n\tcase pb.ChaincodeMessage_PUT_STATE_METADATA:\n\t\tgo h.HandleTransaction(msg, h.HandlePutStateMetadata)\n\tcase pb.ChaincodeMessage_PURGE_PRIVATE_DATA:\n\t\tgo h.HandleTransaction(msg, h.HandlePurgePrivateData)\n\tcase pb.ChaincodeMessage_WRITE_BATCH_STATE:\n\t\tgo h.HandleTransaction(msg, h.HandleWriteBatch)\n\tcase pb.ChaincodeMessage_GET_STATE_MULTIPLE:\n\t\tgo h.HandleTransaction(msg, h.HandleGetStateMultipleKeys)\n\tdefault:\n\t\treturn fmt.Errorf(\"[%s] Fabric side handler cannot handle message (%s) while in ready state\", msg.Txid, msg.Type)\n\t}\n\n\treturn nil\n}\n\ntype MessageHandler interface {\n\tHandle(*pb.ChaincodeMessage, *TransactionContext) (*pb.ChaincodeMessage, error)\n}\n\ntype handleFunc func(*pb.ChaincodeMessage, *TransactionContext) (*pb.ChaincodeMessage, error)\n\n// HandleTransaction is a middleware function that obtains and verifies a transaction\n// context prior to forwarding the message to the provided delegate. Response messages\n// returned by the delegate are sent to the chat stream. Any errors returned by the\n// delegate are packaged as chaincode error messages.\nfunc (h *Handler) HandleTransaction(msg *pb.ChaincodeMessage, delegate handleFunc) {\n\tstartTime := time.Now()\n\tmeterLabels := []string{","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/handler.go#L213-L249","documentation":"handleMessageReadyState default case: the handler is in Ready state but received a chaincode message type it has no dispatch case for — an unsupported or unexpected message from the shim at this point in the protocol.","triggerScenarios":"Thrown at core/chaincode/handler.go:231 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check for shim/peer version mismatch and rebuild the chaincode against the matching fabric-contract-api","Restart the chaincode container after fixing the shim"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}