{"record":{"id":"d89b69d9df7d0334","repo":"hyperledger/fabric","slug":"empty-collection-name-is-not-allowed","errorCode":null,"errorMessage":"empty collection-name is not allowed","messagePattern":"empty collection-name is not allowed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/handlers/validation/builtin/v12/validation_logic.go","lineNumber":349,"sourceCode":"\t\t// Collection object itself is stored as value so that we can\n\t\t// check whether the block to live is changed -- FAB-7810\n\t\tnewCollectionsMap[newCollection.GetName()] = newCollection\n\t}\n\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,","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/validation/builtin/v12/validation_logic.go#L331-L367","documentation":"Returned by validateCollectionName (v12 validation logic) when the collection name in an LSCC-deployed collection config is the empty string. The empty name precedes the regex check and is rejected outright as an unusable collection identifier.","triggerScenarios":"Thrown at core/handlers/validation/builtin/v12/validation_logic.go:349 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty collection name in the collection config","Fix generation logic that emits unnamed collections"],"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-08T10:18:20.063Z"}