pinpoint-apm/pinpoint · error · IllegalArgumentException
Cannot modify a non-existent table :
Error message
Cannot modify a non-existent table :
What it means
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.
Source
Thrown at hbase/hbase-schema/src/main/java/com/navercorp/pinpoint/hbase/schema/core/command/HbaseSchemaCommandManager.java:123
private void applyTableChange(TableChange tableChange) {
ChangeType changeType = tableChange.getType();
TableName tableName = TableName.valueOf(namespace, tableChange.getName());
switch (changeType) {
case CREATE -> {
if (tableCommandMap.containsKey(tableName)) {
throw new IllegalArgumentException("Cannot create an existing table : " + tableName);
}
TableCommand createTableCommand = new CreateTableCommand(tableName, compressionAlgorithm, tableChange.getSplitKeys());
createTableCommand.applyConfiguration(tableChange.getTableConfiguration());
createTableCommand.applyColumnFamilyChanges(tableChange.getColumnFamilyChanges());
tableCommandMap.put(tableName, createTableCommand);
}
case MODIFY -> {
TableCommand tableCommand = tableCommandMap.get(tableName);
if (tableCommand == null) {
throw new IllegalArgumentException("Cannot modify a non-existent table : " + tableName);
}
tableCommand.applyConfiguration(tableChange.getTableConfiguration());
tableCommand.applyColumnFamilyChanges(tableChange.getColumnFamilyChanges());
}
default ->
throw new UnsupportedOperationException("Invalid change type : " + changeType);
}
affectedTables.add(tableName);
}
public List<TableCommand> getCommands() {
return tableCommandMap.entrySet().stream()
.filter(e -> affectedTables.contains(e.getKey()))
.map(Map.Entry::getValue)
.collect(Collectors.toList());
}
public List<TableDescriptor> getSchemaSnapshot() {View on GitHub (pinned to 744c3d3075)
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.
Example fix
// before changes.add(new TableChange(MODIFY, "AgentStat", cfC)); // AgentStat never created in this run // after changes.add(new TableChange(CREATE, "AgentStat", cfA)); changes.add(new TableChange(MODIFY, "AgentStat", cfC));
Defensive patterns
Strategy: validation
Validate before calling
Set<String> created = changeSet.getTableChanges().stream()
.filter(tc -> tc.getType() == ChangeType.CREATE)
.map(TableChange::getName).collect(Collectors.toSet());
for (TableChange tc : changeSet.getTableChanges()) {
if (tc.getType() == ChangeType.MODIFY && !created.contains(tc.getName())) {
throw new IllegalArgumentException("MODIFY before CREATE for table " + tc.getName());
}
} Try / catch
try {
manager.applyChangeSet(changeSet);
} catch (InvalidHbaseSchemaException e) {
if (e.getCause() instanceof IllegalArgumentException iae) {
logger.error("Modify of unregistered table: {}", iae.getMessage());
}
} Prevention
- 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.
When it happens
Trigger: Calling applyChangeSet with a MODIFY TableChange whose table name does not match any CREATE TableChange previously applied in the same schema initialization run.
Common situations: 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.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Unexpected schema change log id, expected :
- Unexpected schema change log check sum for :
- Unexpected schema change log execution order for
- Error applying changeSet :
- Cannot create an existing table :
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/3f0b13383ac00043.
Report an issue: GitHub.