Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Issue is that Filter rules do not have a name field to sort on
Quick patch is below to use the id instead
/opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.51/app/controllers/katello/api/v2# diff -u content_view_filter_rules_controller.rb.150714-1 content_view_filter_rules_controller.rb
--- content_view_filter_rules_controller.rb.150714-1 2015-07-14 09:37:34.626750747 +0000
+++ content_view_filter_rules_controller.rb 2015-07-14 09:38:25.849705473 +0000
@@ -99,6 +99,10 @@
private
+ def sort_params
+ {sort_by: 'id'}
+ end
+
def find_filter
@filter = ContentViewFilter.find(params[:content_view_filter_id])
end
Better would be to have a rule_order field that also allows to specify the order of the rules to be applied
Listing a content view's filters succeeds when the content view is of type "rpm" or "package_group". It fails when the content view is of type "erratum". I've written a new automated test that verifies this fact, and the traceback in the first comment also mentions errata.
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, 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/RHBA-2016:1501
Description of problem: # curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999,\"organization_id\":3}" -XGET https://localhost/katello/api/v2/content_view_filters/17/rules {"displayMessage":"Unable to order by column 'name_sort'.","errors":["Unable to order by column 'name_sort'."]} Traces from Logs: 2015-07-13 13:46:17 [I] Processing by Katello::Api::V2::ContentViewFilterRulesController#index as */* 2015-07-13 13:46:17 [I] Parameters: {"per_page"=>9999, "api_version"=>"v2", "content_view_filter_id"=>"18", "content_view_filter_rule"=>{"per_page"=>9999}} 2015-07-13 13:46:17 [I] Authorized user hoici(hoici ) 2015-07-13 13:46:17 [E] RuntimeError: Unable to order by column 'name_sort'. /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.51/app/models/katello/glue/elastic_search/items.rb:129:in `handle_search_request_fail' /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.51/app/models/katello/glue/elastic_search/items.rb:124:in `rescue in retrieve' /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.51/app/models/katello/glue/elastic_search/items.rb:52:in `retrieve' /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.51/app/controllers/katello/api/v2/api_controller.rb:77:in `item_search' /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.51/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb:26:in `index' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `process_action' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in `block in process_action' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:528:in `block (4 levels) in _run__2536660760801069728__process_action__10151642543491308 72__callbacks' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_11549' /usr/share/foreman/app/controllers/api/v2/base_controller.rb:151:in `disable_json_root' ... /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request' /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop' /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads' /opt/rh/ruby193/root/usr/share/gems/gems/logging-1.8.1/lib/logging/diagnostic_context.rb:323:in `call' /opt/rh/ruby193/root/usr/share/gems/gems/logging-1.8.1/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context' caused by: (Tire::Search::SearchRequestFailed) 400 : {"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[sZsR1HcsSOu_0MFgsdIo5A][katello_katello::contentviewerratumfilterrule][0]: SearchParseException[[katello_katello::contentviewerratumfilterrule][0]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"match_all\":{}},\"sort\":[{\"name_sort\":\"asc\"}],\"filter\":{\"and\":[{\"terms\":{\"id\":[]}}]},\"size\":9999,\"from\":0,\"fields\":[\"id\"]}]]]; nested: SearchParseException[[katello_katello::contentviewerratumfilterrule][0]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [No mapping found for [name_sort] in order to sort on]]; }{[sZsR1HcsSOu_0MFgsdIo5A][katello_katello::contentviewerratumfilterrule][1]: SearchParseException[[katello_katello::contentviewerratumfilterrule][1]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"match_all\":{}},\"sort\":[{\"name_sort\":\"asc\"}],\"filter\":{\"and\":[{\"terms\":{\"id\":[]}}]},\"size\":9999,\"from\":0,\"fields\":[\"id\"]}]]]; nested: SearchParseException[[katello_katello::contentviewerratumfilterrule][1]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [No mapping found for [name_sort] in order to sort on]]; }{[sZsR1HcsSOu_0MFgsdIo5A][katello_katello::contentviewerratumfilterrule][2]: SearchParseException[[katello_katello::contentviewerratumfilterrule][2]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"match_all\":{}},\"sort\":[{\"name_sort\":\"asc\"}],\"filter\":{\"and\":[{\"terms\":{\"id\":[]}}]},\"size\":9999,\"from\":0,\"fields\":[\"id\"]}]]]; nested: SearchParseException[[katello_katello::contentviewerratumfilterrule][2]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [No mapping found for [name_sort] in order to sort on]]; }]","status":400} /opt/rh/ruby193/root/usr/share/gems/gems/tire-0.6.2/lib/tire/search.rb:145:in `perform' /opt/rh/ruby193/root/usr/share/gems/gems/tire-0.6.2/lib/tire/search.rb:35:in `results' /opt/rh/ruby193/root/usr/share/gems/gems/tire-0.6.2/lib/tire/model/search.rb:105:in `search' /opt/rh/ruby193/root/usr/share/gems/gems/tire-0.6.2/lib/tire/model/search.rb:300:in `search' /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.51/app/models/katello/glue/elastic_search/items.rb:85:in `retrieve' ... skipped 113 lines 2015-07-13 13:46:17 [I] Completed 500 Internal Server Error in 110ms (Views: 0.5ms | ActiveRecord: 7.5ms) Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Create filter 2. List filter rule 3. Actual results: Error Expected results: Listing of rules Additional info: