Project

General

Profile

Actions

Bug #21423

closed

foreman-rake foreman_tasks fails with NoMethodError: undefined method `state' for nil:NilClass

Added by Adam Ruzicka about 7 years ago. Updated over 3 years ago.

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

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1501357

Description of problem:
If it exist task in state planning and result error, task export will fail.

Version-Release number of selected component (if applicable):
foreman-debug-1.11.0.83-1.el7sat.noarch

How reproducible:
Do not know how to create task with state planning and result error

Steps to Reproduce:
1. If task with state planning and result error is in database run task-export
2. foreman-rake foreman_tasks:export_tasks task_search=all --trace

Actual results:
foreman-rake foreman_tasks:export_tasks task_search=all --trace
  • Invoke foreman_tasks:export_tasks (first_time)
  • Invoke environment (first_time)
  • Execute environment
  • Execute foreman_tasks:export_tasks
    Gathering 128 tasks.
    1/128
    ...
    123/128
    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-rake foreman_tasks:export_tasks task_search=all --trace
  • Invoke foreman_tasks:export_tasks (first_time)
  • Invoke environment (first_time)
  • Execute environment
  • Execute foreman_tasks:export_tasks
    Gathering 410 tasks.
    1/410
    ...
    410/410
    tar cvzf /tmp/task-export-1507806090.tar.gz /tmp/task-export20171012-19818-7kkxfd > /dev/null
    tar: Entferne führende „/“ von Elementnamen
    Created /tmp/task-export-1507806090.tar.gz

Additional info:
So far task with state planning and result error was created on customer satellite and also on my satellite (on both was removed).

I also wrote KCS for this problem https://access.redhat.com/solutions/3213711

Actions

Also available in: Atom PDF