Project

General

Profile

Actions

Bug #37262

open

Creation of Policy with deployment method Puppet fails

Added by Dirk Götz about 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

When clicking through the Wizard to create a Policy with deployment method Puppet it fails after the last step with the following error message:

Oops, we're sorry but something went wrong undefined method `<<' for #<ActiveRecord::Relation []>

The matching stacktrace from the production log:
2024-03-14T12:36:25 [I|app|bcea2002] Started POST "/compliance/policies" for 10.0.0.1 at 2024-03-14 12:36:25 +0100
2024-03-14T12:36:25 [I|app|bcea2002] Processing by PoliciesController#create as HTML
2024-03-14T12:36:25 [I|app|bcea2002] Parameters: {"authenticity_token"=>"9cTYEyl8J3Z89Rz4apNIVQcQS3RCCa9ML_XNrrrkvrUQn7j5Lld39WMvVhR7UL_lp0Yv7G4qiEXVrvtGNAzpkA", "policy"=>{"wizard_initiated"=>"true", "current_step"=>"", "deploy_by"=>"puppet", "name"=>"Puppet", "description"=>"", "scap_content_id"=>"1", "scap_content_profile_id"=>"17", "tailoring_file_id"=>"", "period"=>"weekly", "weekday"=>"sunday", "day_of_month"=>"", "cron_line"=>"", "location_ids"=>["", "2"], "organization_ids"=>["", "1"], "hostgroup_ids"=>["", "2"]}, "commit"=>"Submit"}
2024-03-14T12:36:25 [I|aud|bcea2002] ForemanOpenscap::Policy (2) create event on name Puppet
2024-03-14T12:36:25 [I|aud|bcea2002] ForemanOpenscap::Policy (2) create event on period weekly
2024-03-14T12:36:25 [I|aud|bcea2002] ForemanOpenscap::Policy (2) create event on weekday sunday
2024-03-14T12:36:25 [I|aud|bcea2002] ForemanOpenscap::Policy (2) create event on description
2024-03-14T12:36:25 [I|aud|bcea2002] ForemanOpenscap::Policy (2) create event on scap_content_id 1
2024-03-14T12:36:25 [I|aud|bcea2002] ForemanOpenscap::Policy (2) create event on scap_content_profile_id 17
2024-03-14T12:36:25 [I|aud|bcea2002] ForemanOpenscap::Policy (2) create event on day_of_month
2024-03-14T12:36:25 [I|aud|bcea2002] ForemanOpenscap::Policy (2) create event on cron_line
2024-03-14T12:36:25 [I|aud|bcea2002] ForemanOpenscap::Policy (2) create event on tailoring_file_id
2024-03-14T12:36:25 [I|aud|bcea2002] ForemanOpenscap::Policy (2) create event on tailoring_file_profile_id
2024-03-14T12:36:25 [I|aud|bcea2002] ForemanOpenscap::Policy (2) create event on deploy_by puppet
2024-03-14T12:36:25 [I|aud|bcea2002] ForemanOpenscap::Policy (2) create event on organization_ids [1]
2024-03-14T12:36:25 [I|aud|bcea2002] ForemanOpenscap::Policy (2) create event on location_ids [2]
2024-03-14T12:36:25 [W|app|bcea2002] undefined method `<<' for #<ActiveRecord::Relation []>
2024-03-14T12:36:25 [I|app|bcea2002] Backtrace for 'undefined method `<<' for #<ActiveRecord::Relation []>' error (NoMethodError): undefined method `<<' for #<ActiveRecord::Relation []>
bcea2002 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/relation/delegation.rb:110:in `method_missing'
bcea2002 | /usr/share/gems/gems/foreman_openscap-7.1.1/app/services/foreman_openscap/hostgroup_overrider.rb:24:in `add_config_tool'
bcea2002 | /usr/share/gems/gems/foreman_openscap-7.1.1/app/services/foreman_openscap/hostgroup_overrider.rb:35:in `populate_overrides'
bcea2002 | /usr/share/gems/gems/foreman_openscap-7.1.1/app/services/foreman_openscap/hostgroup_overrider.rb:16:in `block in populate'
bcea2002 | /usr/share/gems/gems/foreman_openscap-7.1.1/app/services/foreman_openscap/hostgroup_overrider.rb:15:in `each'
bcea2002 | /usr/share/gems/gems/foreman_openscap-7.1.1/app/services/foreman_openscap/hostgroup_overrider.rb:15:in `populate'
bcea2002 | /usr/share/gems/gems/foreman_openscap-7.1.1/app/models/foreman_openscap/policy.rb:244:in `assign_policy_to_hostgroups'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:427:in `block in make_lambda'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:235:in `block in halting_and_conditional'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:516:in `block in invoke_after'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:516:in `each'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:516:in `invoke_after'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:131:in `block in run_callbacks'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:137:in `run_callbacks'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:824:in `_run_save_callbacks'
bcea2002 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/callbacks.rb:457:in `create_or_update'
bcea2002 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/timestamp.rb:126:in `create_or_update'
bcea2002 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/persistence.rb:474:in `save'
bcea2002 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/validations.rb:47:in `save'
bcea2002 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/transactions.rb:298:in `block in save'
bcea2002 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/transactions.rb:354:in `block in with_transaction_returning_status'
bcea2002 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
bcea2002 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
bcea2002 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
bcea2002 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
bcea2002 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/transactions.rb:350:in `with_transaction_returning_status'
bcea2002 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/transactions.rb:298:in `save'
bcea2002 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/suppressor.rb:44:in `save'
bcea2002 | /usr/share/gems/gems/foreman_openscap-7.1.1/app/controllers/policies_controller.rb:35:in `create'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/base.rb:228:in `process_action'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/rendering.rb:30:in `process_action'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
bcea2002 | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
bcea2002 | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
bcea2002 | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
bcea2002 | /usr/share/gems/gems/audited-5.4.2/lib/audited/sweeper.rb:16:in `around'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
bcea2002 | /usr/share/gems/gems/audited-5.4.2/lib/audited/sweeper.rb:16:in `around'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:137:in `run_callbacks'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/callbacks.rb:41:in `process_action'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/rescue.rb:22:in `process_action'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/notifications.rb:203:in `block in instrument'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/notifications.rb:203:in `instrument'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/instrumentation.rb:33:in `process_action'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
bcea2002 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/base.rb:165:in `process'
bcea2002 | /usr/share/gems/gems/actionview-6.1.7.6/lib/action_view/rendering.rb:39:in `process'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal.rb:190:in `dispatch'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal.rb:254:in `dispatch'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/route_set.rb:33:in `serve'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:50:in `block in serve'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:32:in `each'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:32:in `serve'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/route_set.rb:842:in `call'
bcea2002 | /usr/share/gems/gems/katello-4.11.0/lib/katello/middleware/organization_created_enforcer.rb:18:in `call'
bcea2002 | /usr/share/gems/gems/katello-4.11.0/lib/katello/middleware/event_daemon.rb:10:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
bcea2002 | /usr/share/gems/gems/apipie-dsl-2.6.1/lib/apipie_dsl/static_dispatcher.rb:67:in `call'
bcea2002 | /usr/share/gems/gems/apipie-rails-1.2.3/lib/apipie/static_dispatcher.rb:68:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
bcea2002 | /usr/share/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
bcea2002 | /usr/share/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
bcea2002 | /usr/share/gems/gems/apipie-rails-1.2.3/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
bcea2002 | /usr/share/gems/gems/rack-2.2.8/lib/rack/tempfile_reaper.rb:15:in `call'
bcea2002 | /usr/share/gems/gems/rack-2.2.8/lib/rack/etag.rb:27:in `call'
bcea2002 | /usr/share/gems/gems/rack-2.2.8/lib/rack/conditional_get.rb:40:in `call'
bcea2002 | /usr/share/gems/gems/rack-2.2.8/lib/rack/head.rb:12:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/http/permissions_policy.rb:22:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/http/content_security_policy.rb:19:in `call'
bcea2002 | /usr/share/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
bcea2002 | /usr/share/gems/gems/rack-2.2.8/lib/rack/session/abstract/id.rb:266:in `context'
bcea2002 | /usr/share/gems/gems/rack-2.2.8/lib/rack/session/abstract/id.rb:260:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/cookies.rb:697:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:98:in `run_callbacks'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
bcea2002 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/rack/logger.rb:37:in `call_app'
bcea2002 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/rack/logger.rb:28:in `call'
bcea2002 | /usr/share/gems/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
bcea2002 | /usr/share/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
bcea2002 | /usr/share/gems/gems/request_store-1.5.1/lib/request_store/middleware.rb:19:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/request_id.rb:26:in `call'
bcea2002 | /usr/share/gems/gems/katello-4.11.0/lib/katello/prevent_json_parsing.rb:12:in `call'
bcea2002 | /usr/share/gems/gems/rack-2.2.8/lib/rack/method_override.rb:24:in `call'
bcea2002 | /usr/share/gems/gems/rack-2.2.8/lib/rack/runtime.rb:22:in `call'
bcea2002 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/executor.rb:14:in `call'
bcea2002 | /usr/share/gems/gems/rack-2.2.8/lib/rack/sendfile.rb:110:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/ssl.rb:77:in `call'
bcea2002 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/host_authorization.rb:142:in `call'
bcea2002 | /usr/share/gems/gems/secure_headers-6.5.0/lib/secure_headers/middleware.rb:11:in `call'
bcea2002 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/engine.rb:539:in `call'
bcea2002 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/railtie.rb:207:in `public_send'
bcea2002 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/railtie.rb:207:in `method_missing'
bcea2002 | /usr/share/gems/gems/rack-2.2.8/lib/rack/urlmap.rb:74:in `block in call'
bcea2002 | /usr/share/gems/gems/rack-2.2.8/lib/rack/urlmap.rb:58:in `each'
bcea2002 | /usr/share/gems/gems/rack-2.2.8/lib/rack/urlmap.rb:58:in `call'
bcea2002 | /usr/share/gems/gems/puma-6.4.0/lib/puma/configuration.rb:272:in `call'
bcea2002 | /usr/share/gems/gems/puma-6.4.0/lib/puma/request.rb:100:in `block in handle_request'
bcea2002 | /usr/share/gems/gems/puma-6.4.0/lib/puma/thread_pool.rb:378:in `with_force_shutdown'
bcea2002 | /usr/share/gems/gems/puma-6.4.0/lib/puma/request.rb:99:in `handle_request'
bcea2002 | /usr/share/gems/gems/puma-6.4.0/lib/puma/server.rb:443:in `process_client'
bcea2002 | /usr/share/gems/gems/puma-6.4.0/lib/puma/server.rb:241:in `block in run'
bcea2002 | /usr/share/gems/gems/puma-6.4.0/lib/puma/thread_pool.rb:155:in `block in spawn_thread'
bcea2002 | /usr/share/gems/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2024-03-14T12:36:25 [I|app|bcea2002] Rendered common/500.html.erb within layouts/application (Duration: 1.6ms | Allocations: 1169)
2024-03-14T12:36:25 [I|app|bcea2002] Rendered layouts/base.html.erb (Duration: 3.5ms | Allocations: 10764)
2024-03-14T12:36:25 [I|app|bcea2002] Rendered layout layouts/application.html.erb (Duration: 9.7ms | Allocations: 24674)
2024-03-14T12:36:25 [I|app|bcea2002] Completed 500 Internal Server Error in 187ms (Views: 10.3ms | ActiveRecord: 97.3ms | Allocations: 50997)

With Ansible as deployment method everything works fine!

No data to display

Actions

Also available in: Atom PDF