{"record":{"id":"9988d8e0a775aa74","repo":"puppetlabs/puppet","slug":"failed-to-call-callback-detail","errorCode":null,"errorMessage":"Failed to call %{callback}: %{detail}","messagePattern":"Failed to call %(.+?): %(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/puppet/transaction/event_manager.rb","lineNumber":160,"sourceCode":"  #   associated with this callback and resource.\n  # @return [true, false] Whether the callback was successfully run.\n  def process_callback(resource, callback, events)\n    unless process_callback?(resource, events)\n      process_noop_events(resource, callback, events)\n      return false\n    end\n\n    resource.send(callback)\n\n    unless resource.is_a?(Puppet::Type.type(:whit))\n      message = n_(\"Triggered '%{callback}' from %{count} event\", \"Triggered '%{callback}' from %{count} events\", events.length) % { count: events.length, callback: callback }\n      resource.notice message\n      add_callback_status_event(resource, callback, message, \"success\")\n    end\n\n    true\n  rescue => detail\n    resource_error_message = _(\"Failed to call %{callback}: %{detail}\") % { callback: callback, detail: detail }\n    resource.err(resource_error_message)\n    transaction.resource_status(resource).failed_to_restart = true\n    transaction.resource_status(resource).fail_with_event(resource_error_message)\n    resource.log_exception(detail)\n    false\n  end\n\n  def add_callback_status_event(resource, callback, message, status)\n    options = { message: message, status: status, name: callback.to_s }\n    event = resource.event options\n    transaction.resource_status(resource) << event if event\n  end\n\n  def process_noop_events(resource, callback, events)\n    resource.notice n_(\"Would have triggered '%{callback}' from %{count} event\", \"Would have triggered '%{callback}' from %{count} events\", events.length) % { count: events.length, callback: callback }\n\n    # And then add an event for it.\n    queue_events(resource, [resource.event(:status => \"noop\", :name => :noop_restart)])","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/transaction/event_manager.rb#L142-L178","documentation":"Raised by Transaction::EventManager#process_callback when invoking a resource's event callback (e.g. a subscribe/notify-triggered refresh like `restart`) raises an exception. The original error is captured as detail and re-raised as this Puppet::Error, meaning the resource's reaction to an event failed during the transaction.","triggerScenarios":"Thrown at lib/puppet/transaction/event_manager.rb:160 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Look at the detail portion to find the underlying failure in the callback (e.g. the service restart command)","Fix the resource definition or provider that implements the callback","Test the callback action manually (e.g. restart the service) to reproduce the error","Check the resource's log output for the root cause"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","contentChangedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}