Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2247641 - Failed to run hook 'emit_event_running' for action 'x'
Summary: Failed to run hook 'emit_event_running' for action 'x'
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hooks and Webhooks
Version: 6.14.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-11-02 14:14 UTC by Peter Ondrejka
Modified: 2023-11-02 14:42 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-02 14:42:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
production log excerpt (10.43 KB, text/plain)
2023-11-02 14:14 UTC, Peter Ondrejka
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SAT-21125 0 None None None 2023-11-02 14:17:56 UTC

Description Peter Ondrejka 2023-11-02 14:14:40 UTC
Created attachment 1996733 [details]
production log excerpt

Description of problem:
Webhooks are not triggered, tested with several types of actions, the trigger fails as follows (production_log):

2023-11-02T09:55:52 [I|app|264129ed] ForemanWebhooks::EventSubscriber: actions.remote_execution.run_hosts_job_running.event.foreman event received
2023-11-02T09:55:52 [I|app|264129ed]   Rendered /usr/share/gems/gems/foreman_remote_execution-10.0.7/app/views/api/v2/job_invocations/create.json.rabl (Duration: 23.8ms | Allocations: 15503)
2023-11-02T09:55:52 [I|app|264129ed] Completed 201 Created in 318ms (Views: 30.5ms | ActiveRecord: 83.8ms | Allocations: 118377)
2023-11-02T09:55:52 [E|dyn|264129ed] Failed to run hook 'emit_event_running' for action 'Actions::RemoteExecution::RunHostsJob'
2023-11-02T09:55:52 [E|dyn|264129ed] undefined method '#id' for Actions::RemoteExecution::RunHostsJob::Jail (Actions::RemoteExecution::RunHostsJob) (Safemode::NoMethodError)

(full excerpt will follow in attachment)

Version-Release number of selected component (if applicable):
6.14 snap 22

How reproducible:
always

Steps to Reproduce:
1. create any type of webhook for any type of action, e.g. rex job running
2. perform the action while watching tail -f /var/log/foreman/production.log

Actual results:
hook is not triggered

Expected results:
hook is triggered

Additional info:
- sadly the qe automation is looking just for 'event received' line in logs, which is present here, so the tests didn't catch it
- judging by https://bugzilla.redhat.com/show_bug.cgi?id=2180760#c6, this was not occurring around snap 6

Comment 1 Peter Ondrejka 2023-11-02 14:42:47 UTC
OK, the problem was caused by the safemode setting being on, which prevented the template rendering, which was expected. Without safemode, the webhook is triggered as expected. Thanks to ofedoren for quick turnaround.


Note You need to log in before you can comment on or make changes to this bug.