{"record":{"id":"dae8d8a560af8076","repo":"hyperledger/fabric","slug":"unmarshalling-chaincodequeryresponse-failed-error","errorCode":null,"errorMessage":"unmarshalling ChaincodeQueryResponse failed, error %s","messagePattern":"unmarshalling ChaincodeQueryResponse failed, error (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/handlers/validation/builtin/v13/lscc_validation_logic.go","lineNumber":629,"sourceCode":"\t\terr = fmt.Errorf(\"could not retrieve QueryExecutor for channel %s, error %s\", chid, err)\n\t\treturn\n\t}\n\tdefer qe.Done()\n\tchannelState := &state{qe}\n\tbytes, err := channelState.GetState(\"lscc\", ccid)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"could not retrieve state for chaincode %s on channel %s, error %s\", ccid, chid, err)\n\t\treturn\n\t}\n\n\tif bytes == nil {\n\t\treturn\n\t}\n\n\tcd = &ccprovider.ChaincodeData{}\n\terr = proto.Unmarshal(bytes, cd)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"unmarshalling ChaincodeQueryResponse failed, error %s\", err)\n\t\treturn\n\t}\n\n\texists = true\n\treturn\n}\n\ntype state struct {\n\tvs.State\n}\n\n// GetState retrieves the value for the given key in the given namespace\nfunc (s *state) GetState(namespace string, key string) ([]byte, error) {\n\tvalues, err := s.GetStateMultipleKeys(namespace, []string{key})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(values) == 0 {","sourceCodeStart":611,"sourceCodeEnd":647,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/validation/builtin/v13/lscc_validation_logic.go#L611-L647","documentation":"Returned by getInstantiatedCC when the stored bytes for an instantiated chaincode cannot be proto-unmarshaled into ChaincodeData. Ledger state for the chaincode exists but is corrupt, so its existence cannot be confirmed.","triggerScenarios":"Thrown at core/handlers/validation/builtin/v13/lscc_validation_logic.go:629 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Investigate how invalid bytes were committed under the lscc namespace","Rebuild or repair the channel ledger if corruption is confirmed"],"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"}