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

  1. Rename one of the duplicate changeSet ids to a unique value
  2. Search all schema XML (and includes) for the offending id and deduplicate
  3. Adopt an id convention (e.g. date+table+seq) to avoid collisions across files
  4. 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

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


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/1170417cf7b96182. Report an issue: GitHub.