Bug #11920
closedAPI List content_view_filters rules error
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1242534
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: