Bug #20272

Filtering user/user groups/capsules/compute profiles/compute resources with invalid field shows Internal Error

Added by Tomer Brisker 3 months ago. Updated 3 months ago.

Status:Closed
Priority:Normal
Assigned To:Tomer Brisker
Category:Search
Target version:-
Difficulty: Bugzilla link:1469148
Found in release: Pull request:https://github.com/theforeman/foreman/pull/4656
Story points-
Velocity based estimate-
Release1.15.3Release relationshipAuto

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1469148

Description of problem: We were trying to filter user/user groups/capsules/compute profiles/ compute resources. In filter, when we added field which was not present in list( any_string=any_string), it returned an error "Something went wrong" and log file had 500 Internal Server Error.

Version-Release number of selected component (if applicable): satellite 6.3.0 snap 6.0

How reproducible: always

Steps to Reproduce:
1. Navigate to Administer-> user/user groups/capsules/compute profiles/compute resources ( producible at any)
2. Filter as any_string=any_string

Actual results:
Shows the error as "Something went wrong" and the log file /var/log/foreman/production.log shows

Rendered common/500.html.erb within layouts/application (3.7ms)
2017-07-10 09:32:35 7d7c37e3 [app] [I] Rendered layouts/_application_content.html.erb (0.5ms)
2017-07-10 09:32:35 7d7c37e3 [app] [I] Rendered layouts/base.html.erb (2.6ms)
2017-07-10 09:32:35 7d7c37e3 [app] [I] Completed 500 Internal Server Error

Expected results: Error should be handled showing alert as "Field not recognised for searching" as happens in filtering hosts(Host -> All Hosts - > Filter ).

Additional info:

Associated revisions

Revision 53b3c0e0
Added by Tomer Brisker 3 months ago

Fixes #20272 - correctly rescue QueryNotSupported in production

When in production, the generic exception rescue shadows the
ScopedSearch::QueryNotSupported rescue method, preventing the correct
message being displayed on an invalid search.

Revision bcadf59f
Added by Tomer Brisker 3 months ago

Fixes #20272 - correctly rescue QueryNotSupported in production

When in production, the generic exception rescue shadows the
ScopedSearch::QueryNotSupported rescue method, preventing the correct
message being displayed on an invalid search.

History

#1 Updated by The Foreman Bot 3 months ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Tomer Brisker
  • Pull request https://github.com/theforeman/foreman/pull/4656 added

#2 Updated by Anonymous 3 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#3 Updated by Marek Hulán 3 months ago

  • Release set to 1.15.3

Based on PR this lands in 1.15.3, so setting the release

Also available in: Atom PDF