{"record":{"id":"6c588aa33863a9f4","repo":"hyperledger/fabric","slug":"error-unmarshalling-chaincodeid","errorCode":null,"errorMessage":"error unmarshalling ChaincodeID","messagePattern":"error unmarshalling ChaincodeID","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"protoutil/unmarshalers.go","lineNumber":68,"sourceCode":"// UnmarshalEnvelope unmarshals bytes to a Envelope\nfunc UnmarshalEnvelope(encoded []byte) (*common.Envelope, error) {\n\tenvelope := &common.Envelope{}\n\terr := proto.Unmarshal(encoded, envelope)\n\treturn envelope, errors.Wrap(err, \"error unmarshalling Envelope\")\n}\n\n// UnmarshalChannelHeader unmarshals bytes to a ChannelHeader\nfunc UnmarshalChannelHeader(bytes []byte) (*common.ChannelHeader, error) {\n\tchdr := &common.ChannelHeader{}\n\terr := proto.Unmarshal(bytes, chdr)\n\treturn chdr, errors.Wrap(err, \"error unmarshalling ChannelHeader\")\n}\n\n// UnmarshalChaincodeID unmarshals bytes to a ChaincodeID\nfunc UnmarshalChaincodeID(bytes []byte) (*peer.ChaincodeID, error) {\n\tccid := &peer.ChaincodeID{}\n\terr := proto.Unmarshal(bytes, ccid)\n\treturn ccid, errors.Wrap(err, \"error unmarshalling ChaincodeID\")\n}\n\n// UnmarshalSignatureHeader unmarshals bytes to a SignatureHeader\nfunc UnmarshalSignatureHeader(bytes []byte) (*common.SignatureHeader, error) {\n\tsh := &common.SignatureHeader{}\n\terr := proto.Unmarshal(bytes, sh)\n\treturn sh, errors.Wrap(err, \"error unmarshalling SignatureHeader\")\n}\n\n// UnmarshalIdentifierHeader unmarshals bytes to an IdentifierHeader\nfunc UnmarshalIdentifierHeader(bytes []byte) (*common.IdentifierHeader, error) {\n\tih := &common.IdentifierHeader{}\n\terr := proto.Unmarshal(bytes, ih)\n\treturn ih, errors.Wrap(err, \"error unmarshalling IdentifierHeader\")\n}\n\nfunc UnmarshalSerializedIdentity(bytes []byte) (*msp.SerializedIdentity, error) {\n\tsid := &msp.SerializedIdentity{}","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/protoutil/unmarshalers.go#L50-L86","documentation":"Returned by protoutil.UnmarshalChaincodeID when proto.Unmarshal fails on the supplied bytes — they are not a validly encoded peer.ChaincodeID. Generic unmarshal wrapper; the input at fault is whatever bytes the caller extracted for the chaincode ID field.","triggerScenarios":"Thrown at protoutil/unmarshalers.go:68 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the producer of the ChaincodeID bytes","Verify the message type matches before unmarshalling"],"exampleFix":null,"handlingStrategy":"try-catch","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"}