{"record":{"id":"9b9b2fe8c7ed8a13","repo":"puppetlabs/puppet","slug":"module-name-version-requested-installat","errorCode":null,"errorMessage":"'%{module_name}' (%{version}) requested; installation conflict","messagePattern":"'%(.+?)' \\(%(.+?)\\) requested; installation conflict","errorType":"exception","errorClass":"Puppet::ModuleTool::Errors::InstallConflictError","httpStatus":null,"severity":"error","filePath":"lib/puppet/module_tool/applications/installer.rb","lineNumber":211,"sourceCode":"              :unsatisfied => unsatisfied\n            )\n          end\n\n          unless forced?\n            # Check for module name conflicts.\n            releases.each do |rel|\n              installed_module = installed_modules_source.by_name[rel.name.split('-').last]\n              next unless installed_module\n              next if installed_module.has_metadata? && installed_module.forge_name.tr('/', '-') == rel.name\n\n              if rel.name != name\n                dependency = {\n                  :name => rel.name,\n                  :version => rel.version\n                }\n              end\n\n              raise InstallConflictError,\n                    :requested_module => name,\n                    :requested_version => options[:version] || 'latest',\n                    :dependency => dependency,\n                    :directory => installed_module.path,\n                    :metadata => installed_module.metadata\n            end\n          end\n\n          Puppet.info _(\"Preparing to install ...\")\n          releases.each(&:prepare)\n\n          Puppet.notice _('Installing -- do not interrupt ...')\n          releases.each do |release|\n            installed = installed_modules[release.name]\n            if forced? || installed.nil?\n              release.install(Pathname.new(results[:install_dir]))\n            else\n              release.install(Pathname.new(installed.mod.modulepath))","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/applications/installer.rb#L193-L229","documentation":"Installer raises Puppet::ModuleTool::InstallConflictError during the pre-install conflict check: a release in the resolved set maps to a short name that collides with a directory on the modulepath, but the installed module's forge name differs (i.e. a different author's module occupies that directory name). dependency is set when the colliding release is a transitive dependency rather than the requested module; directory and metadata of the existing module are included.","triggerScenarios":"Thrown at lib/puppet/module_tool/applications/installer.rb:211 when the library encounters an invalid state.","commonSituations":"Two teams maintaining same-named modules internally and from the Forge; installing a Forge fork under a different author slug over an existing module directory; leftover directories from renamed modules on shared modulepaths.","solutions":["Uninstall or remove the existing conflicting module from that modulepath directory first.","If both are legitimately needed, relocate one to a different modulepath entry prioritized for that environment.","Verify you are installing the intended author slug (check the error's :directory and :metadata to identify the incumbent).","Use --force only if you accept overwriting the other module's directory."],"exampleFix":"# before\npuppet module install acme-stdlib   # site-modules/stdlib holds puppetlabs-stdlib\n\n# after\npuppet module uninstall puppetlabs-stdlib && puppet module install acme-stdlib","handlingStrategy":"validation","validationCode":"shortname = release_name.split('-').last\nexisting = environment.modules.find { |m| File.basename(m.path) == shortname }\nif existing && existing.forge_name&.tr('/', '-') != release_name\n  abort \"directory #{shortname} already holds #{existing.forge_name}; uninstall first\"\nend","typeGuard":null,"tryCatchPattern":"begin\n  installer.run\nrescue Puppet::ModuleTool::InstallConflictError => e\n  # e.multiline_options carries :directory and :dependency\n  handle_conflict(e.multiline_options[:directory])\nend","preventionTips":["Standardize on a single source (Forge or internal fork) per module shortname.","Before installing a fork, uninstall the incumbent module or move it off the modulepath.","In CI, assert that modulepath shortnames map 1:1 to expected forge names."],"tags":["puppet","module-tool","install","name-collision","modulepath"],"backgroundTag":"package-directory-conflict","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}