Bug 1957186

Summary: foreman-rake rh_cloud_inventory:sync fails with traceback "The Dynflow world was not initialized yet.".
Product: Red Hat Satellite Reporter: Jameer Pathan <jpathan>
Component: RH Cloud - InventoryAssignee: Shimon Shtein <sshtein>
Status: CLOSED ERRATA QA Contact: Jameer Pathan <jpathan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: ahumbe, aruzicka
Target Milestone: 6.10.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_rh_cloud-3.0.21 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-16 14:10:50 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 Jameer Pathan 2021-05-05 10:33:26 UTC
Description of problem:
foreman-rake rh_cloud_inventory:sync fails with traceback "The Dynflow world was not initialized yet.".

Version-Release number of selected component (if applicable):
- Satellite 6.9.1 snap 3
- tfm-rubygem-foreman_rh_cloud-3.0.18.1-1.el7sat.noarch

How reproducible:
- Always

Steps to Reproduce:
1. Run "/usr/sbin/foreman-rake rh_cloud_inventory:sync"

Actual results:
[root@dhcp-3-129 ~]# /usr/sbin/foreman-rake rh_cloud_inventory:sync
rake aborted!
The Dynflow world was not initialized yet. If your plugin uses it, make sure to call Rails.application.dynflow.require! in some initializer
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/rails.rb:75:in `world'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/active_job/queue_adapter.rb:7:in `enqueue'
/opt/theforeman/tfm/root/usr/share/gems/gems/activejob-6.0.3.4/lib/active_job/enqueuing.rb:59:in `block in enqueue'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:112:in `block in run_callbacks'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `block in instrument'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `instrument'
/opt/theforeman/tfm/root/usr/share/gems/gems/activejob-6.0.3.4/lib/active_job/logging.rb:35:in `block (2 levels) in <module:Logging>'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:121:in `instance_exec'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
/opt/theforeman/tfm/root/usr/share/gems/gems/activejob-6.0.3.4/lib/active_job/logging.rb:16:in `block (3 levels) in <module:Logging>'
/opt/theforeman/tfm/root/usr/share/gems/gems/activejob-6.0.3.4/lib/active_job/logging.rb:47:in `tag_logger'
/opt/theforeman/tfm/root/usr/share/gems/gems/activejob-6.0.3.4/lib/active_job/logging.rb:15:in `block (2 levels) in <module:Logging>'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:121:in `instance_exec'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:139:in `run_callbacks'
/opt/theforeman/tfm/root/usr/share/gems/gems/activejob-6.0.3.4/lib/active_job/enqueuing.rb:55:in `enqueue'
/opt/theforeman/tfm/root/usr/share/gems/gems/activejob-6.0.3.4/lib/active_job/enqueuing.rb:22:in `perform_later'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_rh_cloud-3.0.18.1/lib/insights_cloud/async/insights_full_sync.rb:16:in `perform'
/opt/theforeman/tfm/root/usr/share/gems/gems/activejob-6.0.3.4/lib/active_job/execution.rb:40:in `block in perform_now'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:112:in `block in run_callbacks'
/opt/theforeman/tfm/root/usr/share/gems/gems/i18n-1.8.2/lib/i18n.rb:308:in `with_locale'
/opt/theforeman/tfm/root/usr/share/gems/gems/activejob-6.0.3.4/lib/active_job/translation.rb:9:in `block (2 levels) in <module:Translation>'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:121:in `instance_exec'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/core_ext/time/zones.rb:66:in `use_zone'
/opt/theforeman/tfm/root/usr/share/gems/gems/activejob-6.0.3.4/lib/active_job/timezones.rb:9:in `block (2 levels) in <module:Timezones>'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:121:in `instance_exec'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
/opt/theforeman/tfm/root/usr/share/gems/gems/activejob-6.0.3.4/lib/active_job/logging.rb:25:in `block (4 levels) in <module:Logging>'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `block in instrument'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `instrument'
/opt/theforeman/tfm/root/usr/share/gems/gems/activejob-6.0.3.4/lib/active_job/logging.rb:24:in `block (3 levels) in <module:Logging>'
/opt/theforeman/tfm/root/usr/share/gems/gems/activejob-6.0.3.4/lib/active_job/logging.rb:47:in `tag_logger'
/opt/theforeman/tfm/root/usr/share/gems/gems/activejob-6.0.3.4/lib/active_job/logging.rb:21:in `block (2 levels) in <module:Logging>'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:121:in `instance_exec'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:139:in `run_callbacks'
/opt/theforeman/tfm/root/usr/share/gems/gems/activejob-6.0.3.4/lib/active_job/execution.rb:39:in `perform_now'
/opt/theforeman/tfm/root/usr/share/gems/gems/activejob-6.0.3.4/lib/active_job/execution.rb:18:in `perform_now'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_rh_cloud-3.0.18.1/lib/tasks/rh_cloud_inventory.rake:57:in `block (2 levels) in <top (required)>'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => rh_cloud_inventory:sync
(See full trace by running task with --trace)


Expected results:
- rh_cloud_inventory:sync rake command completes successfully.

Additional info:

Comment 1 Jameer Pathan 2021-06-30 07:05:33 UTC
Verified:

Verified with:
- Satellite 6.10.0 snap 6
- tfm-rubygem-foreman_rh_cloud-4.0.22-1.el7sat.noarch

Test steps:
- Have hosts registered with Satellite.
- Add RH Cloud token in settings.
- Run "/usr/sbin/foreman-rake rh_cloud_inventory:sync"

Observations:
- rh_cloud_inventory:sync rake command completed successfully.

# /usr/sbin/foreman-rake rh_cloud_inventory:sync
`/usr/share/foreman` is not writable.
Bundler will use `/tmp/bundler20210630-38457-1rww0om38457' as your home directory temporarily.
'ErbParser' is ignored.
'RubyParser' is ignored.
Synchronized inventory for organization 'Default Organization'

Comment 4 errata-xmlrpc 2021-11-16 14:10:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.10 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:4702