{"record":{"id":"a93b363d6af72be5","repo":"hyperledger/fabric","slug":"s-fabric-side-handler-cannot-handle-message-s","errorCode":null,"errorMessage":"[%s] Fabric side handler cannot handle message (%s) while in created state","messagePattern":"\\[(.+?)\\] Fabric side handler cannot handle message \\((.+?)\\) while in created state","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/handler.go","lineNumber":190,"sourceCode":"\t\treturn nil\n\t}\n\n\tswitch state {\n\tcase Created:\n\t\treturn h.handleMessageCreatedState(msg)\n\tcase Ready:\n\t\treturn h.handleMessageReadyState(msg)\n\tdefault:\n\t\treturn errors.Errorf(\"handle message: invalid state %s for transaction %s\", state, msg.Txid)\n\t}\n}\n\nfunc (h *Handler) handleMessageCreatedState(msg *pb.ChaincodeMessage) error {\n\tswitch msg.Type {\n\tcase pb.ChaincodeMessage_REGISTER:\n\t\th.HandleRegister(msg)\n\tdefault:\n\t\treturn fmt.Errorf(\"[%s] Fabric side handler cannot handle message (%s) while in created state\", msg.Txid, msg.Type)\n\t}\n\treturn nil\n}\n\nfunc (h *Handler) handleMessageReadyState(msg *pb.ChaincodeMessage) error {\n\tswitch msg.Type {\n\tcase pb.ChaincodeMessage_COMPLETED, pb.ChaincodeMessage_ERROR:\n\t\th.Notify(msg)\n\n\tcase pb.ChaincodeMessage_PUT_STATE:\n\t\tgo h.HandleTransaction(msg, h.HandlePutState)\n\tcase pb.ChaincodeMessage_DEL_STATE:\n\t\tgo h.HandleTransaction(msg, h.HandleDelState)\n\tcase pb.ChaincodeMessage_INVOKE_CHAINCODE:\n\t\tgo h.HandleTransaction(msg, h.HandleInvokeChaincode)\n\tcase pb.ChaincodeMessage_GET_STATE:\n\t\tgo h.HandleTransaction(msg, h.HandleGetState)\n\tcase pb.ChaincodeMessage_GET_STATE_BY_RANGE:","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/handler.go#L172-L208","documentation":"handleMessageCreatedState guard: the handler is still in Created state (chaincode not yet REGISTERed) but received a message other than REGISTER — typically a misbehaving or protocol-mismatched chaincode shim.","triggerScenarios":"Thrown at core/chaincode/handler.go:190 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the chaincode shim sends REGISTER as its first message on the stream","Align chaincode shim and peer Fabric versions and restart the chaincode"],"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"}