Bug #30511
Updated by Jeremy Lenz over 4 years ago
When running a rake task that includes the Katello::SubscriptionMailer, it fails with error: RuntimeError (The Dynflow world was not initialized yet. If your plugin uses it, make sure to call Rails.application.dynflow.require! in some initializer) Only seems to happen on nightly; not on devel boxes. Steps to reproduce Import a manifest with at least one subscription that expires <180 days Attach that subscription to a host Verify that the Subscriptions - Entitlement Report (Monitor -> Report Templates) shows that host and subscription In My Account -> Email Preferences, set up the Subscriptions Expiring Soon email and configure for Daily emails Run /usr/sbin/foreman-rake reports:daily Expected: no output; if email is set up you are emailed the report Actual: the error above ### Alternate steps to reproduce In foreman-rake rails console, run include Katello::SubscriptionMailerHelper start_report_task(120) Expected: return the job ID as a string Actual: the error above Workaround See workaround in https://projects.theforeman.org/issues/29337#note-2