{"record":{"id":"7d254c47b8a68a14","repo":"hyperledger/fabric","slug":"could-not-retrieve-queryexecutor-for-channel-s-e","errorCode":null,"errorMessage":"could not retrieve QueryExecutor for channel %s, error %s","messagePattern":"could not retrieve QueryExecutor for channel (.+?), error (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/handlers/validation/builtin/v13/lscc_validation_logic.go","lineNumber":611,"sourceCode":"\t\t\t\t\terr = vscc.checkInstantiationPolicy(chid, env, polNew, payl)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// all is good!\n\t\treturn nil\n\tdefault:\n\t\treturn policyErr(fmt.Errorf(\"VSCC error: committing an invocation of function %s of lscc is invalid\", lsccFunc))\n\t}\n}\n\nfunc (vscc *Validator) getInstantiatedCC(chid, ccid string) (cd *ccprovider.ChaincodeData, exists bool, err error) {\n\tqe, err := vscc.stateFetcher.FetchState()\n\tif err != nil {\n\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)","sourceCodeStart":593,"sourceCodeEnd":629,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/validation/builtin/v13/lscc_validation_logic.go#L593-L629","documentation":"getInstantiatedCC called stateFetcher.FetchState and failed to obtain a QueryExecutor for the channel — a VSCC execution (infrastructure) failure rather than a policy violation, often transient ledger access trouble during commit.","triggerScenarios":"Thrown at core/handlers/validation/builtin/v13/lscc_validation_logic.go:611 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check ledger state DB connectivity/health","Retry validation; the query executor may be temporarily unavailable"],"exampleFix":null,"handlingStrategy":"retry","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"}