{"record":{"id":"89cde02cdd5d479e","repo":"hyperledger/fabric","slug":"channel-s-failed-to-get-chaincode-container-inf","errorCode":null,"errorMessage":"[channel %s] failed to get chaincode container info for %s","messagePattern":"\\[channel (.+?)\\] failed to get chaincode container info for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/chaincode_support.go","lineNumber":228,"sourceCode":"\n\th, err := cs.Launch(ccid)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn cs.execute(cctype, txParams, chaincodeName, input, h)\n}\n\n// CheckInvocation inspects the parameters of an invocation and determines if, how, and to where a that invocation should be routed.\n// First, we ensure that the target namespace is defined on the channel and invokable on this peer, according to the lifecycle implementation.\n// Then, if the chaincode definition requires it, this function enforces 'init exactly once' semantics.\n// Finally, it returns the chaincode ID to route to and the message type of the request (normal transaction, or init).\nfunc (cs *ChaincodeSupport) CheckInvocation(txParams *ccprovider.TransactionParams, chaincodeName string, input *pb.ChaincodeInput) (ccid string, cctype pb.ChaincodeMessage_Type, err error) {\n\tchaincodeLogger.Debugf(\"[%s] getting chaincode data for %s on channel %s\", shorttxid(txParams.TxID), chaincodeName, txParams.ChannelID)\n\tcii, err := cs.Lifecycle.ChaincodeEndorsementInfo(txParams.ChannelID, chaincodeName, txParams.TXSimulator)\n\tif err != nil {\n\t\tlogDevModeError(cs.UserRunsCC)\n\t\treturn \"\", 0, errors.Wrapf(err, \"[channel %s] failed to get chaincode container info for %s\", txParams.ChannelID, chaincodeName)\n\t}\n\n\tneedsInitialization := false\n\tif cii.EnforceInit {\n\n\t\tvalue, err := txParams.TXSimulator.GetState(chaincodeName, InitializedKeyName)\n\t\tif err != nil {\n\t\t\treturn \"\", 0, errors.WithMessage(err, \"could not get 'initialized' key\")\n\t\t}\n\n\t\tneedsInitialization = !bytes.Equal(value, []byte(cii.Version))\n\t}\n\n\t// Note, IsInit is a new field for v2.0 and should only be set for invocations of non-legacy chaincodes.\n\t// Any invocation of a legacy chaincode with IsInit set will fail.  This is desirable, as the old\n\t// InstantiationPolicy contract enforces which users may call init.\n\tif input.IsInit {\n\t\tif !cii.EnforceInit {","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/chaincode_support.go#L210-L246","documentation":"CheckInvocation calls cs.Lifecycle.ChaincodeEndorsementInfo(channel, chaincodeName, TXSimulator) to resolve the chaincode definition for the namespace; any failure is wrapped as '[channel %s] failed to get chaincode container info for %s'. This means the chaincode (namespace) could not be resolved as defined/committed on that channel — the peer cannot route the invocation. In dev mode the underlying error is also surfaced via logDevModeError hints.","triggerScenarios":"Invoking a chaincode name that is not defined/committed on the channel (via ChaincodeSupport.Invoke -> CheckInvocation); querying a channel the peer is not a member of; lifecycle data unreadable; legacy lscc lookups failing when the chaincode was never installed/approved/committed.","commonSituations":"Typo in chaincode name or channel name; chaincode committed on another channel; peer not joined to the channel; chaincode approved but not committed (v2.x lifecycle); package not installed on this peer; using 'mycc:1.0' name+version syntax on a v2 lifecycle peer that expects bare namespace names.","solutions":["Run 'peer lifecycle chaincode querycommitted -C <channel>' (or 'peer chaincode list --installed') and confirm the namespace exists on that channel.","Correct the chaincode name/channel name in the client request (v2 lifecycle uses the bare name, not name:version).","If not committed, complete the lifecycle: package -> install -> approveformyorg -> checkcommitreadiness -> commit.","Verify the peer has joined the channel ('peer channel list') and fetch the latest channel config/block.","Inspect the wrapped cause in the error message — it names the exact lifecycle failure (e.g. 'cannot get package for chaincode')."],"exampleFix":"// before: v2 peer with legacy-style target\ntargets := []string{\"peer0.org1\"}\nreq := channel.Request{ChaincodeID: \"mycc:1.0\", Fcn: \"invoke\", Args: ...}\n// after: use bare namespace committed on the channel\nreq := channel.Request{ChaincodeID: \"mycc\", Fcn: \"invoke\", Args: ...}","handlingStrategy":"validation","validationCode":"// before invoking, confirm the namespace is committed on the channel\nout, err := exec.Command(\"peer\", \"lifecycle\", \"chaincode\", \"querycommitted\",\n    \"-C\", channelName).Output()\nif err != nil {\n    return err\n}\nif !strings.Contains(string(out), \"Name: \"+chaincodeName) {\n    return fmt.Errorf(\"chaincode %q is not committed on channel %q\", chaincodeName, channelName)\n}","typeGuard":"func isNamespaceResolutionFailure(err error) (channel, ccName string, ok bool) {\n    if err == nil {\n        return \"\", \"\", false\n    }\n    var m = regexp.MustCompile(`\\[channel (.+?)\\] failed to get chaincode container info for (.+?)\\b`).FindStringSubmatch(err.Error())\n    if m == nil {\n        return \"\", \"\", false\n    }\n    return m[1], m[2], true\n}","tryCatchPattern":null,"preventionTips":["After every deployment step, verify with 'peer lifecycle chaincode querycommitted' before invoking.","Use bare chaincode names (no ':version' suffix) with v2 lifecycle peers.","Ensure all endorsement-org peers have the package installed and definition committed.","Verify the peer is joined to the target channel before submitting requests.","Read the wrapped cause inside the error — it identifies whether install, approval, or commit is missing."],"tags":["lifecycle","chaincode-not-found","hyperledger-fabric","routing"],"backgroundTag":"chaincode-not-defined-on-channel","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"}