Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1656125

Summary: [tfm-rubygem-foreman-tasks] foreman_tasks:export_tasks will fails with tasks in 'planning' state and 'error' as result
Product: Red Hat Satellite Reporter: Andrea Perotti <aperotti>
Component: Tasks PluginAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Jan Hutaƙ <jhutar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2.15CC: aperotti, aruzicka, inecas
Target Milestone: Unspecified   
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-12-05 12:37:29 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 Andrea Perotti 2018-12-04 18:37:37 UTC
Description of problem:

If in Satellite there are tasks that are in state: 'planning' invoking foreman-rake foreman_tasks:export_tasks will fails.

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

experienced with:

tfm-rubygem-foreman-tasks-0.7.14.14-1.el7sat.noarch

but expecting this to be valid also on later versions.


How reproducible:
always

Steps to Reproduce:
1. have something that crash a task in the planning phase (like an OutOfSpace of the FileSystem)
2. foreman-rake foreman_tasks:export_tasks
3. wait a loooong time for having t

Actual results:

rake aborted!
NoMethodError: undefined method `state' for nil:NilClass
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.7.14.14/lib/foreman_tasks/tasks/export_tasks.rake:165:in `step_css_class'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.6/web/views/plan_step.erb:4:in `block in singleton class'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.6/web/views/plan_step.erb:-5:in `instance_eval'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.6/web/views/plan_step.erb:-5:in `singleton class'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.6/web/views/plan_step.erb:-7:in `__tilt_18397580'
/opt/rh/rh-ror41/root/usr/share/gems/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `call'
/opt/rh/rh-ror41/root/usr/share/gems/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `evaluate'
/opt/rh/rh-ror41/root/usr/share/gems/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.7.14.14/lib/foreman_tasks/tasks/export_tasks.rake:61:in `erb'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.6/web/views/plan_step.erb:12:in `block (2 levels) in singleton class'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.6/web/views/plan_step.erb:11:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.6/web/views/plan_step.erb:11:in `block in singleton class'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.6/web/views/plan_step.erb:-5:in `instance_eval'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.6/web/views/plan_step.erb:-5:in `singleton class'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.6/web/views/plan_step.erb:-7:in `__tilt_18397580'
/opt/rh/rh-ror41/root/usr/share/gems/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `call'
/opt/rh/rh-ror41/root/usr/share/gems/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `evaluate'
/opt/rh/rh-ror41/root/usr/share/gems/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.7.14.14/lib/foreman_tasks/tasks/export_tasks.rake:61:in `erb'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.6/web/views/show.erb:48:in `block in singleton class'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.6/web/views/show.erb:-5:in `instance_eval'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.6/web/views/show.erb:-5:in `singleton class'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.6/web/views/show.erb:-7:in `__tilt_18397580'
/opt/rh/rh-ror41/root/usr/share/gems/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `call'
/opt/rh/rh-ror41/root/usr/share/gems/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `evaluate'
/opt/rh/rh-ror41/root/usr/share/gems/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.7.14.14/lib/foreman_tasks/tasks/export_tasks.rake:61:in `erb'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.7.14.14/lib/foreman_tasks/tasks/export_tasks.rake:46:in `render_task'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.7.14.14/lib/foreman_tasks/tasks/export_tasks.rake:264:in `block (5 levels) in <top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.7.14.14/lib/foreman_tasks/tasks/export_tasks.rake:264:in `open'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.7.14.14/lib/foreman_tasks/tasks/export_tasks.rake:264:in `block (4 levels) in <top (required)>'
/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/relation/delegation.rb:132:in `each'
/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/relation/delegation.rb:132:in `each_with_index'
/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/relation/delegation.rb:132:in `public_send'
/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/relation/delegation.rb:132:in `method_missing'
/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/relation/delegation.rb:99:in `method_missing'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.7.14.14/lib/foreman_tasks/tasks/export_tasks.rake:263:in `block (3 levels) in <top (required)>'
/opt/rh/rh-ruby22/root/usr/share/ruby/tmpdir.rb:88:in `mktmpdir'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.7.14.14/lib/foreman_tasks/tasks/export_tasks.rake:256:in `block (2 levels) in <top (required)>'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/opt/rh/rh-ruby22/root/usr/share/ruby/monitor.rb:211:in `mon_synchronize'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/opt/rh/rh-ruby22/root/usr/bin/rake:33:in `<main>'
Tasks: TOP => foreman_tasks:export_tasks

Expected results:

foreman_tasks:export_tasks could be smarter and being able to deal with that situation.
Has this being addressed in future


Additional info:

This issue happen when a customer is already having trouble and is looking for help so it add stress to a stressed situation, so would be good to have it sorted out to users to provide support the task status.

Comment 5 Andrea Perotti 2018-12-05 12:37:29 UTC

*** This bug has been marked as a duplicate of bug 1501357 ***