{"record":{"id":"ea2d9dd2de513f8d","repo":"hyperledger/fabric","slug":"bad-config-metadata-option-collecttimeout","errorCode":null,"errorMessage":"bad config metadata option CollectTimeout","messagePattern":"bad config metadata option CollectTimeout","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"orderer/consensus/smartbft/util/util.go","lineNumber":54,"sourceCode":"\t}\n\tif config.RequestComplainTimeout, err = time.ParseDuration(options.RequestComplainTimeout); err != nil {\n\t\treturn config, errors.Wrap(err, \"bad config metadata option RequestComplainTimeout\")\n\t}\n\tif config.RequestAutoRemoveTimeout, err = time.ParseDuration(options.RequestAutoRemoveTimeout); err != nil {\n\t\treturn config, errors.Wrap(err, \"bad config metadata option RequestAutoRemoveTimeout\")\n\t}\n\tif config.ViewChangeResendInterval, err = time.ParseDuration(options.ViewChangeResendInterval); err != nil {\n\t\treturn config, errors.Wrap(err, \"bad config metadata option ViewChangeResendInterval\")\n\t}\n\tif config.ViewChangeTimeout, err = time.ParseDuration(options.ViewChangeTimeout); err != nil {\n\t\treturn config, errors.Wrap(err, \"bad config metadata option ViewChangeTimeout\")\n\t}\n\tif config.LeaderHeartbeatTimeout, err = time.ParseDuration(options.LeaderHeartbeatTimeout); err != nil {\n\t\treturn config, errors.Wrap(err, \"bad config metadata option LeaderHeartbeatTimeout\")\n\t}\n\tconfig.LeaderHeartbeatCount = options.LeaderHeartbeatCount\n\tif config.CollectTimeout, err = time.ParseDuration(options.CollectTimeout); err != nil {\n\t\treturn config, errors.Wrap(err, \"bad config metadata option CollectTimeout\")\n\t}\n\tconfig.SyncOnStart = options.SyncOnStart\n\tconfig.SpeedUpViewChange = options.SpeedUpViewChange\n\n\tif options.LeaderRotation != smartbft.Options_ROTATION_ON {\n\t\tconfig.LeaderRotation = false\n\t\tconfig.DecisionsPerLeader = 0\n\t} else {\n\t\tconfig.LeaderRotation = true\n\t\tconfig.DecisionsPerLeader = options.DecisionsPerLeader\n\t}\n\n\tif err = config.Validate(); err != nil {\n\t\treturn config, errors.Wrap(err, \"config validation failed\")\n\t}\n\n\tif options.RequestMaxBytes == 0 {\n\t\tconfig.RequestMaxBytes = config.RequestBatchMaxBytes","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/consensus/smartbft/util/util.go#L36-L72","documentation":"ConfigFromMetadataOptions parses CollectTimeout from the BFT metadata options via time.ParseDuration and wraps parse failures with this error. CollectTimeout bounds how long the leader waits to collect signatures for a batch; an invalid value causes the config block to be rejected.","triggerScenarios":"Orderer startup (HandleChain), channel config commit via configBlockToBFTConfig, or `inspect` when options.CollectTimeout is empty or malformed (e.g. '15seconds' instead of '15s').","commonSituations":"Config generated by external tooling writing unsupported duration formats, hand-edited JSON/YAML in the consensus metadata, or dropped field after version migration of the block metadata.","solutions":["Fix CollectTimeout in the consensus metadata to a valid duration string like \"1s\"","Regenerate and recommit the channel config block with correct options","Validate the block with `orderer genesis inspect` before committing","Check tooling output serialization to ensure durations carry Go units"],"exampleFix":"// before\n\"CollectTimeout\": \"1 second\"\n// after\n\"CollectTimeout\": \"1s\"","handlingStrategy":"validation","validationCode":"if _, err := time.ParseDuration(opts.CollectTimeout); err != nil { return fmt.Errorf(\"CollectTimeout invalid: %w\", err) }","typeGuard":null,"tryCatchPattern":"cfg, err := util.ConfigFromMetadataOptions(selfID, opts)\nif err != nil { return fmt.Errorf(\"rejecting options: %w\", err) }","preventionTips":["Use Go duration strings only (\"1s\", \"500ms\")","Round-trip generated config through configtxlator to catch format drift","Pre-validate with inspect before channel update submission","Avoid hand-editing consensus metadata JSON"],"tags":["hyperledger-fabric","config","smartbft","duration-parsing"],"backgroundTag":"invalid-duration-format","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"}