{"record":{"id":"a096a851cbdb708c","repo":"pinpoint-apm/pinpoint","slug":"fromapplicationnames-and-fromservicetypecodes-must-a096a8","errorCode":null,"errorMessage":"fromApplicationNames and fromServiceTypeCodes must have the same number of elements","messagePattern":"fromApplicationNames and fromServiceTypeCodes 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":309,"sourceCode":"            @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)\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);","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/ServerMapHistogramController.java#L291-L327","documentation":"ServerMapHistogramController.getNodeHistogramData zips fromApplicationNames with fromServiceTypeCodes into source Applications. Mismatched list lengths make pairing impossible, so it throws IllegalArgumentException before querying.","triggerScenarios":"Calling the /serverMapHistogram/statistics endpoint where fromApplicationNames and fromServiceTypeCodes request parameters contain different numbers of comma-separated entries.","commonSituations":"Scripts appending one list but not the other, UI filters with incomplete from-node entries, retry logic that partially updated query parameters.","solutions":["Make both lists equal length and index-aligned before sending","Validate lengths client-side and reject incomplete pairs","Regenerate the query from a single source of truth (the map response) instead of editing strings"],"exampleFix":"// before\n?fromApplicationNames=a,b,c&fromServiceTypeCodes=1010,1010\n// after\n?fromApplicationNames=a,b,c&fromServiceTypeCodes=1010,1010,1010","handlingStrategy":"validation","validationCode":"if (fromApplicationNames.size() != fromServiceTypeCodes.size()) {\n    throw new IllegalArgumentException(\"from 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":["Serialize from-pairs from a single List<Application>-like structure","Validate list lengths in a shared request builder","Add client-side tests for multi-value parameter construction"],"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"}