{"record":{"id":"7ddc6991d2388f3e","repo":"hyperledger/fabric","slug":"failed-to-marshal-args-7ddc69","errorCode":null,"errorMessage":"failed to marshal args","messagePattern":"failed to marshal args","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/lifecycle/chaincode/querycommitted.go","lineNumber":235,"sourceCode":"}\n\nfunc (c *CommittedQuerier) createProposal() (*pb.Proposal, error) {\n\tvar function string\n\tvar args proto.Message\n\n\tif c.Input.Name != \"\" {\n\t\tfunction = \"QueryChaincodeDefinition\"\n\t\targs = &lb.QueryChaincodeDefinitionArgs{\n\t\t\tName: c.Input.Name,\n\t\t}\n\t} else {\n\t\tfunction = \"QueryChaincodeDefinitions\"\n\t\targs = &lb.QueryChaincodeDefinitionsArgs{}\n\t}\n\n\targsBytes, err := proto.Marshal(args)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to marshal args\")\n\t}\n\tccInput := &pb.ChaincodeInput{Args: [][]byte{[]byte(function), argsBytes}}\n\n\tcis := &pb.ChaincodeInvocationSpec{\n\t\tChaincodeSpec: &pb.ChaincodeSpec{\n\t\t\tChaincodeId: &pb.ChaincodeID{Name: lifecycleName},\n\t\t\tInput:       ccInput,\n\t\t},\n\t}\n\n\tsignerSerialized, err := c.Signer.Serialize()\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"failed to serialize identity\")\n\t}\n\n\tproposal, _, err := protoutil.CreateProposalFromCIS(cb.HeaderType_ENDORSER_TRANSACTION, c.Input.ChannelID, cis, signerSerialized)\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"failed to create ChaincodeInvocationSpec proposal\")","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/querycommitted.go#L217-L253","documentation":"createProposal marshals the lifecycle query args (QueryChaincodeDefinitionResult args struct) with proto.Marshal before building the proposal. This error means local serialization of the client-side args failed — essentially never seen in practice since these structs are plain generated protobufs.","triggerScenarios":"proto.Marshal of an empty/nil or corrupted args message fails; practically only possible if the args struct construction is broken (e.g. nil args variable assigned on an unhandled code path).","commonSituations":"Extremely rare; would indicate a custom-modified CLI or corrupted Fabric binary rather than user error.","solutions":["Use a stock Fabric v2.x peer binary/CLI; rebuild from a clean checkout","Confirm the command's flag combination maps to a supported query function","Report to maintainers with full command line and stack trace if reproducible"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := q.Query(); err != nil {\n    if strings.Contains(err.Error(), \"failed to marshal args\") {\n        return fmt.Errorf(\"client-side serialization bug; use stock fabric binaries\")\n    }\n    return err\n}","preventionTips":["Use official Fabric CLI builds","Rebuild cleanly if fabric source was patched","Report reproducible marshal failures upstream"],"tags":["fabric","lifecycle","protobuf","marshal"],"backgroundTag":"protobuf-marshal-failed","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"}