{"record":{"id":"1abc175334486095","repo":"puppetlabs/puppet","slug":"found-multiple-files-for-plan-plan-name-but-o","errorCode":null,"errorMessage":"Found multiple files for plan '%{plan_name}' but only one is allowed","messagePattern":"Found multiple files for plan '%(.+?)' but only one is allowed","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/loader/generic_plan_instantiator.rb","lineNumber":12,"sourceCode":"# frozen_string_literal: true\n\nmodule Puppet::Pops\nmodule Loader\n# The GenericPlanInstantiator dispatches to either PuppetPlanInstantiator or a\n# yaml_plan_instantiator injected through the Puppet context, depending on\n# the type of the plan.\n#\nclass GenericPlanInstantiator\n  def self.create(loader, typed_name, source_refs)\n    if source_refs.length > 1\n      raise ArgumentError, _(\"Found multiple files for plan '%{plan_name}' but only one is allowed\") % { plan_name: typed_name.name }\n    end\n\n    source_ref = source_refs[0]\n    code_string = Puppet::FileSystem.read(source_ref, :encoding => 'utf-8')\n\n    instantiator = if source_ref.end_with?('.pp')\n                     Puppet::Pops::Loader::PuppetPlanInstantiator\n                   else\n                     Puppet.lookup(:yaml_plan_instantiator) do\n                       raise Puppet::DevError, _(\"No instantiator is available to load plan from %{source_ref}\") % { source_ref: source_ref }\n                     end\n                   end\n\n    instantiator.create(loader, typed_name, source_ref, code_string)\n  end\nend\nend\nend","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/loader/generic_plan_instantiator.rb#L1-L30","documentation":"Error \"Found multiple files for plan '%{plan_name}' but only one is allowed\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/loader/generic_plan_instantiator.rb:12 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"}