Foreman-rake katello:check_ping fails: The Dynflow world was not initialized yet

Problem:
Some foreman-rake katello:XXX commands which call katello:check_ping do not work on my server. If I run katello:clean_backend_objects it calls katello:check_ping and fails with “dynflow not inizialied yet”.

Rerunning the foreman-installer doesn’t seem to help either.

Thanks,
Greg
Expected outcome:
foreman-rake katello:check_ping should print out the status of each needed service
Foreman and Proxy versions:

  • foreman-2.2.1-1.el7.noarch
  • foreman-proxy-2.2.1-1.el7.noarch

Foreman and Proxy plugin versions:

  • candlepin-3.1.22-1.el7.noarch
  • katello-3.17.1-1.el7.noarch
  • pulp-server-2.21.4-2.el7.noarch

Distribution and version:
CentOS Linux release 7.9.2009
Other relevant data:

  1. check_ping output

    foreman-rake katello:check_ping --trace
    ** Invoke katello:check_ping (first_time)
    ** Invoke environment (first_time)
    ** Execute environment
    ** Execute katello:check_ping
    {:services=>
    {:candlepin=>{:status=>“ok”, :duration_ms=>“25”},
    :candlepin_auth=>{:status=>“ok”, :duration_ms=>“32”},
    :foreman_tasks=>
    {:status=>“FAIL”,
    :message=>
    “The Dynflow world was not initialized yet. If your plugin uses it, make sure to call Rails.application.dynflow.require! in some initializer”},
    :katello_events=>
    {:status=>“ok”, :message=>“0 Processed, 0 Failed”, :duration_ms=>“0”},
    :candlepin_events=>
    {:status=>“ok”, :message=>“0 Processed, 0 Failed”, :duration_ms=>“0”},
    :pulp3=>{:status=>“ok”, :duration_ms=>“67”},
    :pulp=>{:status=>“ok”, :duration_ms=>“73”},
    :pulp_auth=>{:status=>“ok”, :duration_ms=>“35”}},
    :status=>“FAIL”}
    rake aborted!
    Not all the services have been started. Check the status report above and try again.
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.17.1/lib/katello/tasks/reimport.rake:10:in block (2 levels) in <top (required)>' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:251:in block in execute’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:251:in each' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:251:in execute’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:195:in block in invoke_with_call_chain' /opt/rh/rh-ruby25/root/usr/share/ruby/monitor.rb:226:in mon_synchronize’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:188:in invoke_with_call_chain' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:181:in invoke’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:160:in invoke_task' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:116:in block (2 levels) in top_level’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:116:in each' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:116:in block in top_level’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:125:in run_with_threads' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:110:in top_level’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:83:in block in run' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:186:in standard_exception_handling’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:80:in run' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in <top (required)>’
    /opt/rh/rh-ruby25/root/usr/bin/rake:23:in load' /opt/rh/rh-ruby25/root/usr/bin/rake:23:in
    Tasks: TOP => katello:check_ping

  2. clean_backend_objects output
    foreman-rake katello:clean_backend_objects --trace
    ** Invoke katello:clean_backend_objects (first_time)
    ** Invoke environment (first_time)
    ** Execute environment
    ** Invoke katello:check_ping (first_time)
    ** Invoke environment
    ** Execute katello:check_ping
    {:services=>
    {:candlepin=>{:status=>“ok”, :duration_ms=>“25”},
    :candlepin_auth=>{:status=>“ok”, :duration_ms=>“43”},
    :foreman_tasks=>
    {:status=>“FAIL”,
    :message=>
    “The Dynflow world was not initialized yet. If your plugin uses it, make sure to call Rails.application.dynflow.require! in some initializer”},
    :katello_events=>
    {:status=>“ok”, :message=>“0 Processed, 0 Failed”, :duration_ms=>“0”},
    :candlepin_events=>
    {:status=>“ok”, :message=>“0 Processed, 0 Failed”, :duration_ms=>“0”},
    :pulp3=>{:status=>“ok”, :duration_ms=>“66”},
    :pulp=>{:status=>“ok”, :duration_ms=>“86”},
    :pulp_auth=>{:status=>“ok”, :duration_ms=>“55”}},
    :status=>“FAIL”}
    rake aborted!
    Not all the services have been started. Check the status report above and try again.
    /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.17.1/lib/katello/tasks/reimport.rake:10:in block (2 levels) in <top (required)>' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:251:in block in execute’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:251:in each' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:251:in execute’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:195:in block in invoke_with_call_chain' /opt/rh/rh-ruby25/root/usr/share/ruby/monitor.rb:226:in mon_synchronize’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:188:in invoke_with_call_chain' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:217:in block in invoke_prerequisites’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:215:in each' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:215:in invoke_prerequisites’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:194:in block in invoke_with_call_chain' /opt/rh/rh-ruby25/root/usr/share/ruby/monitor.rb:226:in mon_synchronize’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:188:in invoke_with_call_chain' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/task.rb:181:in invoke’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:160:in invoke_task' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:116:in block (2 levels) in top_level’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:116:in each' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:116:in block in top_level’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:125:in run_with_threads' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:110:in top_level’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:83:in block in run' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:186:in standard_exception_handling’
    /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:80:in run' /opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in <top (required)>’
    /opt/rh/rh-ruby25/root/usr/bin/rake:23:in load' /opt/rh/rh-ruby25/root/usr/bin/rake:23:in
    Tasks: TOP => katello:clean_backend_objects => katello:check_ping

Did you ever get a resolution to this?

I think this slipped through the December Holiday break. I was able to reproduce this and filed: Bug #31725: foreman-rake katello:clean_backend_objects fails with " "The Dynflow world was not initialized yet. If your plugin uses it, make sure to call Rails.application.dynflow.require! in some initializer"}," - Katello - Foreman

and opened a pr to fix this here: Fixes #31725 - properly use dynflow:client with check_ping in tasks by jlsherrill · Pull Request #9113 · Katello/katello · GitHub

Thanks @rob.beglinger and @Justin_Sherrill for revisiting the issue :grinning:
I hope this will get fixed fast. The check_ping function is used by so many other functions which also fail when called.

Anyway. Thanks for opening the pr.