{"record":{"id":"664888677f1a3f04","repo":"pinpoint-apm/pinpoint","slug":"invalid-sourcekey-id","errorCode":null,"errorMessage":"invalid ${sourceKey}=${id}","messagePattern":"invalid (.+?)=(.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/mapper/OtlpTraceMapperUtils.java","lineNumber":199,"sourceCode":"            throw new IllegalArgumentException(\"no per-instance identifier — set service.instance.id (e.g. via uuidgen), k8s.pod.uid, container.id, or host.name. applicationName='\" + applicationName + \"'\");\n        }\n        if (!IdValidateUtils.validateId(applicationName, PinpointConstants.AGENT_ID_MAX_LEN)) {\n            throw new IllegalArgumentException(\"invalid agentId(derived from applicationName)=\" + applicationName);\n        }\n        return new AgentAuth(applicationName, resolveAgentName(agentNameOverride, applicationName));\n    }\n\n    private static AgentAuth toAgentAuth(String id, String sourceKey, String agentNameOverride) {\n        if (id.length() == 36) {\n            try {\n                final UUID uuid = UUID.fromString(id);\n                return new AgentAuth(Base64Utils.encode(uuid), resolveAgentName(agentNameOverride, id));\n            } catch (IllegalArgumentException ignore) {\n                // not a valid UUID string, fall through to treat as plain agentId\n            }\n        }\n        if (!IdValidateUtils.validateId(id, PinpointConstants.AGENT_ID_MAX_LEN)) {\n            throw new IllegalArgumentException(\"invalid \" + sourceKey + \"=\" + id);\n        }\n        return new AgentAuth(id, resolveAgentName(agentNameOverride, id));\n    }\n\n    private static AgentAuth toContainerAgentAuth(String containerId, String agentNameOverride) {\n        // Docker/containerd full ID: 64 lowercase hex chars (SHA256).\n        // Truncate to first 16 bytes → 22-char URL-safe Base64 (same format as UUID case).\n        if (containerId.length() == CONTAINER_ID_FULL_HEX_LEN) {\n            try {\n                final byte[] bytes = Base16Utils.decodeToBytes(containerId);\n                final byte[] prefix = Arrays.copyOf(bytes, AGENT_ID_HASH_PREFIX_BYTES);\n                return new AgentAuth(Base64Utils.encode(prefix), resolveAgentName(agentNameOverride, containerId));\n            } catch (IllegalArgumentException ignore) {\n                // not valid hex, fall through to treat as plain agentId\n            }\n        }\n        if (!IdValidateUtils.validateId(containerId, PinpointConstants.AGENT_ID_MAX_LEN)) {\n            throw new IllegalArgumentException(\"invalid \" + KEY_CONTAINER_ID + \"=\" + containerId);","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/mapper/OtlpTraceMapperUtils.java#L181-L217","documentation":"toAgentAuth converts a resolved identifier (e.g. a service.instance.id value) into an AgentAuth. It first tries to interpret 36-char values as UUIDs; failing that, it validates the raw id with IdValidateUtils (AGENT_ID_MAX_LEN). An id with disallowed characters or excessive length throws this IllegalArgumentException with the source attribute key named in the message.","triggerScenarios":"getAgentAuth passes a service.instance.id (or similar) value to toAgentAuth that is not a UUID and fails validateId — e.g. contains '-', '@', spaces, or is longer than AGENT_ID_MAX_LEN.","commonSituations":"service.instance.id set to values with hyphens (non-UUID style like 'pod-abc-123'), emails, or URNs (urn:uuid:... instead of the bare UUID).","solutions":["Set service.instance.id to either a valid agentId string or a bare 36-char UUID (uuidgen output, no urn: prefix)","Strip hyphens or disallowed characters from the id before export","Use k8s.pod.uid or container.id, which are hex and validate cleanly"],"exampleFix":"// before\nOTEL_RESOURCE_ATTRIBUTES=service.instance.id=urn:uuid:550e8400-e29b...\n// after\nOTEL_RESOURCE_ATTRIBUTES=service.instance.id=550e8400e29b41d4a716446655440000","handlingStrategy":"validation","validationCode":"if (!isUuid(id) && !IdValidateUtils.validateId(id, PinpointConstants.AGENT_ID_MAX_LEN)) {\n    throw new IllegalArgumentException(\"invalid identifier=\" + id);\n}","typeGuard":"boolean isValidInstanceId(String id) {\n    return (id.length() == 36 && UUID.fromString(id) != null) || IdValidateUtils.validateId(id, PinpointConstants.AGENT_ID_MAX_LEN);\n}","tryCatchPattern":null,"preventionTips":["Use bare uuidgen output for service.instance.id (no urn: prefix)","Avoid hyphenated non-UUID ids in identifier attributes","Prefer hex ids (pod uid, container id) which validate cleanly"],"tags":["otlp","validation","identifier"],"backgroundTag":"invalid-identifier-format","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"}