{"record":{"id":"806c7bfba232fcfc","repo":"puppetlabs/puppet","slug":"module-name-version-requested-installat-806c7b","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/upgrader.rb","lineNumber":163,"sourceCode":"            Puppet.info _(\"Resolving dependencies ...\")\n            releases = SemanticPuppet::Dependency.resolve(graph)\n          rescue SemanticPuppet::Dependency::UnsatisfiableGraph\n            raise NoVersionsSatisfyError, results.merge(:requested_name => name)\n          end\n\n          releases.each do |rel|\n            mod = installed_modules_source.by_name[rel.name.split('-').last]\n            next unless mod\n            next if mod.has_metadata? && mod.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 => mod.path,\n                  :metadata => mod.metadata\n          end\n\n          child = releases.find { |x| x.name == name }\n\n          unless forced?\n            if child.version == results[:installed_version]\n              versions = graph.dependencies[name].map(&:version)\n              newer_versions = versions.select { |v| v > results[:installed_version] }\n\n              raise VersionAlreadyInstalledError,\n                    :module_name => name,\n                    :requested_version => results[:requested_version],\n                    :installed_version => results[:installed_version],","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/applications/upgrader.rb#L145-L181","documentation":"Raised by the Upgrader as Puppet::ModuleTool::Errors::InstallConflictError during the pre-flight over resolved releases: for a release about to be installed, the corresponding directory (by short name, rel.name.split('-').last) is already occupied by an installed module whose forge_name does not match the release — i.e. two different modules claim the same directory name. The error carries :directory and :metadata of the squatter so you can see exactly what occupies the path.","triggerScenarios":"Upgrading module A pulls in dependency 'puppetlabs-apt', but the environment's 'apt' directory currently holds a differently-authored module (e.g. puppet-apt) or a module without matching metadata, so installing the release would overwrite foreign content.","commonSituations":"Hand-installed or community modules sharing short names with Forge modules; author renames (puppet-xxx to puppetlabs-xxx) leaving the old copy in place; manually created directories with the same name as a dependency; modules copied in without metadata.json (has_metadata? false).","solutions":["Read the error's :directory field and move or uninstall the occupying module: `puppet module uninstall <old-author-name>` or mv the directory aside","If the occupying content is unmanaged junk, delete the directory and rerun the upgrade","Prefer the Forge namespaced module and delete the third-party duplicate from the modulepath","Re-run `puppet module upgrade <name>` once the conflicting directory no longer holds a mismatched module"],"exampleFix":"# before\n$ puppet module upgrade puppetlabs-firewall\n# Error: 'puppetlabs-firewall' (latest) requested; installation conflict\n# ... /etc/puppetlabs/code/environments/production/modules/firewall\n\n# after\n$ mv modules/firewall modules/firewall-old-puppet\n$ puppet module upgrade puppetlabs-firewall","handlingStrategy":"try-catch","validationCode":"# Before upgrading, ensure every directory matching a release's short name is either absent or the same module\nshort = name.split('-').last\nexisting = env.modules.find { |m| m.name == short }\nif existing && !(existing.has_metadata? && existing.forge_name.tr('/', '-') == name)\n  abort \"directory '#{short}' is occupied by #{existing.forge_name || 'an unmanaged module'} — move it first\"\nend","typeGuard":null,"tryCatchPattern":"begin\n  Puppet::ModuleTool::Applications::Upgrader.new(name, options).run\nrescue Puppet::ModuleTool::Errors::InstallConflictError => e\n  # e.data[:directory] names the occupied path; quarantine it and retry\n  FileUtils.mv(conflicting_dir, \"#{conflicting_dir}.conflict\")\n  retry\nend","preventionTips":["Never hand-copy a community module into the modulepath next to its Forge namesake","After author renames, remove the old module's directory rather than leaving both","Keep unmanaged content out of environment module directories (use a separate data or site path)"],"tags":["puppet","module-tool","upgrade","install-conflict","modulepath","name-collision"],"backgroundTag":"install-path-conflict","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}