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 1785902 - Ansible RunHostJob tasks failed with "Failed to initialize: NoMethodError - undefined method `[]' for nil:NilClass"
Summary: Ansible RunHostJob tasks failed with "Failed to initialize: NoMethodError - u...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Tasks Plugin
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
medium
medium with 1 vote
Target Milestone: 6.8.0
Assignee: satellite6-bugs
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-22 06:08 UTC by Hao Chang Yu
Modified: 2024-12-20 18:57 UTC (History)
6 users (show)

Fixed In Version: tfm-rubygem-foreman-tasks-1.1.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 12:59:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 29028 0 Normal Closed Ansible RunHostJob tasks failed with "Failed to initialize: NoMethodError - undefined method `[]' for nil:NilClass" 2021-01-19 12:05:41 UTC
Red Hat Product Errata RHSA-2020:4366 0 None None None 2020-10-27 13:00:06 UTC

Description Hao Chang Yu 2019-12-22 06:08:40 UTC
Description of problem:
Ansible tasks failed with "Failed to initialize: NoMethodError - undefined method `[]' for nil:NilClass" while updating the status of the stopped delegated tasks.

Steps to Reproduce:
1) Run an ansible script job with a command "sleep 60" on 1 or more clients.
2) Wait until the client's RunHostJob task is created by the main task (RunHostsJob) and it is in running state.
3) Then stop foreman-tasks for about 2 minutes until the remote task is finished.
4) Start foreman-tasks.
5) About 10 minutes later, the RunHostJob should failed with the above error.

How reproducible:
- Stopping the foreman-tasks in STEP 3 is to make the RunHostJob miss the API callback from the smart_proxy_dynflow_core when the remote task is stopped. Anyway that could cause the foreman tasks to miss the API callback should be able to reproduce the issue.
- If the Callback is missed, there is a Watcher in the main task (RunHostsJob) that will wakeup every 10 minutes to check the status of its sub tasks and notify them.
- While the sub stask (RunHostJob) updating its status, the task failed with the error above.


Actual results:
Task fail

Expected results:
foreman-tasks should update the status of the task and stop the task successfully without raising the above error

Comment 6 Bryan Kearney 2020-04-22 20:21:42 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/29028 has been resolved.

Comment 7 Peter Ondrejka 2020-05-26 13:22:47 UTC
Verified on Satellite 6.8 snap 1, using steps from the problem description (restarting dynflow-sidekiq@worker service)

Comment 10 errata-xmlrpc 2020-10-27 12:59:52 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 (Important: Satellite 6.8 release), 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-2020:4366


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