{"record":{"id":"9eca7fb57da05eeb","repo":"pinpoint-apm/pinpoint","slug":"unknown-agenttype","errorCode":null,"errorMessage":"Unknown AgentType:","messagePattern":"Unknown AgentType:","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agent-module/bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/AgentType.java","lineNumber":58,"sourceCode":"\n    @Override\n    public String toString() {\n        return \"AgentType{\"\n                + className +\n                '}';\n    }\n\n    public static AgentType getAgentType(String agentTypeName) {\n        if (agentTypeName == null) {\n            return AgentType.DEFAULT_AGENT;\n        }\n\n        for (AgentType agentType : AgentType.values()) {\n            if (agentType.name().equalsIgnoreCase(agentTypeName)) {\n                return agentType;\n            }\n        }\n        throw new IllegalArgumentException(\"Unknown AgentType:\" + agentTypeName);\n    }\n\n    public static AgentType of(Function<String, String> agentArgs) {\n        String agentTypeString = agentArgs.apply(AGENT_TYPE_KEY);\n        if (agentTypeString == null) {\n            agentTypeString = AgentType.DEFAULT_AGENT.name();\n        }\n        return getAgentType(agentTypeString);\n    }\n}","sourceCodeStart":40,"sourceCodeEnd":68,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/AgentType.java#L40-L68","documentation":"AgentType.getAgentType(agentTypeName) iterates AgentType.values() with equalsIgnoreCase and throws IllegalArgumentException 'Unknown AgentType:<name>' when nothing matches. It is called from AgentType.of(agentArgs), which reads the agent-type key from the agent args, so an unrecognized or misspelled agentType string aborts agent initialization.","triggerScenarios":"Passing a value for AGENT_TYPE_KEY in the agent args (or -Dpinpoint.agentType) that is not one of the enum constants (case-insensitive), e.g. 'ANNOTATED_AGENT' when only DEFAULT_AGENT etc. exist, or an empty string.","commonSituations":"Upgrading Pinpoint where an old agentType name was removed or renamed; copying launch configs between agent editions (e.g. Google/Thrift variants); hand-edited JVM args with a typo; spaces around the value in a launcher script.","solutions":["Print the configured agentType value and compare against the AgentType enum constants of your Pinpoint version","Remove the agentType argument entirely to fall back to DEFAULT_AGENT","If you need a custom type, add an AgentType enum constant (with matching code) in your fork instead of passing an unknown string","Align the value with the docs for your exact Pinpoint version — names changed across releases"],"exampleFix":"// before\n-Dpinpoint.agentType=AGENT_TYPE_MAIN_SECURED\n// after\n-Dpinpoint.agentType=AGENT_TYPE (or omit to use DEFAULT_AGENT)","handlingStrategy":"validation","validationCode":"String requested = agentArgs.apply(AGENT_TYPE_KEY);\nif (requested != null && Arrays.stream(AgentType.values()).noneMatch(t -> t.name().equalsIgnoreCase(requested))) {\n    logger.warn(\"Unknown agentType '{}', falling back to DEFAULT_AGENT\", requested);\n    requested = AgentType.DEFAULT_AGENT.name();\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Trim and uppercase incoming agentType values before lookup","Fall back to DEFAULT_AGENT for unknown values in launch scripts","Re-validate agentType names after every Pinpoint upgrade"],"tags":["enum","configuration","java","agent-startup"],"backgroundTag":"invalid-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"}