{"record":{"id":"a28f3ad309744721","repo":"apache/skywalking","slug":"illegal-process-relation-entity-id","errorCode":null,"errorMessage":"Illegal Process Relation entity id","messagePattern":"Illegal Process Relation entity id","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/IDManager.java","lineNumber":336,"sourceCode":"            return Hashing.sha256().newHasher().putString(String.format(\"%s_%s\",\n                                                                        name, instanceId\n            ), Charsets.UTF_8).hash().toString();\n        }\n\n        /**\n         * @return encoded process relation id\n         */\n        public static String buildRelationId(ProcessRelationDefine define) {\n            return define.sourceId + Const.RELATION_ID_CONNECTOR + define.destId;\n        }\n\n        /**\n         * @return process relation ID object decoded from {@link #buildRelationId(ProcessRelationDefine)} result\n         */\n        public static ProcessRelationDefine analysisRelationId(String entityId) {\n            String[] parts = entityId.split(Const.RELATION_ID_PARSER_SPLIT);\n            if (parts.length != 2) {\n                throw new RuntimeException(\"Illegal Process Relation entity id\");\n            }\n            return new ProcessRelationDefine(parts[0], parts[1]);\n        }\n\n        @RequiredArgsConstructor\n        @Getter\n        @EqualsAndHashCode\n        public static class ProcessRelationDefine {\n            private final String sourceId;\n            private final String destId;\n        }\n    }\n\n    /**\n     * Network Address Alias ID related functions.\n     */\n    public static class NetworkAddressAliasDefine {\n        /**","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/apache/skywalking/blob/102af09b4a56064e22050dded10e2c52e490d040/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/IDManager.java#L318-L354","documentation":"RuntimeException thrown by IDManager.ProcessID.analysisRelationId(String) when a process-relation entity id does not split into exactly 2 parts. Process relation ids are produced by buildRelationId as sourceProcessId + RELATION_ID_CONNECTOR + destProcessId; the strict two-part decoder rejects everything else (bare RuntimeException, and note the id is not included in the message).","triggerScenarios":"Passing a hand-built process relation string with the wrong connector, a single process id, an id with 3+ segments, or null into analysisRelationId; corrupted rows from storage deserialization.","commonSituations":"Custom profiling or process-level analysis code constructing relation ids manually; tests with fabricated ids; storage rows damaged by partial writes or encoding migrations.","solutions":["Generate ids only via ProcessID.buildRelationId(ProcessRelationDefine) and decode only its output","At call sites, check entityId.split(REGEX).length == 2 (or wrap in try/catch) before decoding, since the message lacks the id","Log the raw entityId at the call site on failure to identify the producer","Repair or drop malformed relation rows in storage"],"exampleFix":"// before\nProcessID.analysisRelationId(processId); // single id -> throws\n\n// after\nString relId = IDManager.ProcessID.buildRelationId(\n    new ProcessRelationDefine(sourceProcId, destProcId));\nIDManager.ProcessID.analysisRelationId(relId);","handlingStrategy":"type-guard","validationCode":"if (entityId == null || entityId.split(\"\\\\.\").length != 2) {\n    throw new IllegalArgumentException(\"Not a process-relation id: \" + entityId);\n}","typeGuard":"boolean isProcessRelationId(String id) {\n    return id != null && id.split(\"\\\\.\").length == 2;\n}","tryCatchPattern":"try {\n    ProcessRelationDefine def = IDManager.ProcessID.analysisRelationId(entityId);\n} catch (RuntimeException e) {\n    LOGGER.warn(\"Dropping malformed process relation id: {}\", entityId, e);\n}","preventionTips":["Use ProcessID.buildRelationId exclusively in profiling-related customizations","The exception message omits the id — always log the input on catch","Validate storage exports before replaying process relations into another OAP"],"tags":["id-management","data-corruption","parsing","oap-server"],"backgroundTag":null,"analyzedSha":"102af09b4a56064e22050dded10e2c52e490d040","analyzedAt":"2026-08-14T10:47:52.647Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}