Project

General

Profile

Actions

Bug #30079

closed

Searching for just "composite" in content views page causes ISE

Added by John Mitsch about 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Content Views
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

To reproduce:
- Navigate to /content_views
- search for just "composite"
- Check server logs

This isn't a huge deal now but will be if/when we add automatic searching on keystroke.


Related issues 1 (1 open0 closed)

Related to Katello - Tracker #29297: Content Publication WorkflowNew

Actions
Actions #1

Updated by John Mitsch about 4 years ago

Actions #2

Updated by Chris Roberts about 4 years ago

  • Triaged changed from No to Yes
Actions #3

Updated by Chris Roberts about 4 years ago

  • Target version changed from Katello 4.0.0 to Katello 3.17.0
Actions #4

Updated by James Jeffers about 4 years ago

Example production log:

16:25:04 rails.1   | 2020-08-07T16:25:04 [I|app|27d751bf] Started GET "/katello/api/v2/content_views?nondefault=true&organization_id=1&page=1&paged=true&per_page=20&search=+composite+&sort_by=name&sort_order=ASC" for 127.0.0.1 at 2020-08-07 16:25:04 +0000
16:25:05 rails.1   | 2020-08-07T16:25:05 [I|app|27d751bf] Processing by Katello::Api::V2::ContentViewsController#index as HTML
16:25:05 rails.1   | 2020-08-07T16:25:05 [I|app|27d751bf]   Parameters: {"nondefault"=>"true", "organization_id"=>"1", "page"=>"1", "paged"=>"true", "per_page"=>"20", "search"=>" composite ", "sort_by"=>"name", "sort_order"=>"ASC", "api_version"=>"v2"}
16:25:05 rails.1   | 2020-08-07T16:25:05 [E|app|27d751bf] ActiveRecord::PreparedStatementInvalid: wrong number of bind variables (0 for 1) in: (["(\"katello_content_views\".\"composite\" <> ?)", false])
16:25:05 rails.1   |  27d751bf | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.2/lib/active_record/sanitization.rb:209:in `raise_if_bind_arity_mismatch'
16:25:05 rails.1   |  27d751bf | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.2/lib/active_record/sanitization.rb:166:in `replace_bind_variables'
16:25:05 rails.1   |  27d751bf | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.2/lib/active_record/sanitization.rb:129:in `sanitize_sql_array'
16:25:05 rails.1   |  27d751bf | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.2/lib/active_record/sanitization.rb:26:in `sanitize_sql_for_conditions'
16:25:05 rails.1   |  27d751bf | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.2/lib/active_record/relation/where_clause_factory.rb:14:in `build'
16:25:05 rails.1   |  27d751bf | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.2/lib/active_record/relation/query_methods.rb:656:in `where!'
16:25:05 rails.1   |  27d751bf | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.2/lib/active_record/relation/query_methods.rb:649:in `where'
16:25:05 rails.1   |  27d751bf | /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/scoped_search-4.1.8/lib/scoped_search/definition.rb:329:in `block in register_named_scope!'
16:25:05 rails.1   |  27d751bf | /home/vagrant/projects/katello/app/controllers/katello/api/v2/api_controller.rb:81:in `scoped_search'
16:25:05 rails.1   |  27d751bf | /home/vagrant/projects/katello/app/controllers/katello/api/v2/content_views_controller.rb:46:in `index'

Actions #5

Updated by James Jeffers about 4 years ago

This appears to also affect searches for similar Boolean fields in the foreman project.

For example, /users?search=disabled&page=1 will also trigger an ISE.

This appears to be a defect in the scoped_search gem.

Actions #7

Updated by The Foreman Bot almost 4 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to James Jeffers
  • Pull request https://github.com/Katello/katello/pull/8913 added
Actions #8

Updated by The Foreman Bot almost 4 years ago

  • Fixed in Releases Katello 4.0.0 added
Actions #9

Updated by James Jeffers almost 4 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF