pinpoint-apm/pinpoint · error · IllegalStateException
Duplicate changeSet found. Id:
Error message
Duplicate changeSet found. Id:
What it means
XmlParseContext.addChangeSets keys change sets by id in changeSetMap; if two change sets share the same id, put returns the previous entry and an IllegalStateException is thrown. Change set ids must be unique because they are used for checksum/version tracking of applied schema changes.
Source
Thrown at hbase/hbase-schema/src/main/java/com/navercorp/pinpoint/hbase/schema/reader/xml/XmlParseContext.java:67
}
void setResource(Resource resource) {
this.resource = Objects.requireNonNull(resource, "resource");
if (visitedResources.contains(resource)) {
throw new IllegalStateException("Cyclic include detected for : " + resource);
}
visitedResources.add(resource);
}
void addChangeSets(Collection<ChangeSet> changeSets) {
if (CollectionUtils.isEmpty(changeSets)) {
return;
}
for (ChangeSet changeSet : changeSets) {
String changeSetId = changeSet.getId();
ChangeSet previous = changeSetMap.put(changeSetId, changeSet);
if (previous != null) {
throw new IllegalStateException("Duplicate changeSet found. Id: " + changeSetId);
}
}
}
List<ChangeSet> getChangeSets() {
return new ArrayList<>(changeSetMap.values());
}
}
View on GitHub (pinned to 744c3d3075)
Solutions
- Rename one of the duplicate changeSet ids to a unique value
- Search all schema XML (and includes) for the offending id and deduplicate
- Adopt an id convention (e.g. date+table+seq) to avoid collisions across files
- If the duplicate is from a stale branch merge, resolve the schema XML merge conflicts properly
Example fix
// before <changeSet id="create-agent-table">... <changeSet id="create-agent-table">... // after <changeSet id="create-agent-table">... <changeSet id="create-agent-table-v2">...
Defensive patterns
Strategy: validation
Validate before calling
Set<String> ids = new HashSet<>();
for (ChangeSet cs : allChangeSets) {
if (!ids.add(cs.getId())) {
throw new IllegalStateException("Duplicate changeSet id: " + cs.getId());
}
} Try / catch
try {
schemaReader.loadChangeSets(resource);
} catch (IllegalStateException e) {
if (e.getMessage().startsWith("Duplicate changeSet found")) {
// locate and rename the duplicated id across schema XML
} else {
throw e;
}
} Prevention
- Grep all schema XML for id=" duplicates before release
- Use unique, descriptive ids (table + operation + sequence)
- Include files can carry duplicates too — validate the merged set, not just single files
When it happens
Trigger: Two <changeSet> elements with the same id attribute across the schema XML (including files pulled in via <include>), passed to addChangeSets.
Common situations: Copy-pasting a changeSet block and forgetting to change the id; two included XML files each defining a changeSet with the same id; merging schema files from branches without deduplicating ids.
Related errors
- Cyclic include detected for :
- Cannot add an existing column family :
- splitKeys must not be empty
- numRegions must be greater than 1
- Error loading change sets from
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/1170417cf7b96182.
Report an issue: GitHub.