{"record":{"id":"7bcfc515aa474f26","repo":"pinpoint-apm/pinpoint","slug":"duplicate-order-found-for-plugin-pluginid","errorCode":null,"errorMessage":"Duplicate order found for plugin : ${pluginId}","messagePattern":"Duplicate order found for plugin : (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/plugin/PluginJarsProvider.java","lineNumber":83,"sourceCode":"                                             final List<String> orderedPluginIdList) {\n        if (CollectionUtils.isEmpty(pluginJarPaths)) {\n            return Collections.emptyList();\n        }\n        List<PluginJar> pluginList = filter(pluginJarPaths, pluginFilter);\n\n        return sort(pluginList, orderedPluginIdList);\n    }\n\n    private List<PluginJar> sort(List<PluginJar> pluginList, List<String> orderedPluginIdList) {\n        Map<String, PluginJar> orderedPlugins = getOrderedPlugins(orderedPluginIdList);\n\n        List<PluginJar> unorderedPlugins = new ArrayList<>();\n        for (PluginJar pluginJar : pluginList) {\n            String pluginId = pluginJar.getPluginId();\n            if (orderedPlugins.containsKey(pluginId)) {\n                PluginJar prev = orderedPlugins.put(pluginId, pluginJar);\n                if (prev != null) {\n                    throw new IllegalStateException(\"Duplicate order found for plugin : \" + pluginId);\n                }\n            } else {\n                unorderedPlugins.add(pluginJar);\n            }\n        }\n        List<PluginJar> pluginJars = new ArrayList<>();\n        for (PluginJar orderedPlugin : orderedPlugins.values()) {\n            if (orderedPlugin != null) {\n                pluginJars.add(orderedPlugin);\n            }\n        }\n        pluginJars.addAll(unorderedPlugins);\n        return pluginJars;\n    }\n\n    private List<PluginJar> filter(List<Path> pluginJarPaths, PluginFilter pluginFilter) {\n        List<PluginJar> list = new ArrayList<>();\n        for (Path pluginJarPath : pluginJarPaths) {","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/plugin/PluginJarsProvider.java#L65-L101","documentation":"PluginJarsProvider.sort throws this IllegalStateException when two plugin jars resolve to the same explicit order value (same pluginId mapped twice into orderedPlugins with a non-null previous value). Plugin load order is deterministic per pluginId; duplicates make ordering ambiguous, so the provider fails fast instead of loading plugins in an unpredictable sequence.","triggerScenarios":"createPluginJars -> sort is called and two PluginJar entries share the same pluginId while also being registered in the ordered plugins map — i.e. duplicate plugin jars on the plugin directory or duplicate order keys in the plugin order configuration.","commonSituations":"Copying a plugin jar into the Pinpoint plugin directory twice (e.g. foo-plugin-1.0.jar and foo-plugin-1.1.jar producing the same pluginId), or mis-edited plugin order config listing the same plugin twice.","solutions":["Remove duplicate plugin jars from the agent's plugin directory, keeping only one jar per pluginId","Ensure only one version of each plugin is deployed (delete older jars)","Verify the plugin order configuration does not repeat a pluginId","Rebuild the custom plugin with a unique pluginId if two separate plugins collide"],"exampleFix":"// before\nplugin/\n  my-plugin-1.0.jar\n  my-plugin-1.1.jar   // duplicate pluginId -> IllegalStateException\n// after\nplugin/\n  my-plugin-1.1.jar   // keep only one jar per pluginId","handlingStrategy":"validation","validationCode":"Set<String> seen = new HashSet<>();\nfor (PluginJar jar : pluginList) {\n    if (!seen.add(jar.getPluginId())) {\n        logger.warn(\"Duplicate pluginId detected: {}\", jar.getPluginId());\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    List<PluginJar> jars = pluginJarsProvider.get();\n} catch (IllegalStateException e) {\n    logger.error(\"Duplicate plugin order detected: {}\", e.getMessage());\n    throw e;\n}","preventionTips":["Deploy exactly one jar per plugin in the agent's plugin directory","Delete old plugin versions when upgrading a plugin instead of leaving both jars","Give each custom plugin a unique pluginId at build time","Keep the plugin order configuration free of repeated pluginIds"],"tags":["plugin-loading","pinpoint-profiler","duplicate-jar"],"backgroundTag":"conflicting-config-options","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"}