{"record":{"id":"165c772353a45035","repo":"pinpoint-apm/pinpoint","slug":"toapplicationnames-and-toservicetypecodes-must-hav-165c77","errorCode":null,"errorMessage":"toApplicationNames and toServiceTypeCodes must have the same number of elements","messagePattern":"toApplicationNames and toServiceTypeCodes must have the same number of elements","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/ServerMapHistogramController.java","lineNumber":313,"sourceCode":"            @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)\n            List<Integer> toServiceTypeCodes,\n            @RequestParam(value = \"useStatisticsAgentState\", defaultValue = \"true\", required = false)\n            boolean useStatisticsAgentState\n    ) {\n        final Range range = toRange(rangeForm);\n        this.rangeValidator.validate(range);\n        TimeWindow timeWindow = new TimeWindow(range);\n\n        if (fromApplicationNames.size() != fromServiceTypeCodes.size()) {\n            throw new IllegalArgumentException(\n                    \"fromApplicationNames and fromServiceTypeCodes must have the same number of elements\");\n        }\n        if (toApplicationNames.size() != toServiceTypeCodes.size()) {\n            throw new IllegalArgumentException(\n                    \"toApplicationNames and toServiceTypeCodes must have the same number of elements\");\n        }\n\n        final Service service = serviceModelResolver.getService(serviceName.getName());\n        final Application application = getApplication(service, appForm);\n\n        final List<Application> fromApplications = toApplications(service, fromApplicationNames, fromServiceTypeCodes);\n        final List<Application> toApplications = toApplications(service, toApplicationNames, toServiceTypeCodes);\n        final ResponseTimeHistogramServiceOption option = new ResponseTimeHistogramServiceOption\n                .Builder(application, timeWindow, fromApplications, toApplications)\n                .setUseStatisticsAgentState(useStatisticsAgentState)\n                .build();\n\n        final NodeHistogramSummary nodeHistogramSummary = responseTimeHistogramService.selectNodeHistogramData(option);\n\n        ServerGroupList serverGroupList = nodeHistogramSummary.getServerGroupList();\n        ServerGroupListView serverGroupListView = new ServerGroupListView(serverGroupList, hyperLinkFactory);\n        return new NodeHistogramSummaryView(nodeHistogramSummary, timeWindow, serverGroupListView, TimeHistogramView.TimeseriesHistogram);","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/ServerMapHistogramController.java#L295-L331","documentation":"ServerMapHistogramController.getNodeHistogramData pairs toApplicationNames with toServiceTypeCodes for target applications. When the lists differ in length it throws IllegalArgumentException at line 313, refusing to build a partial application list.","triggerScenarios":"Calling the /serverMapHistogram/statistics endpoint where toApplicationNames and toServiceTypeCodes contain different numbers of comma-separated values.","commonSituations":"Hand-edited query strings adding a destination app without its type code, generated clients deserializing an empty code entry, filters saved from an older UI schema.","solutions":["Ensure toApplicationNames and toServiceTypeCodes have identical, index-aligned lengths","Strip empty entries from both lists before sending","Fix the client code that constructs these parameters to always append both values together"],"exampleFix":"// before\n?toApplicationNames=svc1,svc2&toServiceTypeCodes=1210\n// after\n?toApplicationNames=svc1,svc2&toServiceTypeCodes=1210,1010","handlingStrategy":"validation","validationCode":"if (toApplicationNames.size() != toServiceTypeCodes.size()) {\n    throw new IllegalArgumentException(\"to list length mismatch\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    summary = api.getNodeHistogramStatistics(names, codes, toNames, toCodes);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"must have the same number of elements\")) {\n        logger.warn(\"Dropping request: {}\", e.getMessage());\n        return null;\n    } throw e;\n}","preventionTips":["Append name and code together when building destination lists","Reject incomplete pairs at input time rather than sending partial requests","Regenerate parameters from authoritative map responses instead of editing query strings manually"],"tags":["validation","illegal-argument","controller"],"backgroundTag":"invalid-argument-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"}