{"record":{"id":"8673f5546e30c82b","repo":"pinpoint-apm/pinpoint","slug":"agentindex-not-found-transactionid","errorCode":null,"errorMessage":"agentIndex not found:${transactionId}","messagePattern":"agentIndex not found:(.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"commons-profiler/src/main/java/com/navercorp/pinpoint/common/profiler/util/TransactionIdUtils.java","lineNumber":89,"sourceCode":"        final byte[] buffer = new byte[bufferSize];\n        buffer[0] = VERSION;\n        int offset = VERSION_SIZE;\n        // write prefix String\n        offset = BytesUtils.writeVar32(zigZagAgentIdLength, buffer, offset);\n        if (agentIdBytes != null) {\n            offset = BytesUtils.writeBytes(buffer, offset, agentIdBytes);\n        }\n        offset = BytesUtils.writeVar64(agentStartTime, buffer, offset);\n        BytesUtils.writeVar64(transactionSequence, buffer, offset);\n        return buffer;\n    }\n\n    public static TransactionId parseTransactionId(final String transactionId) {\n        Objects.requireNonNull(transactionId, \"transactionId\");\n\n        final int agentIdIndex = nextIndex(transactionId, 0);\n        if (agentIdIndex == -1) {\n            throw new IllegalArgumentException(\"agentIndex not found:\" + transactionId);\n        }\n        if (!IdValidateUtils.checkId(transactionId, 0, agentIdIndex)) {\n            throw new IllegalArgumentException(\"invalid transactionId:\" + transactionId);\n        }\n        final String agentId = transactionId.substring(0, agentIdIndex);\n\n        final int agentStartTimeIndex = nextIndex(transactionId, agentIdIndex + 1);\n        if (agentStartTimeIndex == -1) {\n            throw new IllegalArgumentException(\"agentStartTimeIndex not found:\" + transactionId);\n        }\n        final long agentStartTime = parseLong(transactionId, agentIdIndex + 1, agentStartTimeIndex);\n\n        int transactionSequenceIndex = nextIndex(transactionId, agentStartTimeIndex + 1);\n        if (transactionSequenceIndex == -1) {\n            // next index may not exist since default value does not have a delimiter after transactionSequence.\n            // may need fixing when id spec changes\n            transactionSequenceIndex = transactionId.length();\n        }","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/commons-profiler/src/main/java/com/navercorp/pinpoint/common/profiler/util/TransactionIdUtils.java#L71-L107","documentation":"TransactionIdUtils.parseTransactionId parses the Pinpoint transactionId string format agentId^agentStartTime^transactionSequence (delimiter-separated). If nextIndex finds no delimiter at position 0, the string has no separator and cannot contain an agentId, so an IllegalArgumentException with 'agentIndex not found:<id>' is thrown.","triggerScenarios":"Passing a transactionId string that contains no delimiter (the first nextIndex() over the default separator returns -1), e.g. calling TransactionIdUtils.parseTransactionId(\"abcdef1234\") or passing a UUID/timestamp instead of a Pinpoint-encoded transactionId.","commonSituations":"Parsing user-supplied or truncated transaction ids from logs/UI links that were URL-encoded or mangled (e.g. the '^' delimiter lost by shell, HTML or CSV processing); passing an internal numeric id where the formatted string was expected; version mismatch where an older/newer transactionId format is fed to this parser.","solutions":["Print/inspect the offending string and confirm it uses the expected delimiter-separated format (agentId^agentStartTime^transactionSequence).","URL-decode or un-escape the transactionId before parsing if it came from a web request or query string.","Only pass strings produced by TransactionIdUtils.formatTransactionId; validate the input (contains the delimiter, correct number of segments) before calling parseTransactionId."],"exampleFix":"// before\nTransactionId id = TransactionIdUtils.parseTransactionId(requestParam);\n// after\nif (transactionId.contains(TransactionIdUtils.TRANSACTION_ID_DELIMITER)) {\n    TransactionId id = TransactionIdUtils.parseTransactionId(requestParam);\n} else {\n    throw new IllegalArgumentException(\"Not a formatted pinpoint transactionId: \" + requestParam);\n}","handlingStrategy":"validation","validationCode":"boolean isParseable(String id) {\n    return id != null && !id.isEmpty()\n        && id.indexOf(TransactionIdUtils.TRANSACTION_ID_DELIMITER) > 0;\n}\n// call only if isParseable(rawId)","typeGuard":null,"tryCatchPattern":"try {\n    TransactionId id = TransactionIdUtils.parseTransactionId(rawId);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"agentIndex not found\")) {\n        logger.warn(\"Malformed transactionId (missing delimiter): {}\", rawId);\n    } else { throw e; }\n}","preventionTips":["Only pass strings produced by TransactionIdUtils.formatTransactionId.","URL-decode ids taken from query strings or HTML links before parsing.","Reject unformatted ids (UUIDs, timestamps) at the API boundary.","Log the raw string on failure to spot encoding/truncation issues early."],"tags":["java","parsing","transactionid","invalid-input"],"backgroundTag":"invalid-argument-format","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}