{"record":{"id":"22b2a105af4eb4de","repo":"pinpoint-apm/pinpoint","slug":"error-computing-md5-for-change-set-id","errorCode":null,"errorMessage":"Error computing md5 for change set id : ","messagePattern":"Error computing md5 for change set id : ","errorType":"exception","errorClass":"HbaseSchemaParseException","httpStatus":null,"severity":"error","filePath":"hbase/hbase-schema/src/main/java/com/navercorp/pinpoint/hbase/schema/reader/xml/mapper/ChangeSetMapper.java","lineNumber":62,"sourceCode":"        this.jaxbContext = Objects.requireNonNull(jaxbContext, \"jaxbContext\");\n        this.schema = schema;\n        this.tableChangeMapper = new TableChangeMapper();\n    }\n\n    public ChangeSet mapChangeSet(com.navercorp.pinpoint.hbase.schema.definition.xml.ChangeSet changeSet) {\n        try {\n            StringWriter stringWriter = new StringWriter(); // no need to close StringWriter\n            createMarshaller().marshal(changeSet, stringWriter);\n            String value = stringWriter.toString();\n\n            List<TableChange> tableChangeList = mapTableChanges(changeSet.getModifyTable(), changeSet.getCreateTable());\n            return new ChangeSet(changeSet.getId(), value, tableChangeList);\n        } catch (JAXBException e) {\n            Throwable linkedException = e.getLinkedException();\n            if (linkedException == null) {\n                throw new IllegalStateException(\"JAXB error\", e);\n            }\n            throw new HbaseSchemaParseException(\"Error computing md5 for change set id : \" + changeSet.getId(), linkedException);\n        }\n    }\n\n    private Marshaller createMarshaller() throws JAXBException {\n        Marshaller marshaller = jaxbContext.createMarshaller();\n        marshaller.setSchema(schema);\n        marshaller.setProperty(Marshaller.JAXB_ENCODING, \"UTF-8\");\n        marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);\n        return marshaller;\n    }\n\n    private List<TableChange> mapTableChanges(List<com.navercorp.pinpoint.hbase.schema.definition.xml.ChangeSet.ModifyTable> modifyTables,\n                                              List<com.navercorp.pinpoint.hbase.schema.definition.xml.ChangeSet.CreateTable> createTables) {\n        if (modifyTables.isEmpty() && createTables.isEmpty()) {\n            return Collections.emptyList();\n        }\n        List<TableChange> tableChanges = new ArrayList<>(modifyTables.size() + createTables.size());\n        for (com.navercorp.pinpoint.hbase.schema.definition.xml.ChangeSet.ModifyTable modifyTable : modifyTables) {","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/hbase/hbase-schema/src/main/java/com/navercorp/pinpoint/hbase/schema/reader/xml/mapper/ChangeSetMapper.java#L44-L80","documentation":"ChangeSetMapper.mapChangeSet marshals the parsed change set back to XML to compute its md5 checksum. If a JAXBException with a linked exception occurs during this round-trip, the linked cause is wrapped in a HbaseSchemaParseException mentioning the change set id. (A JAXBException with no linked exception becomes a plain IllegalStateException \"JAXB error\".)","triggerScenarios":"JAXB marshalling/validation failure with a linked exception while recomputing a changeSet's checksum — e.g. content that violates the XML schema, or unmarshal-side errors surfaced with a cause during mapping.","commonSituations":"Change-set XML content that does not conform to the definition XSD (wrong element/attribute values); malformed XML caught during unmarshalling; JAXB version incompatibilities altering marshalling behavior.","solutions":["Inspect getLinkedException() in the stack trace — it names the actual XML/schema problem","Fix the offending changeSet XML element identified by the id in the message","Validate the schema XML against the JAXB XSD before loading","Ensure the JAXB runtime version matches the one the definitions were generated for"],"exampleFix":"// before\n<createTable name=\"AgentStat\">  <!-- missing required attribute -->\n// after\n<createTable name=\"AgentStat\" option=\"...\">  <!-- conforms to XSD -->","handlingStrategy":"try-catch","validationCode":"// validate XML against the XSD before the reader marshals it\nSchemaFactory f = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);\nValidator v = f.newSchema(xsd).newValidator();\nv.validate(new StreamSource(changeSetXml));","typeGuard":null,"tryCatchPattern":"try {\n    changeSets = schemaReader.loadChangeSets(resource);\n} catch (HbaseSchemaParseException e) {\n    if (e.getMessage().startsWith(\"Error computing md5\")) {\n        logger.error(\"Bad changeSet XML, id={}\", idFromMessage(e.getMessage()), e.getCause());\n    } else {\n        throw e;\n    }\n}","preventionTips":["Always inspect the linked cause — the message only names the changeSet id","Validate change-set XML against the definition XSD in CI","Keep the JAXB runtime version aligned with generated definition classes"],"tags":["hbase","xml","jaxb","checksum"],"backgroundTag":"xml-parse-error","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}