Problem: When I try to create a new product, I get an error message in the WebGUI:
Error
An error occurred while saving the Product: 0 The Dynflow world was not initialized yet. If your plugin uses it, make sure to call Rails.application.dynflow.require! in some initializer
Expected outcome: A product can be successfully created.
Foreman and Proxy versions: Foreman 3.0.1 with katello 4.2
Foreman and Proxy plugin versions:
Distribution and version:
Centos 8 stream
Other relevant data:
With foreman 3.0 all worked fine, the problem arised after the update to 3.0.1 .
Also I cannot access the existing products: They will be listed, but when clicking on it also an error message is printed in the WebGUI:
undefined method `[]' for nil:NilClass
Again this problem did not exists in 3.0 and starts with 3.0.1 .
Hi @jeremylenz ,
sorry for delay in answering.
foreman-maintain says : | All services are running [OK]
In the production.log are a lot of entries when I click on product, here is an extraction:
2021-12-15T16:08:13 [I|app|5a40386c] Processing by Katello::Api::V2::ProductsController#show as HTML
2021-12-15T16:08:13 [I|app|5a40386c] Parameters: {"organization_id"=>"3", "api_version"=>"v2", "id"=>"4"}
2021-12-15T16:08:13 [I|app|5a40386c] Rendering /usr/share/gems/gems/katello-4.3.0.rc3/app/views/katello/api/v2/products/show.json.rabl within katello/api/v2/layouts/resource
2021-12-15T16:08:13 [I|app|72ea25ab] Started GET "/layouts/partials/page-loading-indicator.html" for 2a02:8108:1680:6700:1588:74cc:a415:292d at 2021-12-15 16:08:13 +0100
2021-12-15T16:08:13 [W|for|5a40386c] Could not load execution plan 6e679efd-56dd-4819-bedb-a0838ea7f568 for task 49443278-bd86-4fa3-8c36-f6048e8bede1
2021-12-15T16:08:13 [I|for|5a40386c] Backtrace for 'Could not load execution plan 6e679efd-56dd-4819-bedb-a0838ea7f568 for task 49443278-bd86-4fa3-8c36-f6048e8bede1' 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
5a40386c | /usr/share/gems/gems/dynflow-1.6.2/lib/dynflow/rails.rb:75:in `world'
5a40386c | /usr/share/gems/gems/foreman-tasks-5.2.0/app/models/foreman_tasks/task/dynflow_task.rb:55:in `execution_plan'
5a40386c | /usr/share/gems/gems/foreman-tasks-5.2.0/app/models/foreman_tasks/task/dynflow_task.rb:167:in `active_job?'
5a40386c | /usr/share/gems/gems/foreman-tasks-5.2.0/app/models/foreman_tasks/task/dynflow_task.rb:87:in `input'
5a40386c | /usr/share/gems/gems/katello-4.3.0.rc3/app/models/katello/glue/pulp/repos.rb:95:in `block in sync_state_aggregated'
5a40386c | /usr/share/gems/gems/katello-4.3.0.rc3/app/models/katello/glue/pulp/repos.rb:95:in `transform_values'
5a40386c | /usr/share/gems/gems/katello-4.3.0.rc3/app/models/katello/glue/pulp/repos.rb:95:in `sync_state_aggregated'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/helpers.rb:16:in `data_object_attribute'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:145:in `attribute'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:116:in `block in compile_settings'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:115:in `each'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:115:in `compile_settings'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:55:in `block in to_hash'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:252:in `cache_results'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:51:in `to_hash'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:90:in `to_hash'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:103:in `to_dumpable'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:112:in `to_json'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:50:in `block in render'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:385:in `cache_results'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:49:in `render'
5a40386c | /usr/share/foreman/config/initializers/rabl_init.rb:49:in `render'
5a40386c | /usr/share/gems/gems/katello-4.3.0.rc3/app/views/katello/api/v2/products/show.json.rabl:3:in `_fa48dbe2890240839998e1cf8db47f33'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/base.rb:274:in `_run'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/template.rb:185:in `block in render'
5a40386c | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications.rb:182:in `instrument'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/template.rb:385:in `instrument_render_template'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/template.rb:183:in `render'
5a40386c | /usr/share/gems/gems/deface-1.5.3/lib/deface/action_view_extensions.rb:43:in `render'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/renderer/template_renderer.rb:58:in `block (2 levels) in render_template'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/renderer/abstract_renderer.rb:88:in `block in instrument'
5a40386c | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications.rb:180:in `block in instrument'
5a40386c | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
5a40386c | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications.rb:180:in `instrument'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/renderer/abstract_renderer.rb:87:in `instrument'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/renderer/template_renderer.rb:57:in `block in render_template'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/renderer/template_renderer.rb:65:in `render_with_layout'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/renderer/template_renderer.rb:56:in `render_template'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/renderer/template_renderer.rb:13:in `render'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/renderer/renderer.rb:61:in `render_template_to_object'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/renderer/renderer.rb:29:in `render_to_object'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/rendering.rb:117:in `block in _render_template'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/base.rb:304:in `in_rendering_context'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/rendering.rb:116:in `_render_template'
5a40386c | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/streaming.rb:218:in `_render_template'
5a40386c | /usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/rendering.rb:103:in `render_to_body'
5a40386c | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/rendering.rb:52:in `render_to_body'
5a40386c | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/renderers.rb:142:in `render_to_body'
5a40386c | /usr/share/gems/gems/actionpack-6.0.3.7/lib/abstract_controller/rendering.rb:25:in `render'
5a40386c | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/rendering.rb:36:in `render'
5a40386c | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
5a40386c | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/core_ext/benchmark.rb:14:in `block in ms'
5a40386c | /usr/share/ruby/benchmark.rb:308:in `realtime'
5a40386c | /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/core_ext/benchmark.rb:14:in `ms'
5a40386c | /usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/instrumentation.rb:44:in `block in render'
.....
5a40386c | /usr/share/gems/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2021-12-15T16:08:13 [I|app|5a40386c] Rendered /usr/share/gems/gems/katello-4.3.0.rc3/app/views/katello/api/v2/products/show.json.rabl within katello/api/v2/layouts/resource (Duration: 61.0ms | Allocations: 8410)
2021-12-15T16:08:13 [E|app|5a40386c] ActionView::Template::Error: undefined method `[]' for nil:NilClass
5a40386c | /usr/share/gems/gems/katello-4.3.0.rc3/app/models/katello/glue/pulp/repos.rb:95:in `block in sync_state_aggregated'
5a40386c | /usr/share/gems/gems/katello-4.3.0.rc3/app/models/katello/glue/pulp/repos.rb:95:in `transform_values'
5a40386c | /usr/share/gems/gems/katello-4.3.0.rc3/app/models/katello/glue/pulp/repos.rb:95:in `sync_state_aggregated'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/helpers.rb:16:in `data_object_attribute'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:145:in `attribute'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:116:in `block in compile_settings'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:115:in `each'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:115:in `compile_settings'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:55:in `block in to_hash'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:252:in `cache_results'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:51:in `to_hash'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:90:in `to_hash'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:103:in `to_dumpable'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:112:in `to_json'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:50:in `block in render'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:385:in `cache_results'
5a40386c | /usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:49:in `render'
5a40386c | /usr/share/foreman/config/initializers/rabl_init.rb:49:in `render'
5a40386c | /usr/share/gems/gems/katello-4.3.0.rc3/app/views/katello/api/v2/products/show.json.rabl:3:in `_fa48dbe2890240839998e1cf8db47f33'
hammer product synchronize --organization "Petersen" --name "Ubuntu Focal"
Could not synchronize the product repositories:
The Dynflow world was not initialized yet. If your plugin uses it, make sure to call Rails.application.dynflow.require! in some initializer
Yes, I made the upgrade from 3.0 to 3.0.1, without any errors. Actually Iâm using foreman 3.1 with katello 4.3rc4 and the problem still exists.
I will try to delete existing products and create new ones then.
I delete all products and try to create a new one by cli and gui, but still the same error:
Could not create the product:
The Dynflow world was not initialized yet. If your plugin uses it, make sure to call Rails.application.dynflow.require! in some initializer
I also find out that the same problem occurs at several other actions, eg. creating a sync plan or deleting an environment in a library.
I suppose the problem come from the dynflow processes, but they are running and there are no syslog entries from with this services:
systemctl | grep dyn
dynflow-sidekiq@orchestrator.service loaded active running Foreman jobs daemon - orchestrator on sidekiq
dynflow-sidekiq@worker-1.service loaded active running Foreman jobs daemon - worker-1 on sidekiq
dynflow-sidekiq@worker-hosts-queue-1.service loaded active running Foreman jobs daemon - worker-hosts-queue-1 on sidekiq
There are only a warning message:
systemctl status dynflow-sidekiq@worker-hosts-queue-1.service
â dynflow-sidekiq@worker-hosts-queue-1.service - Foreman jobs daemon - worker-hosts-queue-1 on sidekiq
Loaded: loaded (/usr/lib/systemd/system/dynflow-sidekiq@.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2021-12-20 16:14:43 CET; 10min ago
Docs: https://theforeman.org
Main PID: 20408 (sidekiq)
Tasks: 16 (limit: 50031)
Memory: 408.2M
CGroup: /system.slice/system-dynflow\x2dsidekiq.slice/dynflow-sidekiq@worker-hosts-queue-1.service
ââ20408 sidekiq 5.2.7 [0 of 5 busy]
Dez 20 16:13:15 scotty.home.petersen20.de systemd[1]: Starting Foreman jobs daemon - worker-hosts-queue-1 on sidekiq...
Dez 20 16:13:19 scotty.home.petersen20.de dynflow-sidekiq@worker-hosts-queue-1[20408]: 2021-12-20T15:13:19.602Z 20408 TID-e98 INFO: GitLab reliable fetch activated!
Dez 20 16:13:19 scotty.home.petersen20.de dynflow-sidekiq@worker-hosts-queue-1[20408]: 2021-12-20T15:13:19.604Z 20408 TID-e8g INFO: Booting Sidekiq 5.2.7 with redis options {:id=>"Sidekiq-server-PID-20408", :url=>"redis://localhost:6379/0"}
Dez 20 16:13:28 scotty.home.petersen20.de dynflow-sidekiq@worker-hosts-queue-1[20408]: 'ErbParser' is ignored.
Dez 20 16:13:28 scotty.home.petersen20.de dynflow-sidekiq@worker-hosts-queue-1[20408]: 'RubyParser' is ignored.
Dez 20 16:13:38 scotty.home.petersen20.de dynflow-sidekiq@worker-hosts-queue-1[20408]: /usr/share/gems/gems/foreman_puppet-2.0.0/lib/foreman_puppet/register.rb:155: warning: already initialized constant Foreman::Plugin::RbacSupport::AUTO_EXT>
Dez 20 16:13:38 scotty.home.petersen20.de dynflow-sidekiq@worker-hosts-queue-1[20408]: /usr/share/foreman/app/registries/foreman/plugin/rbac_support.rb:5: warning: previous definition of AUTO_EXTENDED_ROLES was here
Dez 20 16:14:43 scotty.home.petersen20.de systemd[1]: Started Foreman jobs daemon - worker-hosts-queue-1 on sidekiq.
Iâm at a loss I donât know how to debug the dynflow process âŚ
It seems like something is not working right around Dynflow.
If you go to Infrastructure > Smart Proxies, Dynflow should be listed under âActive features.â Is it there? Do you see any errors on that page, particularly about Dynflow?
also canât hurt to try the âRefresh featuresâ buttonâŚ
It could still be a bug. I wouldnât want you to wipe out everything if it wonât help. If youâre able to wait until after the holidays the Dynflow experts should be available againâŚ
Thatâs ok for me I would be also more interest in an analyse and a right/good solution if there is a chance for it.
Iâll wait then.
I wish you a merry christmas
I think, I found the reason und could solve the problem:
The amount of puma workers were zero. After setting it to two and restart of all foreman services all works fine again. Also the value of puma_threads_min was blank in the answers file.
It seems as if something went wrong with these parameters during the migration from 3.0 to 3.1?