{"record":{"id":"e71a3aae6f7b6510","repo":"pinpoint-apm/pinpoint","slug":"invalid-or-undefined-service-type-for-application","errorCode":null,"errorMessage":"Invalid or undefined service type for application: ","messagePattern":"Invalid or undefined service type for application: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/ServerMapHistogramController.java","lineNumber":281,"sourceCode":"    private Application newApplication(Service service, String nodeKey) {\n        if (!StringUtils.hasLength(nodeKey)) {\n            throw new IllegalArgumentException(\"Node key must not be null or empty\");\n        }\n        if (!NODE_KEY_VALIDATION_PATTERN.matcher(nodeKey).matches()) {\n            throw new IllegalArgumentException(\"Invalid node key format: \" + nodeKey);\n        }\n        String[] parts = NODE_DELIMITER_PATTERN.split(nodeKey, 2);\n        String applicationName = parts[0];\n        String serviceTypeName = parts[1];\n\n        ServiceType serviceType = null;\n        if (StringUtils.hasLength(serviceTypeName)) {\n            serviceType = registry.findServiceTypeByName(serviceTypeName);\n        }\n        if (serviceType != null && serviceType.getCode() != ServiceType.UNDEFINED.getCode()) {\n            return new Application(service, applicationName, serviceType);\n        }\n        throw new IllegalArgumentException(\"Invalid or undefined service type for application: \" + nodeKey);\n    }\n\n    @GetMapping(value = \"/statistics\", params = {\n            \"fromApplicationNames\", \"fromServiceTypeCodes\", \"toApplicationNames\", \"toServiceTypeCodes\"\n    })\n    public NodeHistogramSummaryView getNodeHistogramData(\n            @ServiceParam ServiceName serviceName,\n            @Valid @ModelAttribute\n            ApplicationForm appForm,\n            @Valid @ModelAttribute\n            RangeForm rangeForm,\n            @RequestParam(value = \"fromApplicationNames\", defaultValue = \"\", required = false)\n            List<String> fromApplicationNames,\n            @RequestParam(value = \"fromServiceTypeCodes\", defaultValue = \"\", required = false)\n            List<Integer> fromServiceTypeCodes,\n            @RequestParam(value = \"toApplicationNames\", defaultValue = \"\", required = false)\n            List<String> toApplicationNames,\n            @RequestParam(value = \"toServiceTypeCodes\", defaultValue = \"\", required = false)","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/ServerMapHistogramController.java#L263-L299","documentation":"After parsing a nodeKey, ServerMapHistogramController.newApplication resolves the service type by name from the registry and rejects keys whose service type is unknown or resolves to UNDEFINED, throwing IllegalArgumentException. This guarantees histogram statistics are only queried for applications with a concrete service type.","triggerScenarios":"A nodeKey whose serviceTypeName portion is not registered in the service type registry, or that resolves to ServiceType.UNDEFINED (e.g. key 'myApp^UNKNOWN_TYPE').","commonSituations":"Custom plugins missing on the web server, typos in the service type name part of the key, agent emitting a newer service type than the web module knows, stale UI state from a different deployment.","solutions":["Correct the serviceTypeName in the node key to a registered name (check the server's service-type descriptors)","Deploy the missing service-type plugin on the Pinpoint web server","Reuse node keys returned by the server map API rather than hand-writing them"],"exampleFix":"// before\nnodeKey = \"myApp^SrpingBoot\";\n// after\nnodeKey = \"myApp^SPRING_BOOT\";","handlingStrategy":"validation","validationCode":"ServiceType st = registry.findServiceTypeByName(typeName);\nif (st == null || st.getCode() == ServiceType.UNDEFINED.getCode()) {\n    throw new IllegalArgumentException(\"Unknown service type: \" + typeName);\n}","typeGuard":null,"tryCatchPattern":"try {\n    view = api.getNodeHistogramStatistics(nodeKey);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Invalid or undefined service type\")) {\n        // mark node as unresolvable and continue\n    } else throw e;\n}","preventionTips":["Use exact service type names from the server's service-type descriptor files","Keep custom plugins deployed on all Pinpoint web instances","Prefer passing serviceTypeCode with the name so both resolve consistently"],"tags":["servicetype","node-key","illegal-argument"],"backgroundTag":"resource-not-found","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}