Host Repository Override multi-select error in 4.11

Problem:

After upgrading to Foreman 3.9 / Katello 4.11 I noticed that if the multi-select override button is used it ends in an error:
image

If the single override button beside the repo is used it works normally :+1:

Are you able to reproduce this or should I check my system for any inconsistencies?

Foreman and Proxy versions:

foreman-3.9.0-1.el8.noarch
katello-4.11.0-1.el8.noarch

Foreman and Proxy plugin versions:

  • VMware
  • Tasks
  • Ansible
  • Bootdisk
  • Puppet
  • Snapshot Management
  • Statistics

Distribution and version:

Other relevant data:

production log output:

2023-12-28T20:37:49 [I|app|048571b1] Started PUT "/api/v2/hosts/1/subscriptions/content_override" for 10.27.10.200 at 2023-12-28 20:37:49 +0100
2023-12-28T20:37:49 [I|app|048571b1] Processing by Katello::Api::V2::HostSubscriptionsController#content_override as JSON
2023-12-28T20:37:49 [I|app|048571b1]   Parameters: {"content_overrides_search"=>{"search"=>"id ^ (1631298726659)", "enabled"=>true, "remove"=>false}, "api_version"=>"v2", "host_id"=>"1", "host_subscription"=>{"content_overrides_search"=>{"search"=>"id ^ (1631298726659)", "enabled"=>true, "remove"=>false}}}
2023-12-28T20:37:49 [E|app|048571b1] ScopedSearch::QueryNotSupported: Field 'id' not recognized for searching!
 048571b1 | /usr/share/gems/gems/scoped_search-4.1.12/lib/scoped_search/query_builder.rb:509:in `to_single_field_sql'
 048571b1 | /usr/share/gems/gems/scoped_search-4.1.12/lib/scoped_search/query_builder.rb:530:in `to_sql'
 048571b1 | /usr/share/gems/gems/scoped_search-4.1.12/lib/scoped_search/query_builder.rb:56:in `build_find_params'
 048571b1 | /usr/share/gems/gems/scoped_search-4.1.12/lib/scoped_search/query_builder.rb:22:in `build_query'
 048571b1 | /usr/share/gems/gems/scoped_search-4.1.12/lib/scoped_search/definition.rb:328:in `block in register_named_scope!'
 048571b1 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/relation/delegation.rb:67:in `block in search_for'
 048571b1 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/relation.rb:406:in `block in scoping'
 048571b1 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/relation.rb:804:in `_scoping'
 048571b1 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/relation.rb:406:in `scoping'
 048571b1 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/relation/delegation.rb:67:in `search_for'
 048571b1 | /usr/share/gems/gems/katello-4.11.0/app/controllers/katello/api/v2/host_subscriptions_controller.rb:237:in `find_content_overrides'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:427:in `block in make_lambda'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:179:in `block (2 levels) in halting_and_conditional'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/callbacks.rb:34:in `block (2 levels) in <module:Callbacks>'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:180:in `block in halting_and_conditional'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:512:in `block in invoke_before'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:512:in `each'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:512:in `invoke_before'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:115:in `block in run_callbacks'
 048571b1 | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 048571b1 | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 048571b1 | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 048571b1 | /usr/share/gems/gems/audited-5.4.2/lib/audited/sweeper.rb:16:in `around'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 048571b1 | /usr/share/gems/gems/audited-5.4.2/lib/audited/sweeper.rb:16:in `around'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:137:in `run_callbacks'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/callbacks.rb:41:in `process_action'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/rescue.rb:22:in `process_action'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/notifications.rb:203:in `block in instrument'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/notifications.rb:203:in `instrument'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/instrumentation.rb:33:in `process_action'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
 048571b1 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
 048571b1 | /usr/share/gems/gems/katello-4.11.0/app/controllers/katello/concerns/api/api_controller.rb:46:in `process_action'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/base.rb:165:in `process'
 048571b1 | /usr/share/gems/gems/actionview-6.1.7.6/lib/action_view/rendering.rb:39:in `process'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal.rb:190:in `dispatch'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal.rb:254:in `dispatch'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/route_set.rb:33:in `serve'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/mapper.rb:49:in `serve'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:50:in `block in serve'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:32:in `each'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:32:in `serve'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/route_set.rb:842:in `call'
 048571b1 | /usr/share/gems/gems/katello-4.11.0/lib/katello/middleware/organization_created_enforcer.rb:18:in `call'
 048571b1 | /usr/share/gems/gems/katello-4.11.0/lib/katello/middleware/event_daemon.rb:10:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 048571b1 | /usr/share/gems/gems/apipie-dsl-2.6.1/lib/apipie_dsl/static_dispatcher.rb:67:in `call'
 048571b1 | /usr/share/gems/gems/apipie-rails-1.2.3/lib/apipie/static_dispatcher.rb:68:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 048571b1 | /usr/share/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
 048571b1 | /usr/share/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
 048571b1 | /usr/share/gems/gems/apipie-rails-1.2.3/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
 048571b1 | /usr/share/gems/gems/prometheus-client-4.2.2/lib/prometheus/middleware/exporter.rb:33:in `call'
 048571b1 | /usr/share/gems/gems/rack-2.2.8/lib/rack/tempfile_reaper.rb:15:in `call'
 048571b1 | /usr/share/gems/gems/rack-2.2.8/lib/rack/etag.rb:27:in `call'
 048571b1 | /usr/share/gems/gems/rack-2.2.8/lib/rack/conditional_get.rb:40:in `call'
 048571b1 | /usr/share/gems/gems/rack-2.2.8/lib/rack/head.rb:12:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/http/permissions_policy.rb:22:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/http/content_security_policy.rb:19:in `call'
 048571b1 | /usr/share/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
 048571b1 | /usr/share/gems/gems/rack-2.2.8/lib/rack/session/abstract/id.rb:266:in `context'
 048571b1 | /usr/share/gems/gems/rack-2.2.8/lib/rack/session/abstract/id.rb:260:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/cookies.rb:697:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:98:in `run_callbacks'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
 048571b1 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/rack/logger.rb:37:in `call_app'
 048571b1 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/rack/logger.rb:28:in `call'
 048571b1 | /usr/share/gems/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
 048571b1 | /usr/share/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
 048571b1 | /usr/share/gems/gems/request_store-1.5.1/lib/request_store/middleware.rb:19:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/request_id.rb:26:in `call'
 048571b1 | /usr/share/gems/gems/katello-4.11.0/lib/katello/prevent_json_parsing.rb:12:in `call'
 048571b1 | /usr/share/gems/gems/rack-2.2.8/lib/rack/method_override.rb:24:in `call'
 048571b1 | /usr/share/gems/gems/rack-2.2.8/lib/rack/runtime.rb:22:in `call'
 048571b1 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/executor.rb:14:in `call'
 048571b1 | /usr/share/gems/gems/rack-2.2.8/lib/rack/sendfile.rb:110:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/ssl.rb:77:in `call'
 048571b1 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/host_authorization.rb:142:in `call'
 048571b1 | /usr/share/gems/gems/secure_headers-6.5.0/lib/secure_headers/middleware.rb:11:in `call'
 048571b1 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/engine.rb:539:in `call'
 048571b1 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/railtie.rb:207:in `public_send'
 048571b1 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/railtie.rb:207:in `method_missing'
 048571b1 | /usr/share/gems/gems/rack-2.2.8/lib/rack/urlmap.rb:74:in `block in call'
 048571b1 | /usr/share/gems/gems/rack-2.2.8/lib/rack/urlmap.rb:58:in `each'
 048571b1 | /usr/share/gems/gems/rack-2.2.8/lib/rack/urlmap.rb:58:in `call'
 048571b1 | /usr/share/gems/gems/puma-6.4.0/lib/puma/configuration.rb:272:in `call'
 048571b1 | /usr/share/gems/gems/puma-6.4.0/lib/puma/request.rb:100:in `block in handle_request'
 048571b1 | /usr/share/gems/gems/puma-6.4.0/lib/puma/thread_pool.rb:378:in `with_force_shutdown'
 048571b1 | /usr/share/gems/gems/puma-6.4.0/lib/puma/request.rb:99:in `handle_request'
 048571b1 | /usr/share/gems/gems/puma-6.4.0/lib/puma/server.rb:443:in `process_client'
 048571b1 | /usr/share/gems/gems/puma-6.4.0/lib/puma/server.rb:241:in `block in run'
 048571b1 | /usr/share/gems/gems/puma-6.4.0/lib/puma/thread_pool.rb:155:in `block in spawn_thread'
 048571b1 | /usr/share/gems/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2023-12-28T20:37:49 [I|app|048571b1] Completed 500 Internal Server Error in 13ms (Views: 0.1ms | ActiveRecord: 1.9ms | Allocations: 5454)

I am able to reproduce this. Looking into it now.

1 Like

Think I figured it out. Good catch!

Awesome!
Thank you for looking into it so quickly Jeremy :beers: