{"record":{"id":"0d5c916da6a91ba3","repo":"hyperledger/fabric","slug":"collection-name-s-not-allowed-a-valid-collectio","errorCode":null,"errorMessage":"collection-name: %s not allowed. A valid collection name follows the pattern: %s","messagePattern":"collection-name: (.+?) not allowed\\. A valid collection name follows the pattern: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/handlers/validation/builtin/v12/validation_logic.go","lineNumber":353,"sourceCode":"\n\tif err := checkForMissingCollections(newCollectionsMap, oldCollectionConfigs); err != nil {\n\t\treturn err\n\t}\n\n\tif err := checkForModifiedCollectionsBTL(newCollectionsMap, oldCollectionConfigs); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc validateCollectionName(collectionName string) error {\n\tif collectionName == \"\" {\n\t\treturn fmt.Errorf(\"empty collection-name is not allowed\")\n\t}\n\tmatch := validCollectionNameRegex.FindString(collectionName)\n\tif len(match) != len(collectionName) {\n\t\treturn fmt.Errorf(\"collection-name: %s not allowed. A valid collection name follows the pattern: %s\",\n\t\t\tcollectionName, AllowedCharsCollectionName)\n\t}\n\treturn nil\n}\n\n// validateRWSetAndCollection performs validation of the rwset\n// of an LSCC deploy operation and then it validates any collection\n// configuration.\nfunc (vscc *Validator) validateRWSetAndCollection(\n\tlsccrwset *kvrwset.KVRWSet,\n\tcdRWSet *ccprovider.ChaincodeData,\n\tlsccArgs [][]byte,\n\tlsccFunc string,\n\tac vc.Capabilities,\n\tchannelName string,\n) commonerrors.TxValidationError {\n\t/********************************************/\n\t/* security check 0.a - validation of rwset */","sourceCodeStart":335,"sourceCodeEnd":371,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/validation/builtin/v12/validation_logic.go#L335-L371","documentation":"Returned by validateCollectionName when the name partially matches validCollectionNameRegex but not fully — it contains characters outside the allowed pattern for private-data collection names. The message names both the offending name and the expected pattern.","triggerScenarios":"Thrown at core/handlers/validation/builtin/v12/validation_logic.go:353 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the collection to match the allowed pattern (alphanumerics, underscores, dashes, and dots as defined by the regex)","Sanitize generated collection names"],"exampleFix":null,"handlingStrategy":"validation","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-08T15:18:49.778Z"}