{"record":{"id":"3f0b13383ac00043","repo":"pinpoint-apm/pinpoint","slug":"cannot-modify-a-non-existent-table","errorCode":null,"errorMessage":"Cannot modify a non-existent table : ","messagePattern":"Cannot modify a non-existent table : ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hbase/hbase-schema/src/main/java/com/navercorp/pinpoint/hbase/schema/core/command/HbaseSchemaCommandManager.java","lineNumber":123,"sourceCode":"\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 -> {\n                TableCommand tableCommand = tableCommandMap.get(tableName);\n                if (tableCommand == null) {\n                    throw new IllegalArgumentException(\"Cannot modify a non-existent table : \" + tableName);\n                }\n                tableCommand.applyConfiguration(tableChange.getTableConfiguration());\n                tableCommand.applyColumnFamilyChanges(tableChange.getColumnFamilyChanges());\n            }\n            default ->\n                throw new UnsupportedOperationException(\"Invalid change type : \" + changeType);\n        }\n        affectedTables.add(tableName);\n    }\n\n    public List<TableCommand> getCommands() {\n        return tableCommandMap.entrySet().stream()\n                .filter(e -> affectedTables.contains(e.getKey()))\n                .map(Map.Entry::getValue)\n                .collect(Collectors.toList());\n    }\n\n    public List<TableDescriptor> getSchemaSnapshot() {","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/hbase/hbase-schema/src/main/java/com/navercorp/pinpoint/hbase/schema/core/command/HbaseSchemaCommandManager.java#L105-L141","documentation":"In applyTableChange, a TableChange of type MODIFY fails with IllegalArgumentException when no command exists for the target table in tableCommandMap — the change set attempts to alter a table that was never created (or registered) earlier in the run.","triggerScenarios":"Calling applyChangeSet with a MODIFY TableChange whose table name does not match any CREATE TableChange previously applied in the same schema initialization run.","commonSituations":"A change set that modifies a table defined in an earlier change set which was skipped or filtered out; a typo in the table name; running an incremental change set against a fresh HBase where the base table was never created.","solutions":["Ensure the change set that CREATEs the table runs before the MODIFY change set in the same initialization.","Fix the table name in the MODIFY entry to match the created table exactly (namespace + name).","Do not filter out the creating change set via filterExecutedChangeSets if its table is missing from HBase."],"exampleFix":"// before\nchanges.add(new TableChange(MODIFY, \"AgentStat\", cfC)); // AgentStat never created in this run\n// after\nchanges.add(new TableChange(CREATE, \"AgentStat\", cfA));\nchanges.add(new TableChange(MODIFY, \"AgentStat\", cfC));","handlingStrategy":"validation","validationCode":"Set<String> created = changeSet.getTableChanges().stream()\n    .filter(tc -> tc.getType() == ChangeType.CREATE)\n    .map(TableChange::getName).collect(Collectors.toSet());\nfor (TableChange tc : changeSet.getTableChanges()) {\n    if (tc.getType() == ChangeType.MODIFY && !created.contains(tc.getName())) {\n        throw new IllegalArgumentException(\"MODIFY before CREATE for table \" + tc.getName());\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    manager.applyChangeSet(changeSet);\n} catch (InvalidHbaseSchemaException e) {\n    if (e.getCause() instanceof IllegalArgumentException iae) {\n        logger.error(\"Modify of unregistered table: {}\", iae.getMessage());\n    }\n}","preventionTips":["Ensure the CREATE change set for a table precedes MODIFY change sets and is never filtered out on fresh installations.","Verify table names (namespace + name) match exactly between CREATE and MODIFY entries.","For fresh environments, run the full change set chain from the first CREATE."],"tags":["hbase","schema-migration","missing-table"],"backgroundTag":"resource-not-found","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"}