Project

General

Profile

Bug #30079

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

Added by John Mitsch over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Content Views
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
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

Related to Katello - Tracker #29297: Content Publication WorkflowNew

Associated revisions

Revision 8a1c4fa4 (diff)
Added by James Jeffers over 1 year ago

Fixes #30079 - workaround for ISE when search terms are used without true/false expression

History

#1 Updated by John Mitsch over 1 year ago

#2 Updated by Chris Roberts over 1 year ago

  • Triaged changed from No to Yes

#3 Updated by Chris Roberts over 1 year ago

  • Target version changed from Katello 4.0.0 to Katello 3.17.0

#4 Updated by James Jeffers over 1 year 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'

#5 Updated by James Jeffers over 1 year 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.

#7 Updated by The Foreman Bot over 1 year ago

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

#8 Updated by The Foreman Bot over 1 year ago

  • Fixed in Releases Katello 4.0.0 added

#9 Updated by James Jeffers over 1 year ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF