Project

General

Profile

Actions

Bug #29028

closed

Ansible RunHostJob tasks failed with "Failed to initialize: NoMethodError - undefined method `[]' for nil:NilClass"

Added by Hao Yu about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Foreman plugin
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

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

Actions #1

Updated by The Foreman Bot about 4 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
Actions #2

Updated by Hao Yu about 4 years ago

  • Status changed from Ready For Testing to Closed
Actions #3

Updated by Adam Ruzicka about 4 years ago

  • Fixed in Releases foreman-tasks-1.1.0 added
  • Fixed in Releases deleted (foreman-tasks-1.0.2)
Actions

Also available in: Atom PDF