{"record":{"id":"1c8a554394ef1554","repo":"pinpoint-apm/pinpoint","slug":"idkey-name-header-is-missing","errorCode":null,"errorMessage":"idKey.name()+ header is missing","messagePattern":"idKey\\.name\\(\\)\\+ header is missing","errorType":"exception","errorClass":"InvalidGrpcHeaderException","httpStatus":null,"severity":"error","filePath":"grpc/src/main/java/com/navercorp/pinpoint/grpc/server/HeaderExtractor.java","lineNumber":60,"sourceCode":"    }\n\n    public long getTime(Metadata headers, Metadata.Key<String> timeKey) {\n        final String timeStr = headers.get(timeKey);\n        if (timeStr == null) {\n            throw new InvalidGrpcHeaderException(timeKey, timeKey.name() + \" header is missing\");\n        }\n        try {\n            // check number format\n            return Long.parseLong(timeStr);\n        } catch (NumberFormatException e) {\n            throw new IllegalArgumentException(\"unsupported format\");\n        }\n    }\n\n    public String getId(Metadata headers, Metadata.Key<String> idKey) {\n        final String id = headers.get(idKey);\n        if (id == null) {\n            throw new InvalidGrpcHeaderException(idKey, idKey.name() + \" header is missing\");\n        }\n        return validateId(id, idKey);\n    }\n\n    public String getName(Metadata headers, Metadata.Key<String> idKey) {\n        return getName(headers, idKey, this.nameMaxLength);\n    }\n\n    public String getName(Metadata headers, Metadata.Key<String> idKey, int maxNameLength) {\n        final String name = headers.get(idKey);\n        if (!StringUtils.isEmpty(name)) {\n            final IdValidateUtils.CheckResult result = IdValidateUtils.checkId(name, defaultLength(maxNameLength, this.nameMaxLength));\n            if (result == IdValidateUtils.CheckResult.FAIL_PATTERN) {\n                throw new InvalidGrpcHeaderException(idKey, \"Invalid \" + idKey.name());\n            }\n            if (result == IdValidateUtils.CheckResult.FAIL_LENGTH) {\n                throw new InvalidGrpcHeaderException(idKey, \"Invalid \" + idKey.name() + \".length\");\n            }","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/grpc/src/main/java/com/navercorp/pinpoint/grpc/server/HeaderExtractor.java#L42-L78","documentation":"Thrown by HeaderExtractor.getId when the required agent-id gRPC header is absent entirely (headers.get(idKey) returns null). Unlike getTime's parse failure, the header was never sent, so agent identification cannot proceed. This is a validation guard on the incoming metadata; the faulting input is the missing idKey header, and clients must always populate the agent-id metadata key. Callers such as header-to-string diagnostics propagate this as InvalidGrpcHeaderException.","triggerScenarios":"Thrown at grpc/src/main/java/com/navercorp/pinpoint/grpc/server/HeaderExtractor.java:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the client attaches all mandatory headers before the RPC call","Update the client to the agent version that sends the expected header names","Return a clear INVALID_ARGUMENT status to the client on this exception"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}