Bug #29028
closedAnsible RunHostJob tasks failed with "Failed to initialize: NoMethodError - undefined method `[]' for nil:NilClass"
Description
Clone from bugzilla 1785902
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
Updated by The Foreman Bot about 5 years ago
- Status changed from New to Ready For Testing
- Assignee set to Hao Yu
- Pull request https://github.com/theforeman/foreman-tasks/pull/504 added
Updated by Hao Yu about 5 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 55491ba9731a4b4511c62fd776551ef62fb8d1eb.
Updated by Adam Ruzicka about 5 years ago
- Fixed in Releases foreman-tasks-1.1.0 added
- Fixed in Releases deleted (
foreman-tasks-1.0.2)