{"record":{"id":"1a36f697ca001afd","repo":"pinpoint-apm/pinpoint","slug":"calltree-corrupted","errorCode":null,"errorMessage":"CallTree corrupted","messagePattern":"CallTree corrupted","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"web/src/main/java/com/navercorp/pinpoint/web/trace/service/TransactionInfoServiceImpl.java","lineNumber":324,"sourceCode":"            }\n        }\n        return null;\n    }\n\n    private class SpanAlignPopulate {\n        private List<Record> populateSpanRecord(CallTreeIterator callTreeIterator) {\n            Objects.requireNonNull(callTreeIterator, \"callTreeIterator\");\n\n            final List<Record> recordList = new ArrayList<>(callTreeIterator.size() * 2);\n            final RecordFactory factory = recordFactoryProvider.getRecordFactory();\n\n            // annotation id has nothing to do with spanAlign's seq and thus may be incremented as long as they don't overlap.\n            while (callTreeIterator.hasNext()) {\n                final CallTreeNode node = callTreeIterator.next();\n                if (node == null) {\n                    logger.warn(\"Corrupt CallTree found : {}\", callTreeIterator);\n                    throw new IllegalStateException(\"CallTree corrupted\");\n                }\n                final Align align = node.getAlign();\n\n                if (metaDataFilter != null && metaDataFilter.filter(align, MetaData.API)) {\n                    if (align.isSpan()) {\n                        Record record = metaDataFilter.createRecord(node, factory);\n                        recordList.add(record);\n                    }\n                    continue;\n                }\n\n                if (metaDataFilter != null && metaDataFilter.filter(align, MetaData.PARAM)) {\n                    metaDataFilter.replaceAnnotationBo(align, MetaData.PARAM);\n                }\n\n                final Record record = factory.get(node);\n                recordList.add(record);\n\n                // add error category record.(span only)","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/web/src/main/java/com/navercorp/pinpoint/web/trace/service/TransactionInfoServiceImpl.java#L306-L342","documentation":"Thrown while rebuilding the call tree of a transaction from span/spanEvent records in TransactionInfoServiceImpl. The CallTreeIterator returned a null node while walking the tree, which the code treats as proof that the in-memory CallTree structure is corrupt (broken parent/child links). This is an internal invariant violation of Pinpoint's server-side trace assembly, not something a caller can cause via input parameters.","triggerScenarios":"populateSpanRecord() iterates callTreeIterator.hasNext()/next(); if next() yields null the method throws IllegalStateException(\"CallTree corrupted\") immediately.","commonSituations":"Corrupted or malformed span data fetched from HBase; span events with inconsistent parent/child spanIds or seq values; bugs in CallTree construction (spanAlign ordering) after collector-side data anomalies; partial reads from storage.","solutions":["Inspect the offending transaction's span/spanEvent records (spanId, parentSpanId, seq, depth) in storage for anomalies.","Upgrade Pinpoint web to a version with CallTree construction fixes; check release notes for calltree-related patches.","Wrap the transaction detail rendering for that trace so a single corrupt trace returns a clear error instead of breaking the page.","Re-ingest the trace from the agent if the stored span data itself is truncated or corrupt."],"exampleFix":"// before\nfinal CallTreeNode node = callTreeIterator.next();\nfinal Align align = node.getAlign();\n// after\nfinal CallTreeNode node = callTreeIterator.next();\nif (node == null) {\n    logger.warn(\"Corrupt CallTree found : {}\", callTreeIterator);\n    continue; // or skip trace rendering with a user-facing error\n}\nfinal Align align = node.getAlign();","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    populateSpanRecord(recordList, callTreeIterator, ...);\n} catch (IllegalStateException e) {\n    logger.error(\"Failed to render trace {} : corrupt call tree\", transactionId, e);\n    throw new TransactionLookupException(transactionId, e);\n}","preventionTips":["Keep Pinpoint web/collector versions aligned to avoid call-tree assembly bugs.","Alert on 'Corrupt CallTree found' warnings and audit the affected traces' span data.","Never re-order or filter spanAlign lists before CallTree construction."],"tags":["java","calltree","invariant","trace"],"backgroundTag":"internal-invariant-violation","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"}