Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-42590

Webhooks that fail to render the template only visible in the logs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • Hooks and Webhooks
    • None
    • False
    • sat-endeavour
    • None
    • None
    • None
    • None

      Description of problem:

      When you have a webhook template that can't be rendered (for whatever reason), this fact is only visible in the logs but not in the Tasks result.

      (Related: SAT-20982)

      How reproducible:

      100%

      Is this issue a regression from an earlier version:

       

      Steps to Reproduce:

      1. create a webhook template with an error, like calling .to_json

      2. fire a webhook with that uses that template

       

      Actual behavior:

      2026-02-18T09:59:40 [I|app|10ef927d] ForemanWebhooks::EventSubscriber: actions.katello.content_view.promote_succeeded.event.foreman event received
      2026-02-18T09:59:40 [E|dyn|10ef927d] Failed to run hook 'emit_event_success' for action 'Actions::Katello::ContentView::Promote'
      2026-02-18T09:59:40 [E|dyn|10ef927d] undefined method '#to_json' for Actions::Katello::ContentView::Promote::Jail (Actions::Katello::ContentView::Promote) (Safemode::NoMethodError)
       10ef927d | /usr/share/gems/gems/safemode-1.5.0/lib/safemode/jail.rb:22:in `method_missing'
       10ef927d | Katello Promote JSON:53:in `initialize'
       10ef927d | /usr/share/gems/gems/safemode-1.5.0/lib/safemode.rb:52:in `eval'
       10ef927d | /usr/share/foreman/app/services/foreman/renderer/safe_mode_renderer.rb:7:in `render'
       10ef927d | /usr/share/foreman/app/services/foreman/renderer/base_renderer.rb:18:in `render'
       10ef927d | /usr/share/foreman/app/services/foreman/renderer.rb:46:in `render'
       10ef927d | /usr/share/foreman/app/models/template.rb:173:in `render'
       10ef927d | /usr/share/gems/gems/foreman_webhooks-4.0.2/app/models/webhook.rb:134:in `rendered_payload'
       10ef927d | /usr/share/gems/gems/foreman_webhooks-4.0.2/app/models/webhook.rb:70:in `deliver'
       10ef927d | /usr/share/gems/gems/foreman_webhooks-4.0.2/app/models/webhook.rb:48:in `block in deliver'
       10ef927d | /usr/share/gems/gems/activerecord-7.0.8.7/lib/active_record/relation/delegation.rb:88:in `each'
       10ef927d | /usr/share/gems/gems/foreman_webhooks-4.0.2/app/models/webhook.rb:47:in `deliver'
       10ef927d | /usr/share/gems/gems/foreman_webhooks-4.0.2/app/subscribers/foreman_webhooks/event_subscriber.rb:6:in `call'
       10ef927d | /usr/share/foreman/app/subscribers/foreman/base_subscriber.rb:6:in `call'
       10ef927d | /usr/share/gems/gems/activesupport-7.0.8.7/lib/active_support/notifications/fanout.rb:236:in `finish'
       10ef927d | /usr/share/gems/gems/activesupport-7.0.8.7/lib/active_support/notifications/fanout.rb:76:in `block in finish'
       10ef927d | /usr/share/gems/gems/activesupport-7.0.8.7/lib/active_support/notifications/fanout.rb:91:in `block in iterate_guarding_exceptions'
       10ef927d | /usr/share/gems/gems/activesupport-7.0.8.7/lib/active_support/notifications/fanout.rb:90:in `each'
       10ef927d | /usr/share/gems/gems/activesupport-7.0.8.7/lib/active_support/notifications/fanout.rb:90:in `iterate_guarding_exceptions'
       10ef927d | /usr/share/gems/gems/activesupport-7.0.8.7/lib/active_support/notifications/fanout.rb:76:in `finish'
       10ef927d | /usr/share/gems/gems/activesupport-7.0.8.7/lib/active_support/notifications/instrumenter.rb:49:in `finish_with_state'
       10ef927d | /usr/share/gems/gems/activesupport-7.0.8.7/lib/active_support/notifications/instrumenter.rb:30:in `instrument'
       10ef927d | /usr/share/gems/gems/activesupport-7.0.8.7/lib/active_support/notifications.rb:206:in `instrument'
       10ef927d | /usr/share/foreman/app/services/foreman/observable.rb:10:in `trigger_hook'
       10ef927d | /usr/share/gems/gems/foreman-tasks-11.0.6/app/lib/actions/observable_action.rb:69:in `emit_event'
       10ef927d | /usr/share/gems/gems/foreman-tasks-11.0.6/app/lib/actions/observable_action.rb:59:in `emit_event_success'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/execution_plan/hooks.rb:69:in `block (2 levels) in run'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/execution_plan/hooks.rb:67:in `each'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/execution_plan/hooks.rb:67:in `block in run'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/executors.rb:18:in `run_user_code'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/execution_plan/hooks.rb:66:in `run'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/execution_plan.rb:163:in `block (2 levels) in run_hooks'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware/stack.rb:28:in `pass'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware.rb:20:in `pass'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware.rb:57:in `hook'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware/stack.rb:24:in `call'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware/stack.rb:28:in `pass'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware.rb:20:in `pass'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware.rb:57:in `hook'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware/stack.rb:24:in `call'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware/stack.rb:28:in `pass'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware.rb:20:in `pass'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware.rb:57:in `hook'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware/stack.rb:24:in `call'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware/stack.rb:28:in `pass'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware.rb:20:in `pass'
       10ef927d | /usr/share/gems/gems/foreman-tasks-11.0.6/app/lib/actions/middleware/load_setting_values.rb:30:in `hook'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware/stack.rb:24:in `call'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware/stack.rb:28:in `pass'
       10ef927d | /usr/share/gems/gems/dynflow-1.9.3/lib/dynflow/middleware.rb:20:in `pass'
       10ef927d | /usr/share/gems/gems/foreman-tasks-11.0.6/app/lib/actions/middleware/keep_current_request_id.rb:26:in `block in hook'
       

       

      Expected behavior:
      The user can easily notice a failed webhook

      Business Impact / Additional info:

       

              Unassigned Unassigned
              egolov@redhat.com Evgeni Golov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: