{"record":{"id":"1229c3eeace7e444","repo":"puppetlabs/puppet","slug":"puppet-resource-new-does-not-take-a-hash-as-the-f","errorCode":null,"errorMessage":"Puppet::Resource.new does not take a hash as the first argument. Did you mean (%{type}, %{title}) ?","messagePattern":"Puppet::Resource\\.new does not take a hash as the first argument\\. Did you mean \\(%(.+?), %(.+?)\\) \\?","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/resource.rb","lineNumber":303,"sourceCode":"        case v\n        when Puppet::Resource\n          v = v.copy_as_resource\n        when Array\n          # flatten resource references arrays\n          v = v.flatten if v.flatten.find { |av| av.is_a?(Puppet::Resource) }\n          v = v.collect do |av|\n            av = av.copy_as_resource if av.is_a?(Puppet::Resource)\n            av\n          end\n        end\n\n        self[p] = v\n      end\n      @sensitive_parameters.replace(type.sensitive_parameters)\n    else\n      if type.is_a?(Hash)\n        # TRANSLATORS 'Puppet::Resource.new' should not be translated\n        raise ArgumentError, _(\"Puppet::Resource.new does not take a hash as the first argument.\") + ' ' +\n                             _(\"Did you mean (%{type}, %{title}) ?\") %\n                             { type: (type[:type] || type[\"type\"]).inspect, title: (type[:title] || type[\"title\"]).inspect }\n      end\n\n      # In order to avoid an expensive search of 'known_resource_types\" and\n      # to obey/preserve the implementation of the resource's type - if the\n      # given type is a resource type implementation (one of):\n      #   * a \"classic\" 3.x ruby plugin\n      #   * a compatible implementation (e.g. loading from pcore metadata)\n      #   * a resolved user defined type\n      #\n      # ...then, modify the parameters to the \"old\" (agent side compatible) way\n      # of describing the type/title with string/symbols.\n      #\n      # TODO: Further optimizations should be possible as the \"type juggling\" is\n      # not needed when the type implementation is known.\n      #\n      if type.is_a?(Puppet::CompilableResourceType) || type.is_a?(Puppet::Resource::Type)","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/resource.rb#L285-L321","documentation":"Error \"Puppet::Resource.new does not take a hash as the first argument. Did you mean (%{type}, %{title}) ?\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/resource.rb:303 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"}