{"record":{"id":"2d0c204a971e8458","repo":"apache/skywalking","slug":"wrong-stack-data","errorCode":null,"errorMessage":"wrong stack data","messagePattern":"wrong stack data","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/profiling/trace/analyze/ProfileStack.java","lineNumber":45,"sourceCode":"import org.apache.skywalking.apm.network.language.profile.v3.ThreadStack;\nimport org.apache.skywalking.oap.server.core.profiling.trace.ProfileThreadSnapshotRecord;\n\n/**\n * Deserialize from {@link ProfileThreadSnapshotRecord}\n */\n@Data\npublic class ProfileStack implements Comparable<ProfileStack> {\n\n    private int sequence;\n    private long dumpTime;\n    private List<String> stack;\n\n    public static ProfileStack deserialize(ProfileThreadSnapshotRecord record) {\n        ThreadStack threadStack = null;\n        try {\n            threadStack = ThreadStack.parseFrom(record.getStackBinary());\n        } catch (InvalidProtocolBufferException e) {\n            throw new IllegalArgumentException(\"wrong stack data\");\n        }\n\n        // build data\n        ProfileStack stack = new ProfileStack();\n        stack.sequence = record.getSequence();\n        stack.dumpTime = record.getDumpTime();\n        stack.stack = threadStack.getCodeSignaturesList();\n\n        return stack;\n    }\n\n    @Override\n    public int compareTo(ProfileStack o) {\n        return Ints.compare(sequence, o.sequence);\n    }\n\n    @Override\n    public boolean equals(Object o) {","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/apache/skywalking/blob/102af09b4a56064e22050dded10e2c52e490d040/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/profiling/trace/analyze/ProfileStack.java#L27-L63","documentation":"ProfileStack.deserialize() converts a stored ProfileThreadSnapshotRecord into a ProfileStack by parsing record.getStackBinary() as a ThreadStack protobuf message. If the bytes are not a valid protobuf ThreadStack, parseFrom throws InvalidProtocolBufferException, which is rethrown as IllegalArgumentException('wrong stack data'). This occurs during profile analysis, i.e. when a user opens a profiling snapshot in the UI after the data was already persisted — the corruption happened upstream (agent or storage), not at query time.","triggerScenarios":"Querying/analyzing an eBPF- or JVM-thread profile whose stored stackBinary fails ThreadStack.parseFrom — truncated bytes, wrong schema version between agent and OAP, or storage-level corruption/mis-serialization.","commonSituations":"Agent/OAP version mismatch after upgrading one side (proto schema drift); mixed-protocol cluster writing snapshots with different proto definitions; partial writes or compression misconfiguration in storage; reading old snapshots after a schema change.","solutions":["Check the agent and OAP versions match (same apm-network proto for ProfileThreadSnapshot) — realign versions and re-capture the profile.","Start a new profiling task and verify the new snapshot analyzes; if it does, the old records were written by a mismatched version and can be ignored/deleted.","If new snapshots also fail, inspect the raw record (stackBinary length/content) in storage and check for truncated writes or disk issues.","Verify no mixed OAP versions in the cluster are processing the same profiling data."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { ProfileStack stack = ProfileStack.deserialize(record); } catch (IllegalArgumentException e) { if (\"wrong stack data\".equals(e.getMessage())) { log.warn(\"skipping corrupt snapshot seq={}\", record.getSequence()); return Optional.empty(); } throw e; }","preventionTips":["Keep agent and OAP versions in lockstep (same apm-network proto).","Upgrade one profile dataset fully before analyzing: re-capture profiles after version changes.","Handle corrupt snapshots as skippable per-record errors, not fatal query failures."],"tags":["profiling","protobuf","serialization","version-mismatch","query"],"backgroundTag":null,"analyzedSha":"102af09b4a56064e22050dded10e2c52e490d040","analyzedAt":"2026-08-14T10:47:52.647Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}