{"record":{"id":"978ba0f39573a755","repo":"pinpoint-apm/pinpoint","slug":"error-applying-changeset","errorCode":null,"errorMessage":"Error applying changeSet : ","messagePattern":"Error applying changeSet : ","errorType":"validation","errorClass":"InvalidHbaseSchemaException","httpStatus":null,"severity":"error","filePath":"hbase/hbase-schema/src/main/java/com/navercorp/pinpoint/hbase/schema/core/command/HbaseSchemaCommandManager.java","lineNumber":102,"sourceCode":"            }\n        }\n        return filteredHtds;\n    }\n\n    public String getNamespace() {\n        return namespace;\n    }\n\n    public void applyChangeSet(ChangeSet changeSet) {\n        Objects.requireNonNull(changeSet, \"changeSet\");\n\n        List<TableChange> tableChanges = changeSet.getTableChanges();\n        try {\n            for (TableChange tableChange : tableChanges) {\n                applyTableChange(tableChange);\n            }\n        } catch (Exception e) {\n            throw new InvalidHbaseSchemaException(\"Error applying changeSet : \" + changeSet.getId(), e);\n        }\n    }\n\n    private void applyTableChange(TableChange tableChange) {\n        ChangeType changeType = tableChange.getType();\n        TableName tableName = TableName.valueOf(namespace, tableChange.getName());\n\n        switch (changeType) {\n            case CREATE -> {\n                if (tableCommandMap.containsKey(tableName)) {\n                    throw new IllegalArgumentException(\"Cannot create an existing table : \" + tableName);\n                }\n                TableCommand createTableCommand = new CreateTableCommand(tableName, compressionAlgorithm, tableChange.getSplitKeys());\n                createTableCommand.applyConfiguration(tableChange.getTableConfiguration());\n                createTableCommand.applyColumnFamilyChanges(tableChange.getColumnFamilyChanges());\n                tableCommandMap.put(tableName, createTableCommand);\n            }\n            case MODIFY -> {","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/hbase/hbase-schema/src/main/java/com/navercorp/pinpoint/hbase/schema/core/command/HbaseSchemaCommandManager.java#L84-L120","documentation":"HbaseSchemaCommandManager.applyChangeSet iterates a ChangeSet's TableChanges and applies each. Any exception thrown while applying (including the IllegalArgumentExceptions from applyTableChange) is wrapped in InvalidHbaseSchemaException carrying the change set id, signaling that the schema change set could not be applied to HBase.","triggerScenarios":"Calling applyChangeSet (directly or via initFromExistingTables/updateExistingSchemas) when a TableChange is invalid — e.g. creating an already-existing table, modifying a non-existent table, or an unsupported change type.","commonSituations":"Re-running schema initialization against an HBase instance where tables already exist; running a change set whose target table was dropped manually; schema drift between code-defined and live HBase schemas.","solutions":["Catch InvalidHbaseSchemaException and inspect the message for the failing changeSet id, then read the cause for the specific table problem.","Skip or reconcile change sets whose tables already exist (use filterExecutedChangeSets to exclude applied ones).","Align the live HBase schema with the change set expectations (create missing tables or drop/recreate in a dev environment)."],"exampleFix":"// before\nmanager.applyChangeSets(changeSets); // throws on any failure\n// after\ntry {\n    manager.applyChangeSets(changeSets);\n} catch (InvalidHbaseSchemaException e) {\n    logger.error(\"Failed applying changeSet: {}\", e.getMessage(), e.getCause());\n}","handlingStrategy":"try-catch","validationCode":"// Pre-check which change sets still need applying\nList<ChangeSet> pending = manager.filterExecutedChangeSets(changeSets); // apply only pending","typeGuard":null,"tryCatchPattern":"try {\n    manager.applyChangeSets(changeSets);\n} catch (InvalidHbaseSchemaException e) {\n    logger.error(\"ChangeSet {} failed: {}\", e.getMessage(), e.getCause(), e);\n    // inspect cause: table exists / not found\n}","preventionTips":["Always filter out already-applied change sets before applying.","Keep live HBase schema and code-defined change sets in sync across environments.","Inspect the wrapped cause for the specific table failure before re-running."],"tags":["hbase","schema-migration","wrapped-exception"],"backgroundTag":"schema-validation-failed","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}