{"record":{"id":"5d220dbad7d50324","repo":"puppetlabs/puppet","slug":"could-not-find-stage-stage-specified-by-resou","errorCode":null,"errorMessage":"Could not find stage %{stage} specified by %{resource}","messagePattern":"Could not find stage %(.+?) specified by %(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/parser/resource.rb","lineNumber":64,"sourceCode":"  def eachparam\n    @parameters.each do |_name, param|\n      yield param\n    end\n  end\n\n  def environment\n    scope.environment\n  end\n\n  # Process the  stage metaparameter for a class.   A containment edge\n  # is drawn from  the class to the stage.   The stage for containment\n  # defaults to main, if none is specified.\n  def add_edge_to_stage\n    return unless class?\n\n    stage = catalog.resource(:stage, self[:stage] || (scope && scope.resource && scope.resource[:stage]) || :main)\n    unless stage\n      raise ArgumentError, _(\"Could not find stage %{stage} specified by %{resource}\") % { stage: self[:stage] || :main, resource: self }\n    end\n\n    self[:stage] ||= stage.title unless stage.title == :main\n    catalog.add_edge(stage, self)\n  end\n\n  # Retrieve the associated definition and evaluate it.\n  def evaluate\n    return if evaluated?\n\n    Puppet::Util::Profiler.profile(_(\"Evaluated resource %{res}\") % { res: self }, [:compiler, :evaluate_resource, self]) do\n      @evaluated = true\n      if builtin_type?\n        devfail \"Cannot evaluate a builtin type (#{type})\"\n      elsif resource_type.nil?\n        self.fail \"Cannot find definition #{type}\"\n      else\n        finish_evaluation() # do not finish completely (as that destroys Sensitive data)","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/resource.rb#L46-L82","documentation":"Error \"Could not find stage %{stage} specified by %{resource}\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/parser/resource.rb:64 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"}