{"record":{"id":"71faa2f9ee37a687","repo":"hyperledger/fabric","slug":"channel-id-illegal-cannot-be-longer-than-d-71faa2","errorCode":null,"errorMessage":"channel ID illegal, cannot be longer than %d","messagePattern":"channel ID illegal, cannot be longer than (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/tx/endorser/parser.go","lineNumber":201,"sourceCode":"// following restrictions:\n//  1. Contain only lower case ASCII alphanumerics, dots '.', and dashes '-'\n//  2. Are shorter than 250 characters.\n//  3. Start with a letter\n//\n// This is the intersection of the Kafka restrictions and CouchDB restrictions\n// with the following exception: '.' is converted to '_' in the CouchDB naming\n// This is to accommodate existing channel names with '.', especially in the\n// behave tests which rely on the dot notation for their sluggification.\n//\n// note: this function is a copy of the same in common/configtx/validator.go\nfunc ValidateChannelID(channelID string) error {\n\tre, _ := regexp.Compile(ChannelAllowedChars)\n\t// Length\n\tif len(channelID) <= 0 {\n\t\treturn errors.Errorf(\"channel ID illegal, cannot be empty\")\n\t}\n\tif len(channelID) > MaxLength {\n\t\treturn errors.Errorf(\"channel ID illegal, cannot be longer than %d\", MaxLength)\n\t}\n\n\t// Illegal characters\n\tmatched := re.FindString(channelID)\n\tif len(matched) != len(channelID) {\n\t\treturn errors.Errorf(\"'%s' contains illegal characters\", channelID)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":183,"sourceCodeEnd":212,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/tx/endorser/parser.go#L183-L212","documentation":"ValidateChannelID rejects channel IDs longer than MaxLength (63 characters in this codebase). Channel names map to filesystem/ledger paths and database keys, so length is capped. The error includes the allowed maximum via %d.","triggerScenarios":"Passing a channel name of more than MaxLength characters — e.g. auto-generated channel names from long concatenations of org names, timestamps, and environment identifiers.","commonSituations":"CI pipelines generating channel names like <project>-<branch>-<sha>-<env> that exceed 63 chars; multi-tenant systems encoding tenant IDs into channel names.","solutions":["Shorten the channel name to <= 63 characters before creating the channel.","Hash or truncate long generated segments (e.g. use first 8 chars of a commit SHA).","Add a pre-check: if len(name) > 63 { return error } at channel-name generation time."],"exampleFix":"// before\nname := fmt.Sprintf(\"%s-%s-%s-%s\", project, branch, sha, env)\n// after\nname := fmt.Sprintf(\"%s-%.8s-%s\", project, branch, sha)\nif len(name) > 63 { return errors.New(\"channel name too long\") }","handlingStrategy":"validation","validationCode":"if len(channelID) > 63 { return fmt.Errorf(\"channel ID %q exceeds 63 characters\", channelID) }","typeGuard":"func channelIDLengthOK(id string) bool { return len(id) <= 63 }","tryCatchPattern":null,"preventionTips":["Cap generated channel names (truncate branch/SHA segments) at creation time.","Keep a naming convention doc limiting names to 63 chars.","Test name generators with long inputs in CI."],"tags":["fabric","channel-id","validation"],"backgroundTag":"invalid-channel-id","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"}