puppetlabs/puppet · error

Failed to call

Error message

Failed to call %{callback}: %{detail}

What it means

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.

Solutions

  1. Look at the detail portion to find the underlying failure in the callback (e.g. the service restart command)
  2. Fix the resource definition or provider that implements the callback
  3. Test the callback action manually (e.g. restart the service) to reproduce the error
  4. Check the resource's log output for the root cause
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at lib/puppet/transaction/event_manager.rb:160 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21). Data as JSON: /api/errors/9988d8e0a775aa74. Report an issue: GitHub.

Appendix: source

Thrown at lib/puppet/transaction/event_manager.rb:160

  #   associated with this callback and resource.
  # @return [true, false] Whether the callback was successfully run.
  def process_callback(resource, callback, events)
    unless process_callback?(resource, events)
      process_noop_events(resource, callback, events)
      return false
    end

    resource.send(callback)

    unless resource.is_a?(Puppet::Type.type(:whit))
      message = n_("Triggered '%{callback}' from %{count} event", "Triggered '%{callback}' from %{count} events", events.length) % { count: events.length, callback: callback }
      resource.notice message
      add_callback_status_event(resource, callback, message, "success")
    end

    true
  rescue => detail
    resource_error_message = _("Failed to call %{callback}: %{detail}") % { callback: callback, detail: detail }
    resource.err(resource_error_message)
    transaction.resource_status(resource).failed_to_restart = true
    transaction.resource_status(resource).fail_with_event(resource_error_message)
    resource.log_exception(detail)
    false
  end

  def add_callback_status_event(resource, callback, message, status)
    options = { message: message, status: status, name: callback.to_s }
    event = resource.event options
    transaction.resource_status(resource) << event if event
  end

  def process_noop_events(resource, callback, events)
    resource.notice n_("Would have triggered '%{callback}' from %{count} event", "Would have triggered '%{callback}' from %{count} events", events.length) % { count: events.length, callback: callback }

    # And then add an event for it.
    queue_events(resource, [resource.event(:status => "noop", :name => :noop_restart)])

View on GitHub (pinned to e227c27540)