{"record":{"id":"ac87925ebacf3841","repo":"pinpoint-apm/pinpoint","slug":"columnfamily-name-must-not-be-empty","errorCode":null,"errorMessage":"ColumnFamily name must not be empty","messagePattern":"ColumnFamily name must not be empty","errorType":"validation","errorClass":"InvalidHbaseSchemaException","httpStatus":null,"severity":"error","filePath":"hbase/hbase-schema/src/main/java/com/navercorp/pinpoint/hbase/schema/reader/xml/mapper/ColumnFamilyChangeMapper.java","lineNumber":38,"sourceCode":"import com.navercorp.pinpoint.hbase.schema.definition.xml.Table;\nimport com.navercorp.pinpoint.hbase.schema.reader.InvalidHbaseSchemaException;\nimport com.navercorp.pinpoint.hbase.schema.reader.core.ColumnFamilyChange;\nimport com.navercorp.pinpoint.hbase.schema.reader.core.ColumnFamilyConfiguration;\nimport com.navercorp.pinpoint.hbase.schema.reader.core.CreateColumnFamilyChange;\n\nimport java.util.Objects;\n\n/**\n * @author HyunGil Jeong\n */\npublic class ColumnFamilyChangeMapper {\n\n    private final ColumnFamilyConfigurationMapper columnFamilyConfigurationMapper = new ColumnFamilyConfigurationMapper();\n\n    public ColumnFamilyChange mapCreate(Table.CreateColumnFamily createColumnFamily) {\n        Objects.requireNonNull(createColumnFamily, \"createColumnFamily\");\n        if (StringUtils.isEmpty(createColumnFamily.getName())) {\n            throw new InvalidHbaseSchemaException(\"ColumnFamily name must not be empty\");\n        }\n        String name = createColumnFamily.getName();\n        ColumnFamilyConfiguration columnFamilyConfiguration = columnFamilyConfigurationMapper.mapConfiguration(createColumnFamily.getConfiguration());\n\n        return new CreateColumnFamilyChange(name, columnFamilyConfiguration);\n    }\n}\n","sourceCodeStart":20,"sourceCodeEnd":46,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/hbase/hbase-schema/src/main/java/com/navercorp/pinpoint/hbase/schema/reader/xml/mapper/ColumnFamilyChangeMapper.java#L20-L46","documentation":"ColumnFamilyChangeMapper.mapCreate validates that a <createColumnFamily> element has a non-empty name before building a CreateColumnFamilyChange. An empty name would create an unusable HBase column family descriptor, so it is rejected with InvalidHbaseSchemaException.","triggerScenarios":"Calling mapCreate with a Table.CreateColumnFamily whose getName() is null or empty — i.e. a createColumnFamily element missing the name attribute or with name=\"\" in the change set XML.","commonSituations":"Copy-pasted createColumnFamily element with the name attribute accidentally deleted; placeholder name left empty in a template; XML editing tools stripping empty attributes.","solutions":["Add the missing name attribute to the createColumnFamily element","Ensure the name is non-empty and uses valid HBase column family characters (no colons, printable bytes)","If the family is not actually needed, remove the createColumnFamily element entirely","Validate the schema XML against the XSD before applying change sets"],"exampleFix":"// before\n<createColumnFamily name=\"\"></createColumnFamily>\n// after\n<createColumnFamily name=\"AgentStatV2\"></createColumnFamily>","handlingStrategy":"validation","validationCode":"for (Element cf : createColumnFamilyElements) {\n    if (cf.getAttribute(\"name\").trim().isEmpty()) {\n        throw new IllegalArgumentException(\"createColumnFamily missing name\");\n    }\n}","typeGuard":"boolean hasName(Table.CreateColumnFamily cf) {\n    return cf != null && !StringUtils.isEmpty(cf.getName());\n}","tryCatchPattern":"try {\n    ColumnFamilyChange c = mapper.mapCreate(createColumnFamily);\n} catch (InvalidHbaseSchemaException e) {\n    if (e.getMessage().contains(\"ColumnFamily name must not be empty\")) {\n        logger.error(\"createColumnFamily element missing name attribute\");\n    } else {\n        throw e;\n    }\n}","preventionTips":["Always set the name attribute on createColumnFamily elements","XSD-validate schema XML so missing required attributes are caught early","Review copy-pasted XML blocks for stripped attributes"],"tags":["hbase","xml","column-family","schema-validation"],"backgroundTag":"empty-required-field","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}