{"record":{"id":"ffd768467f9b8854","repo":"puppetlabs/puppet","slug":"a-duplicate-resource-was-found-while-collecting-ex","errorCode":null,"errorMessage":"A duplicate resource was found while collecting exported resources, with the type and title %{title}","messagePattern":"A duplicate resource was found while collecting exported resources, with the type and title %(.+?)","errorType":"exception","errorClass":"Puppet::ParseError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/evaluator/collectors/exported_collector.rb","lineNumber":51,"sourceCode":"\n    time = Puppet::Util.thinmark do\n      t = @type\n      q = @cquery\n\n      resources = scope.compiler.resources.find_all do |resource|\n        resource.type == t && resource.exported? && (q.nil? || q.call(resource))\n      end\n\n      found = Puppet::Resource.indirection\n                              .search(@type, :host => @scope.compiler.node.name, :filter => @equery, :scope => @scope)\n\n      found_resources = found.map { |x| x.is_a?(Puppet::Parser::Resource) ? x : x.to_resource(@scope) }\n\n      found_resources.each do |item|\n        existing = @scope.findresource(item.resource_type, item.title)\n        if existing\n          unless existing.collector_id == item.collector_id\n            raise Puppet::ParseError,\n                  _(\"A duplicate resource was found while collecting exported resources, with the type and title %{title}\") % { title: item.ref }\n          end\n        else\n          item.exported = false\n          @scope.compiler.add_resource(@scope, item)\n          resources << item\n        end\n      end\n    end\n\n    scope.debug(\"Collected %s %s resource%s in %.2f seconds\" %\n                [resources.length, @type, resources.length == 1 ? \"\" : \"s\", time])\n\n    resources\n  end\n\n  def to_s\n    \"Exported-Collector[#{@type}]\"","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/evaluator/collectors/exported_collector.rb#L33-L69","documentation":"Error \"A duplicate resource was found while collecting exported resources, with the type and title %{title}\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/evaluator/collectors/exported_collector.rb:51 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}