Bug 1421872

Summary: "Host not found for ID" message logs entire stack trace
Product: Red Hat Satellite Reporter: Chris Duryee <cduryee>
Component: Errata ManagementAssignee: Chris Duryee <cduryee>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.7CC: bbuckingham, cduryee, jcallaha, lhellebr
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chris Duryee 2017-02-13 22:36:47 UTC
Description of problem:

The "montior event queue" task will pull tasks off the event queue and kick off a generate applicability task. However, if it attempts to find a host that does not exist, it will log a message and then log a lengthy stack trace. The stack trace is not useful and makes it appear that bad things are happening when in fact it's likely fine that the host was not found.


Version-Release number of selected component (if applicable): 6.2.7

Steps to Reproduce:
1. in dynflow, disable "monitor event queue"
2. queue up an applicability regen for a host, confirm with "select count(*) from katello_events"
3. delete host
4. restart event queue job

Actual results: error with stack trace

Expected results: warning message instead of error, no stack trace


Additional info: this seems minor, but it logs 99 lines of message every time this happens.

Comment 1 Satellite Program 2017-02-13 23:14:17 UTC
Upstream bug assigned to cduryee

Comment 2 Satellite Program 2017-02-13 23:14:19 UTC
Upstream bug assigned to cduryee

Comment 3 Satellite Program 2017-02-14 17:14:12 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/18486 has been resolved.

Comment 8 Lukáš Hellebrandt 2018-01-03 15:02:36 UTC
Verified with Sat6.3 snap 30.

Used steps from comment 7. Only changed point 2 as it was wrong, the correct way to cancel the "monitor event queue" job is to run """
foreman-rake foreman_tasks:cleanup TASK_SEARCH='label = Actions::Katello::EventQueue::Monitor' STATES=running VERBOSE=true
""".

After running "service foreman-tasks restart", the following message is shown and is followed by traceback (full traceback in attachment):

2018-01-03 09:06:44  [foreman-tasks/dynflow] [E] invalidated execution plan 385cd024-af7b-42c1-a276-f8947066e34d missing, skipping
2018-01-03 09:06:44  [foreman-tasks] [W] Could not load execution plan f3c1e4d1-0ada-43c8-841a-ad88e741387a for task 0f14591e-6923-4713-8d32-0c06e0c91bf3
 | RuntimeError: The Dynflow world was not initialized yet. If your plugin uses it, make sure to call ForemanTasks.dynflow.require! in some initializer
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.9.6.3/lib/foreman_tasks/dynflow.rb:82:in `world'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.9.6.3/app/models/foreman_tasks/task/dynflow_task.rb:53:in `execution_plan'
[...]

However, this is caused by killing the "monitor event queue" task.

Also, the message "[app] [W] Host not found for ID <ID>" is printed in production.log. It is, however, NOT followed by any traceback - which was the goal of this BZ.

Comment 9 Satellite Program 2018-02-21 16:54:37 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> > 
> > For information on the advisory, and where to find the updated files, follow the link below.
> > 
> > If the solution does not work for you, open a new bug report.
> > 
> > https://access.redhat.com/errata/RHSA-2018:0336