{"record":{"id":"c24b4aea4ec8a1d3","repo":"puppetlabs/puppet","slug":"message-on-node-node","errorCode":null,"errorMessage":"%{message} on node %{node}","messagePattern":"%(.+?) on node %(.+?)","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/parser/compiler.rb","lineNumber":44,"sourceCode":"    errors = node.environment.validation_errors\n    unless errors.empty?\n      errors.each { |e| Puppet.err(e) } if errors.size > 1\n      errmsg = [\n        _(\"Compilation has been halted because: %{error}\") % { error: errors.first },\n        _(\"For more information, see https://puppet.com/docs/puppet/latest/environments_about.html\")\n      ]\n      raise(Puppet::Error, errmsg.join(' '))\n    end\n\n    new(node, :code_id => code_id).compile(&:to_resource)\n  rescue Puppet::ParseErrorWithIssue => detail\n    detail.node = node.name\n    Puppet.log_exception(detail)\n    raise\n  rescue => detail\n    message = _(\"%{message} on node %{node}\") % { message: detail, node: node.name }\n    Puppet.log_exception(detail, message)\n    raise Puppet::Error, message, detail.backtrace\n  end\n\n  attr_reader :node, :facts, :collections, :catalog, :resources, :relationships, :topscope\n  attr_reader :qualified_variables\n\n  # Access to the configured loaders for 4x\n  # @return [Puppet::Pops::Loader::Loaders] the configured loaders\n  # @api private\n  attr_reader :loaders\n\n  # The id of code input to the compiler.\n  # @api private\n  attr_accessor :code_id\n\n  # Add a collection to the global list.\n  def_delegator :@collections,   :<<, :add_collection\n  def_delegator :@relationships, :<<, :add_relationship\n","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/compiler.rb#L26-L62","documentation":"Puppet::Parser::Compiler.compile wraps the whole catalog compile: any exception that is not a Puppet::ParseErrorWithIssue (e.g. a raw Ruby error raised inside a custom function, fact or Ruby template) is caught, logged with its own class and backtrace via Puppet.log_exception, then re-raised as Puppet::Error with 'on node <certname>' appended. This is a context wrapper, not a root cause.","triggerScenarios":"A custom Ruby function raising NoMethodError/TypeError during compile; broken external data lookups; Ruby incompatibilities in module code (e.g. Ruby 3 keyword-argument changes) surfacing during compilation.","commonSituations":"Puppet/Ruby major upgrades breaking third-party module functions; bugs in in-module Ruby code; corrupted facts causing deep code to fail.","solutions":["Find the original exception first - it was logged just above this error with its own class and backtrace","Reproduce with --trace to get the Ruby backtrace of the underlying failure","Fix the root cause in the function/module the backtrace points to","If you need the node-stripped message, remove the trailing ' on node <name>'"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"begin\n  Puppet::Parser::Compiler.compile(node)\nrescue Puppet::Error => e\n  root = e.message.sub(/ on node .+\\z/, '')\n  report(node.name, root, e.backtrace)\n  raise\nend","preventionTips":["Always check the log lines above this error - the original exception with its own backtrace is logged before wrapping","Compile catalogs with --trace and in CI (rspec-puppet) to catch Ruby-level failures early","Pin module versions and test them against new Puppet/Ruby versions before upgrade"],"tags":["puppet","compiler","catalog","error-context","ruby"],"backgroundTag":"catalog-compilation-failed","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}