{"record":{"id":"759444ec0373cc07","repo":"pinpoint-apm/pinpoint","slug":"unknown-attribute-type-code-typecode","errorCode":null,"errorMessage":"Unknown attribute type code: ${typeCode}","messagePattern":"Unknown attribute type code: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/AttributeTranscoder.java","lineNumber":143,"sourceCode":"                int arraySize = buffer.readVInt();\n                List<AttributeValue> list = new ArrayList<>(arraySize);\n                for (int i = 0; i < arraySize; i++) {\n                    list.add(readValue(buffer));\n                }\n                return AttributeValue.of(list);\n            }\n            case TYPE_KVLIST: {\n                int kvSize = buffer.readVInt();\n                AttributeKeyValue[] kvArray = new AttributeKeyValue[kvSize];\n                for (int i = 0; i < kvSize; i++) {\n                    String key = buffer.readNullTerminatedString();\n                    AttributeValue val = readValue(buffer);\n                    kvArray[i] = AttributeKeyValue.of(key, val);\n                }\n                return AttributeValue.ofAttributeKeyValueList(kvArray);\n            }\n            default:\n                throw new IllegalStateException(\"Unknown attribute type code: \" + typeCode);\n        }\n    }\n}\n","sourceCodeStart":125,"sourceCodeEnd":147,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/AttributeTranscoder.java#L125-L147","documentation":"AttributeTranscoder.readValue() decodes a typed attribute value from a Buffer and, for a type code outside the known set, throws IllegalStateException('Unknown attribute type code'). Because this happens mid-buffer-parse, it signals either an unsupported/foreign type code or a desynchronized buffer position.","triggerScenarios":"Calling readValue (directly or via value()/val()) on bytes whose leading type-code byte is not a registered attribute type — from version skew between writer and reader, or from reading at the wrong buffer offset.","commonSituations":"Mixed-version clusters where new nodes write attribute codes old nodes cannot parse; corrupted attribute blobs in storage; manual buffer slicing bugs in custom code.","solutions":["Upgrade the reader's AttributeTranscoder to a version that knows the type code","Verify the buffer position is at the start of the attribute value before calling readValue","Log the raw typeCode and surrounding bytes to identify the writer/version","Fail gracefully per attribute instead of aborting the whole record read"],"exampleFix":"// before\nAttributeValue v = transcoder.readValue(buffer); // IllegalStateException on unknown code\n// after\nint code = buffer.readByte();\nif (!AttributeTranscoder.isKnownCode(code)) { log.warn(\"unknown attr code {}\", code); return null; }\nbuffer.reset();\nAttributeValue v = transcoder.readValue(buffer);","handlingStrategy":"try-catch","validationCode":"int code = peekTypeCode(buffer); if (!AttributeTranscoder.isKnownCode(code)) { log.warn(\"unknown attr code {}\", code); return null; }","typeGuard":null,"tryCatchPattern":"try { return transcoder.readValue(buffer); } catch (IllegalStateException e) { log.warn(\"attribute read failed: {}\", e.getMessage()); return null; }","preventionTips":["Ensure buffer position is at value start before readValue","Keep reader/writer versions in sync for attribute codes","Fail per-attribute, not per-record"],"tags":["java","serialization","attributes","buffer"],"backgroundTag":"unsupported-enum-value","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"}