puppetlabs/puppet · error · Puppet::ParseError

A duplicate resource was found while collecting exported res

Error message

A duplicate resource was found while collecting exported resources, with the type and title %{title}

What it means

Error "A duplicate resource was found while collecting exported resources, with the type and title %{title}" thrown in puppetlabs/puppet.

Source

Thrown at lib/puppet/pops/evaluator/collectors/exported_collector.rb:51

    time = Puppet::Util.thinmark do
      t = @type
      q = @cquery

      resources = scope.compiler.resources.find_all do |resource|
        resource.type == t && resource.exported? && (q.nil? || q.call(resource))
      end

      found = Puppet::Resource.indirection
                              .search(@type, :host => @scope.compiler.node.name, :filter => @equery, :scope => @scope)

      found_resources = found.map { |x| x.is_a?(Puppet::Parser::Resource) ? x : x.to_resource(@scope) }

      found_resources.each do |item|
        existing = @scope.findresource(item.resource_type, item.title)
        if existing
          unless existing.collector_id == item.collector_id
            raise Puppet::ParseError,
                  _("A duplicate resource was found while collecting exported resources, with the type and title %{title}") % { title: item.ref }
          end
        else
          item.exported = false
          @scope.compiler.add_resource(@scope, item)
          resources << item
        end
      end
    end

    scope.debug("Collected %s %s resource%s in %.2f seconds" %
                [resources.length, @type, resources.length == 1 ? "" : "s", time])

    resources
  end

  def to_s
    "Exported-Collector[#{@type}]"

View on GitHub (pinned to e227c27540)

When it happens

Trigger: Thrown at lib/puppet/pops/evaluator/collectors/exported_collector.rb:51 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21). Data as JSON: /api/errors/ffd768467f9b8854. Report an issue: GitHub.